Skip to content

Commit 5901a16

Browse files
committed
Optimize dependencies and update project setup
Reduces the library’s transitive footprint by making JDBC drivers and the connection pool `compileOnly`, so applications are no longer forced to pull in specific database drivers they may not use. It also stops the Spring Boot starter from implicitly choosing a Ktor client engine, requiring consumers to select the engine that best fits their environment and avoiding version and engine conflicts. The updated docs clarify these explicit dependency requirements, and the logging configuration helps keep test logs readable while still surfacing useful debug information. - Switched optional JDBC drivers to `compileOnly` for reduced transitive dependencies. - Added `logback.xml` to configure logging levels and prevent excessive logs. - Exclude Ktor client engine from spring-boot transitive dependencies and updated documentation
1 parent 9fa1df1 commit 5901a16

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

a2a/a2a-server/src/jvmTest/kotlin/ai/koog/a2a/server/.gitkeep

Whitespace-only changes.

agents/agents-features/agents-features-sql/build.gradle.kts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ kotlin {
3535
api(libs.exposed.jdbc)
3636
api(libs.exposed.json)
3737
api(libs.exposed.kotlin.datetime)
38-
api(libs.postgresql)
39-
api(libs.mysql)
40-
api(libs.h2)
41-
api(libs.sqlite)
38+
compileOnly(libs.h2)
39+
compileOnly(libs.mysql)
40+
compileOnly(libs.postgresql)
41+
compileOnly(libs.sqlite)
4242
implementation(libs.hikaricp)
4343
}
4444
}
@@ -52,6 +52,11 @@ kotlin {
5252
implementation(libs.testcontainers)
5353
implementation(libs.testcontainers.postgresql)
5454
implementation(libs.testcontainers.mysql)
55+
56+
runtimeOnly(libs.postgresql)
57+
runtimeOnly(libs.mysql)
58+
runtimeOnly(libs.h2)
59+
runtimeOnly(libs.sqlite)
5560
}
5661
}
5762
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<configuration>
2+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
3+
<encoder>
4+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
5+
</encoder>
6+
</appender>
7+
8+
<logger name="ai.koog" level="debug" />
9+
<logger name="com.github.dockerjava" level="error" />
10+
11+
<root level="INFO">
12+
<appender-ref ref="STDOUT" />
13+
</root>
14+
</configuration>

docs/docs/spring-boot.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ ready-to-use beans for dependency injection. It supports all major LLM providers
1919

2020
### 1. Add Dependency
2121

22-
Add the Spring Boot starter to your `build.gradle.kts`:
22+
Add the Koog Spring Boot starter and [Ktor Client Engine](https://ktor.io/docs/client-engines.html#jvm)
23+
to your `build.gradle.kts` or `pom.xml`:
2324

2425
```kotlin
2526
dependencies {
2627
implementation("ai.koog:koog-spring-boot-starter:$koogVersion")
28+
implementation("io.ktor:ktor-client-okhttp-jvm:$ktorVersion")
2729
}
2830
```
2931

koog-spring-boot-starter/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ dependencies {
3434
implementation(project.dependencies.platform(libs.spring.boot.bom))
3535
api(libs.bundles.spring.boot.core)
3636
api(libs.reactor.kotlin.extensions)
37-
runtimeOnly(libs.ktor.client.apache5)
3837

3938
testImplementation(libs.spring.boot.starter.test)
4039
testRuntimeOnly(libs.junit.platform.launcher)
40+
testRuntimeOnly(libs.ktor.client.apache5)
4141
}
4242

4343
publishToMaven()

0 commit comments

Comments
 (0)