Skip to content
This repository has been archived by the owner on Feb 9, 2025. It is now read-only.

Commit

Permalink
chore: removed unnecessary logging messsages
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldziher committed Dec 10, 2023
1 parent 989fbc4 commit 349e39b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
.idea/assetWizardSettings.xml
.idea/caches
.idea/dictionaries
.idea/discord.xml
.idea/libraries
.idea/modules
.idea/shelf
.idea/sonarlint
.idea/workspace.xml
.idea/discord.xml
build/
coverage/
dist/
local.properties
node_modules/
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.1.0'
rev: 'v4.0.0-alpha.4'
hooks:
- id: prettier
exclude: '.idea/modules'
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch

val client = BaseMindClient.getInstance(ConfigModel.apiKey, options = Options(debug = true))

class MainViewModel : ViewModel() {
val conversation: StateFlow<List<ChatUiModel.Message>>
get() = _conversation
Expand All @@ -29,7 +31,6 @@ class MainViewModel : ViewModel() {
viewModelScope.launch {
_conversation.emit(_conversation.value + myChat)

val client = BaseMindClient.getInstance(ConfigModel.apiKey, options = Options(debug = true))
try {
val map = mapOf("userInput" to msg)

Expand Down
9 changes: 4 additions & 5 deletions sdk/src/main/kotlin/ai/basemind/client/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ class BaseMindClient private constructor(
promptConfigId: String? = null,
options: Options = Options(),
): BaseMindClient {
options.debugLogger(LOGGING_TAG, "creating client instance")
options.debugLogger(LOGGING_TAG, "apiToken: $apiToken")
if (options.debug) {
options.debugLogger(LOGGING_TAG, "creating client instance")
}

val key = options.hashCode() + apiToken.hashCode() + promptConfigId.hashCode()

Expand Down Expand Up @@ -142,10 +143,7 @@ class BaseMindClient private constructor(

private fun createMetadata(): Metadata {
val metadata = Metadata()

options.debugLogger(LOGGING_TAG, "creating metadata")
metadata.put(Metadata.Key.of("authorization", Metadata.ASCII_STRING_MARSHALLER), "Bearer $apiToken")
options.debugLogger(LOGGING_TAG, "metadata created: $apiToken")
return metadata
}

Expand Down Expand Up @@ -196,6 +194,7 @@ class BaseMindClient private constructor(
if (options.debug) {
options.debugLogger(LOGGING_TAG, "exception requesting streaming prompt: $e")
}

if (e !is StatusException) {
throw e // skipcq: TCV-001
}
Expand Down

0 comments on commit 349e39b

Please sign in to comment.