Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Running on
* Android
* Desktop
* Web (Wasm)
* Web (Kotlin/JS) - contributed by https://github.com/yogeshVU
* Kotlin Notebook
* MCP Server

Expand Down
1 change: 1 addition & 0 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ kotlin {
implementation(libs.voyager)

implementation(libs.kmpObservableViewModel)
implementation(libs.lifecycleViewmodel)

implementation(libs.koalaplot)
implementation(libs.treemap.chart)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ai.koog.agents.features.eventHandler.feature.EventHandler
import ai.koog.prompt.dsl.prompt
import ai.koog.prompt.executor.model.PromptExecutor
import ai.koog.prompt.llm.LLModel
import ai.koog.prompt.message.Message
import dev.johnoreilly.climatetrace.BuildKonfig
import dev.johnoreilly.climatetrace.data.ClimateTraceRepository
import kotlin.time.ExperimentalTime
Expand Down Expand Up @@ -72,7 +73,12 @@ class ClimateTraceAgentProvider(
}

// No more tool calls: deliver assistant message to UI and get possible user follow-up
lastAssistantMessage = responses.first().asAssistantMessage().content

// Find the assistant message, skipping any reasoning messages
val assistantMessage = responses.filterIsInstance<Message.Assistant>().firstOrNull()
?: responses.first().asAssistantMessage() // fallback

lastAssistantMessage = assistantMessage.content
val userReply = onAssistantMessage(lastAssistantMessage)

// If user provides no reply, consider conversation finished and return assistant response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class GetCountryTool(val climateTraceRepository: ClimateTraceRepository) : Simpl
if (countryList == null) {
countryList = climateTraceRepository.fetchCountries()
}
return countryList?.firstOrNull { it.name == args.countryName }?.alpha3 ?: ""
val result = countryList?.firstOrNull { it.name == args.countryName }?.alpha3 ?: ""
return result
} catch (e: Exception) {
println("Error: $e")
return ""
Expand Down
14 changes: 8 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
kotlin = "2.3.0"
ksp = "2.3.2"
kotlinx-coroutines = "1.10.2"
kotlinx-serialization = "1.9.0"
kotlinx-serialization = "1.10.0"
kotlinx-dateTime = "0.7.1-0.6.x-compat"

agp = "8.12.3"
android-compileSdk = "36"
android-minSdk = "24"
android-targetSdk = "36"
androidx-activityCompose = "1.12.2"
androidx-activityCompose = "1.12.3"
androidx-datastore = "1.2.0"
compose = "1.10.1"
compose = "1.10.2"
compose-plugin = "1.10.0"
composeAdaptiveLayout = "1.2.0"
harawata-appdirs = "1.5.0"
Expand All @@ -20,16 +20,17 @@ koin = "4.1.1"
koin-compose-multiplatform = "4.1.1"
kmpNativeCoroutines = "1.0.0"
kmpObservableViewModel = "1.0.1"
lifecycle-viewmodel = "2.9.6"
kstore = "1.0.0"
ktor = "3.3.3"
ktor = "3.4.0"
treemapChart = "0.1.3"
voyager= "1.1.0-beta03"
molecule = "2.2.0"
mcp = "0.8.1"
mcp = "0.8.3"
shadowPlugin = "9.3.1"
jib = "3.5.2"
googleAdk = "0.5.0"
koogAgents = "0.6.0"
koogAgents = "0.6.1"
markdownRenderer = "0.39.1"
buildkonfig = "0.17.1"

Expand Down Expand Up @@ -58,6 +59,7 @@ kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serializa
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinx-dateTime" }

kmpObservableViewModel = { module = "com.rickclephas.kmp:kmp-observableviewmodel-core", version.ref = "kmpObservableViewModel" }
lifecycleViewmodel = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel", version.ref = "lifecycle-viewmodel" }

kstore = { module = "io.github.xxfast:kstore", version.ref = "kstore" }
kstore-file = { module = "io.github.xxfast:kstore-file", version.ref = "kstore" }
Expand Down
Binary file not shown.