Skip to content

Commit b8d36ce

Browse files
Riandycmodi-meta
authored andcommitted
update sdk to 0.2.2
1 parent aa17cce commit b8d36ce

25 files changed

+1225
-5338
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ buildscript {
1515

1616
allprojects {
1717
group = "com.llama.llamastack"
18-
version = "0.2.1"
18+
version = "0.2.2"
1919
}
2020

2121
subprojects {

examples/android_app/app/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ dependencies {
7373
implementation(files("libs/executorch.aar"))
7474
implementation("com.squareup.okhttp3:okhttp:4.10.0")
7575
implementation("com.google.guava:guava:31.0-jre")
76-
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.1")
77-
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.1")
78-
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.1")
76+
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2")
77+
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2")
78+
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2")
7979
// implementation("com.llama.llamastack:llama-stack-client-kotlin:0.2.1")
8080
// This is needed if you are using local built jars instead of the pre-built ones from maven
8181
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))

llama-stack-client-kotlin-client-okhttp/src/main/kotlin/com/llama/llamastack/client/okhttp/LlamaStackClientOkHttpClient.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,10 @@ class LlamaStackClientOkHttpClient private constructor() {
2929
class Builder internal constructor() {
3030

3131
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
32-
private var baseUrl: String = ClientOptions.PRODUCTION_URL
3332
private var timeout: Timeout = Timeout.default()
3433
private var proxy: Proxy? = null
3534

36-
fun baseUrl(baseUrl: String) = apply {
37-
clientOptions.baseUrl(baseUrl)
38-
this.baseUrl = baseUrl
39-
}
35+
fun baseUrl(baseUrl: String) = apply { clientOptions.baseUrl(baseUrl) }
4036

4137
/**
4238
* Whether to throw an exception if any of the Jackson versions detected at runtime are
@@ -169,7 +165,7 @@ class LlamaStackClientOkHttpClient private constructor() {
169165
clientOptions
170166
.httpClient(
171167
OkHttpClient.builder()
172-
.baseUrl(baseUrl)
168+
.baseUrl(clientOptions.baseUrl())
173169
.timeout(timeout)
174170
.proxy(proxy)
175171
.build()

llama-stack-client-kotlin-client-okhttp/src/main/kotlin/com/llama/llamastack/client/okhttp/LlamaStackClientOkHttpClientAsync.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,10 @@ class LlamaStackClientOkHttpClientAsync private constructor() {
3030
class Builder internal constructor() {
3131

3232
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
33-
private var baseUrl: String = ClientOptions.PRODUCTION_URL
3433
private var timeout: Timeout = Timeout.default()
3534
private var proxy: Proxy? = null
3635

37-
fun baseUrl(baseUrl: String) = apply {
38-
clientOptions.baseUrl(baseUrl)
39-
this.baseUrl = baseUrl
40-
}
36+
fun baseUrl(baseUrl: String) = apply { clientOptions.baseUrl(baseUrl) }
4137

4238
/**
4339
* Whether to throw an exception if any of the Jackson versions detected at runtime are
@@ -170,7 +166,7 @@ class LlamaStackClientOkHttpClientAsync private constructor() {
170166
clientOptions
171167
.httpClient(
172168
OkHttpClient.builder()
173-
.baseUrl(baseUrl)
169+
.baseUrl(clientOptions.baseUrl())
174170
.timeout(timeout)
175171
.proxy(proxy)
176172
.build()

llama-stack-client-kotlin-core/build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ configurations.all {
1717
}
1818

1919
dependencies {
20-
api("com.fasterxml.jackson.core:jackson-core:2.18.1")
21-
api("com.fasterxml.jackson.core:jackson-databind:2.18.1")
20+
api("com.fasterxml.jackson.core:jackson-core:2.18.2")
21+
api("com.fasterxml.jackson.core:jackson-databind:2.18.2")
2222
api("com.google.errorprone:error_prone_annotations:2.33.0")
2323

24-
implementation("com.fasterxml.jackson.core:jackson-annotations:2.18.1")
25-
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.1")
26-
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.1")
27-
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.1")
24+
implementation("com.fasterxml.jackson.core:jackson-annotations:2.18.2")
25+
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2")
26+
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2")
27+
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2")
2828
implementation("org.apache.httpcomponents.core5:httpcore5:5.2.4")
2929
implementation("org.apache.httpcomponents.client5:httpclient5:5.3.1")
3030
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")

llama-stack-client-kotlin-core/src/main/kotlin/com/llama/llamastack/core/Check.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ internal fun checkMaxLength(name: String, value: String, maxLength: Int): String
3737
internal fun checkJacksonVersionCompatibility() {
3838
val incompatibleJacksonVersions =
3939
RUNTIME_JACKSON_VERSIONS.mapNotNull {
40+
val badVersionReason = BAD_JACKSON_VERSIONS[it.toString()]
4041
when {
4142
it.majorVersion != MINIMUM_JACKSON_VERSION.majorVersion ->
4243
it to "incompatible major version"
@@ -45,6 +46,7 @@ internal fun checkJacksonVersionCompatibility() {
4546
it.minorVersion == MINIMUM_JACKSON_VERSION.minorVersion &&
4647
it.patchLevel < MINIMUM_JACKSON_VERSION.patchLevel ->
4748
it to "patch version too low"
49+
badVersionReason != null -> it to badVersionReason
4850
else -> null
4951
}
5052
}
@@ -67,6 +69,8 @@ Double-check that you are depending on compatible Jackson versions.
6769
}
6870

6971
private val MINIMUM_JACKSON_VERSION: Version = VersionUtil.parseVersion("2.13.4", null, null)
72+
private val BAD_JACKSON_VERSIONS: Map<String, String> =
73+
mapOf("2.18.1" to "due to https://github.com/FasterXML/jackson-databind/issues/4639")
7074
private val RUNTIME_JACKSON_VERSIONS: List<Version> =
7175
listOf(
7276
com.fasterxml.jackson.core.json.PackageVersion.VERSION,

llama-stack-client-kotlin-core/src/main/kotlin/com/llama/llamastack/core/ClientOptions.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,12 @@ private constructor(
182182

183183
fun removeAllQueryParams(keys: Set<String>) = apply { queryParams.removeAll(keys) }
184184

185-
fun fromEnv() = apply { System.getenv("LLAMA_STACK_API_KEY")?.let { apiKey(it) } }
185+
fun baseUrl(): String = baseUrl
186+
187+
fun fromEnv() = apply {
188+
System.getenv("LLAMA_STACK_BASE_URL")?.let { baseUrl(it) }
189+
System.getenv("LLAMA_STACK_API_KEY")?.let { apiKey(it) }
190+
}
186191

187192
/**
188193
* Returns an immutable instance of [ClientOptions].

0 commit comments

Comments
 (0)