Skip to content

Commit 2868ae8

Browse files
authored
Merge pull request #230 from joreilly/dep_updates
koog updates
2 parents 40039b3 + e36a636 commit 2868ae8

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Running on
88
* Android
99
* Desktop
1010
* Web (Wasm)
11-
* Web (Kotlin/JS) - contributed by https://github.com/yogeshVU
1211
* Kotlin Notebook
1312
* MCP Server
1413

composeApp/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ kotlin {
7979
implementation(libs.voyager)
8080

8181
implementation(libs.kmpObservableViewModel)
82+
implementation(libs.lifecycleViewmodel)
8283

8384
implementation(libs.koalaplot)
8485
implementation(libs.treemap.chart)

composeApp/src/commonMain/kotlin/dev/johnoreilly/climatetrace/agent/ClimateTraceAgentProvider.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import ai.koog.agents.features.eventHandler.feature.EventHandler
1414
import ai.koog.prompt.dsl.prompt
1515
import ai.koog.prompt.executor.model.PromptExecutor
1616
import ai.koog.prompt.llm.LLModel
17+
import ai.koog.prompt.message.Message
1718
import dev.johnoreilly.climatetrace.BuildKonfig
1819
import dev.johnoreilly.climatetrace.data.ClimateTraceRepository
1920
import kotlin.time.ExperimentalTime
@@ -72,7 +73,12 @@ class ClimateTraceAgentProvider(
7273
}
7374

7475
// No more tool calls: deliver assistant message to UI and get possible user follow-up
75-
lastAssistantMessage = responses.first().asAssistantMessage().content
76+
77+
// Find the assistant message, skipping any reasoning messages
78+
val assistantMessage = responses.filterIsInstance<Message.Assistant>().firstOrNull()
79+
?: responses.first().asAssistantMessage() // fallback
80+
81+
lastAssistantMessage = assistantMessage.content
7682
val userReply = onAssistantMessage(lastAssistantMessage)
7783

7884
// If user provides no reply, consider conversation finished and return assistant response

composeApp/src/commonMain/kotlin/dev/johnoreilly/climatetrace/agent/ClimateTraceTool.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class GetCountryTool(val climateTraceRepository: ClimateTraceRepository) : Simpl
3232
if (countryList == null) {
3333
countryList = climateTraceRepository.fetchCountries()
3434
}
35-
return countryList?.firstOrNull { it.name == args.countryName }?.alpha3 ?: ""
35+
val result = countryList?.firstOrNull { it.name == args.countryName }?.alpha3 ?: ""
36+
return result
3637
} catch (e: Exception) {
3738
println("Error: $e")
3839
return ""

gradle/libs.versions.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
kotlin = "2.3.0"
33
ksp = "2.3.2"
44
kotlinx-coroutines = "1.10.2"
5-
kotlinx-serialization = "1.9.0"
5+
kotlinx-serialization = "1.10.0"
66
kotlinx-dateTime = "0.7.1-0.6.x-compat"
77

88
agp = "8.12.3"
99
android-compileSdk = "36"
1010
android-minSdk = "24"
1111
android-targetSdk = "36"
12-
androidx-activityCompose = "1.12.2"
12+
androidx-activityCompose = "1.12.3"
1313
androidx-datastore = "1.2.0"
14-
compose = "1.10.1"
14+
compose = "1.10.2"
1515
compose-plugin = "1.10.0"
1616
composeAdaptiveLayout = "1.2.0"
1717
harawata-appdirs = "1.5.0"
@@ -20,16 +20,17 @@ koin = "4.1.1"
2020
koin-compose-multiplatform = "4.1.1"
2121
kmpNativeCoroutines = "1.0.0"
2222
kmpObservableViewModel = "1.0.1"
23+
lifecycle-viewmodel = "2.9.6"
2324
kstore = "1.0.0"
24-
ktor = "3.3.3"
25+
ktor = "3.4.0"
2526
treemapChart = "0.1.3"
2627
voyager= "1.1.0-beta03"
2728
molecule = "2.2.0"
28-
mcp = "0.8.1"
29+
mcp = "0.8.3"
2930
shadowPlugin = "9.3.1"
3031
jib = "3.5.2"
3132
googleAdk = "0.5.0"
32-
koogAgents = "0.6.0"
33+
koogAgents = "0.6.1"
3334
markdownRenderer = "0.39.1"
3435
buildkonfig = "0.17.1"
3536

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

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

6264
kstore = { module = "io.github.xxfast:kstore", version.ref = "kstore" }
6365
kstore-file = { module = "io.github.xxfast:kstore-file", version.ref = "kstore" }

0 commit comments

Comments
 (0)