Skip to content

Commit 749cfc2

Browse files
committed
upgrade SDK to 0.1.7
Stainless commit: 9d5bcbdaca0b4be183e8719358d19fbb58b5e22d
1 parent 42bbb97 commit 749cfc2

File tree

382 files changed

+31187
-6798
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

382 files changed

+31187
-6798
lines changed

build.gradle.kts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
plugins {
2-
2+
id("org.jetbrains.dokka") version "2.0.0"
33
}
44

55
allprojects {
66
group = "com.llama.llamastack"
7-
version = "0.1.4.2"
7+
version = "0.1.7"
8+
}
9+
10+
subprojects {
11+
apply(plugin = "org.jetbrains.dokka")
812
}
13+
14+
// Avoid race conditions between `dokkaHtmlCollector` and `dokkaJavadocJar` tasks
15+
tasks.named("dokkaHtmlCollector").configure {
16+
subprojects.flatMap { it.tasks }
17+
.filter { it.project.name != "llama-stack-client-kotlin" && it.name == "dokkaJavadocJar" }
18+
.forEach { mustRunAfter(it) }
19+
}

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper
66
import com.llama.llamastack.client.LlamaStackClientClient
77
import com.llama.llamastack.client.LlamaStackClientClientImpl
88
import com.llama.llamastack.core.ClientOptions
9+
import com.llama.llamastack.core.Timeout
910
import com.llama.llamastack.core.http.Headers
1011
import com.llama.llamastack.core.http.QueryParams
1112
import java.net.Proxy
@@ -16,6 +17,9 @@ class LlamaStackClientOkHttpClient private constructor() {
1617

1718
companion object {
1819

20+
/**
21+
* Returns a mutable builder for constructing an instance of [LlamaStackClientOkHttpClient].
22+
*/
1923
fun builder() = Builder()
2024

2125
fun fromEnv(): LlamaStackClientClient = builder().fromEnv().build()
@@ -26,8 +30,7 @@ class LlamaStackClientOkHttpClient private constructor() {
2630

2731
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
2832
private var baseUrl: String = ClientOptions.PRODUCTION_URL
29-
// The default timeout for the client is 1 minute.
30-
private var timeout: Duration = Duration.ofSeconds(60)
33+
private var timeout: Timeout = Timeout.default()
3134
private var proxy: Proxy? = null
3235

3336
fun baseUrl(baseUrl: String) = apply {
@@ -119,7 +122,19 @@ class LlamaStackClientOkHttpClient private constructor() {
119122
clientOptions.removeAllQueryParams(keys)
120123
}
121124

122-
fun timeout(timeout: Duration) = apply { this.timeout = timeout }
125+
fun timeout(timeout: Timeout) = apply {
126+
clientOptions.timeout(timeout)
127+
this.timeout = timeout
128+
}
129+
130+
/**
131+
* Sets the maximum time allowed for a complete HTTP call, not including retries.
132+
*
133+
* See [Timeout.request] for more details.
134+
*
135+
* For fine-grained control, pass a [Timeout] object.
136+
*/
137+
fun timeout(timeout: Duration) = timeout(Timeout.builder().request(timeout).build())
123138

124139
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }
125140

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper
66
import com.llama.llamastack.client.LlamaStackClientClientAsync
77
import com.llama.llamastack.client.LlamaStackClientClientAsyncImpl
88
import com.llama.llamastack.core.ClientOptions
9+
import com.llama.llamastack.core.Timeout
910
import com.llama.llamastack.core.http.Headers
1011
import com.llama.llamastack.core.http.QueryParams
1112
import java.net.Proxy
@@ -16,6 +17,10 @@ class LlamaStackClientOkHttpClientAsync private constructor() {
1617

1718
companion object {
1819

20+
/**
21+
* Returns a mutable builder for constructing an instance of
22+
* [LlamaStackClientOkHttpClientAsync].
23+
*/
1924
fun builder() = Builder()
2025

2126
fun fromEnv(): LlamaStackClientClientAsync = builder().fromEnv().build()
@@ -26,8 +31,7 @@ class LlamaStackClientOkHttpClientAsync private constructor() {
2631

2732
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
2833
private var baseUrl: String = ClientOptions.PRODUCTION_URL
29-
// The default timeout for the client is 1 minute.
30-
private var timeout: Duration = Duration.ofSeconds(60)
34+
private var timeout: Timeout = Timeout.default()
3135
private var proxy: Proxy? = null
3236

3337
fun baseUrl(baseUrl: String) = apply {
@@ -119,7 +123,19 @@ class LlamaStackClientOkHttpClientAsync private constructor() {
119123
clientOptions.removeAllQueryParams(keys)
120124
}
121125

122-
fun timeout(timeout: Duration) = apply { this.timeout = timeout }
126+
fun timeout(timeout: Timeout) = apply {
127+
clientOptions.timeout(timeout)
128+
this.timeout = timeout
129+
}
130+
131+
/**
132+
* Sets the maximum time allowed for a complete HTTP call, not including retries.
133+
*
134+
* See [Timeout.request] for more details.
135+
*
136+
* For fine-grained control, pass a [Timeout] object.
137+
*/
138+
fun timeout(timeout: Duration) = timeout(Timeout.builder().request(timeout).build())
123139

124140
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }
125141

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.llama.llamastack.client.okhttp
22

33
import com.llama.llamastack.core.RequestOptions
4+
import com.llama.llamastack.core.Timeout
45
import com.llama.llamastack.core.checkRequired
56
import com.llama.llamastack.core.http.Headers
67
import com.llama.llamastack.core.http.HttpClient
@@ -79,13 +80,12 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
7980
)
8081
}
8182

82-
val timeout = requestOptions.timeout
83-
if (timeout != null) {
83+
requestOptions.timeout?.let {
8484
clientBuilder
85-
.connectTimeout(timeout)
86-
.readTimeout(timeout)
87-
.writeTimeout(timeout)
88-
.callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30))
85+
.connectTimeout(it.connect())
86+
.readTimeout(it.read())
87+
.writeTimeout(it.write())
88+
.callTimeout(it.request())
8989
}
9090

9191
val client = clientBuilder.build()
@@ -203,23 +203,24 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
203203
class Builder internal constructor() {
204204

205205
private var baseUrl: HttpUrl? = null
206-
// The default timeout is 1 minute.
207-
private var timeout: Duration = Duration.ofSeconds(60)
206+
private var timeout: Timeout = Timeout.default()
208207
private var proxy: Proxy? = null
209208

210209
fun baseUrl(baseUrl: String) = apply { this.baseUrl = baseUrl.toHttpUrl() }
211210

212-
fun timeout(timeout: Duration) = apply { this.timeout = timeout }
211+
fun timeout(timeout: Timeout) = apply { this.timeout = timeout }
212+
213+
fun timeout(timeout: Duration) = timeout(Timeout.builder().request(timeout).build())
213214

214215
fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }
215216

216217
fun build(): OkHttpClient =
217218
OkHttpClient(
218219
okhttp3.OkHttpClient.Builder()
219-
.connectTimeout(timeout)
220-
.readTimeout(timeout)
221-
.writeTimeout(timeout)
222-
.callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30))
220+
.connectTimeout(timeout.connect())
221+
.readTimeout(timeout.read())
222+
.writeTimeout(timeout.write())
223+
.callTimeout(timeout.request())
223224
.proxy(proxy)
224225
.build(),
225226
checkRequired("baseUrl", baseUrl),

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

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ interface LlamaStackClientClient {
5050
*/
5151
fun async(): LlamaStackClientClientAsync
5252

53+
/**
54+
* Returns a view of this service that provides access to raw HTTP responses for each method.
55+
*/
56+
fun withRawResponse(): WithRawResponse
57+
5358
fun toolgroups(): ToolgroupService
5459

5560
fun tools(): ToolService
@@ -108,4 +113,57 @@ interface LlamaStackClientClient {
108113
* method.
109114
*/
110115
fun close()
116+
117+
/**
118+
* A view of [LlamaStackClientClient] that provides access to raw HTTP responses for each
119+
* method.
120+
*/
121+
interface WithRawResponse {
122+
123+
fun toolgroups(): ToolgroupService.WithRawResponse
124+
125+
fun tools(): ToolService.WithRawResponse
126+
127+
fun toolRuntime(): ToolRuntimeService.WithRawResponse
128+
129+
fun agents(): AgentService.WithRawResponse
130+
131+
fun batchInference(): BatchInferenceService.WithRawResponse
132+
133+
fun datasets(): DatasetService.WithRawResponse
134+
135+
fun eval(): EvalService.WithRawResponse
136+
137+
fun inspect(): InspectService.WithRawResponse
138+
139+
fun inference(): InferenceService.WithRawResponse
140+
141+
fun vectorIo(): VectorIoService.WithRawResponse
142+
143+
fun vectorDbs(): VectorDbService.WithRawResponse
144+
145+
fun models(): ModelService.WithRawResponse
146+
147+
fun postTraining(): PostTrainingService.WithRawResponse
148+
149+
fun providers(): ProviderService.WithRawResponse
150+
151+
fun routes(): RouteService.WithRawResponse
152+
153+
fun safety(): SafetyService.WithRawResponse
154+
155+
fun shields(): ShieldService.WithRawResponse
156+
157+
fun syntheticDataGeneration(): SyntheticDataGenerationService.WithRawResponse
158+
159+
fun telemetry(): TelemetryService.WithRawResponse
160+
161+
fun datasetio(): DatasetioService.WithRawResponse
162+
163+
fun scoring(): ScoringService.WithRawResponse
164+
165+
fun scoringFunctions(): ScoringFunctionService.WithRawResponse
166+
167+
fun benchmarks(): BenchmarkService.WithRawResponse
168+
}
111169
}

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

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ interface LlamaStackClientClientAsync {
5050
*/
5151
fun sync(): LlamaStackClientClient
5252

53+
/**
54+
* Returns a view of this service that provides access to raw HTTP responses for each method.
55+
*/
56+
fun withRawResponse(): WithRawResponse
57+
5358
fun toolgroups(): ToolgroupServiceAsync
5459

5560
fun tools(): ToolServiceAsync
@@ -108,4 +113,57 @@ interface LlamaStackClientClientAsync {
108113
* method.
109114
*/
110115
fun close()
116+
117+
/**
118+
* A view of [LlamaStackClientClientAsync] that provides access to raw HTTP responses for each
119+
* method.
120+
*/
121+
interface WithRawResponse {
122+
123+
fun toolgroups(): ToolgroupServiceAsync.WithRawResponse
124+
125+
fun tools(): ToolServiceAsync.WithRawResponse
126+
127+
fun toolRuntime(): ToolRuntimeServiceAsync.WithRawResponse
128+
129+
fun agents(): AgentServiceAsync.WithRawResponse
130+
131+
fun batchInference(): BatchInferenceServiceAsync.WithRawResponse
132+
133+
fun datasets(): DatasetServiceAsync.WithRawResponse
134+
135+
fun eval(): EvalServiceAsync.WithRawResponse
136+
137+
fun inspect(): InspectServiceAsync.WithRawResponse
138+
139+
fun inference(): InferenceServiceAsync.WithRawResponse
140+
141+
fun vectorIo(): VectorIoServiceAsync.WithRawResponse
142+
143+
fun vectorDbs(): VectorDbServiceAsync.WithRawResponse
144+
145+
fun models(): ModelServiceAsync.WithRawResponse
146+
147+
fun postTraining(): PostTrainingServiceAsync.WithRawResponse
148+
149+
fun providers(): ProviderServiceAsync.WithRawResponse
150+
151+
fun routes(): RouteServiceAsync.WithRawResponse
152+
153+
fun safety(): SafetyServiceAsync.WithRawResponse
154+
155+
fun shields(): ShieldServiceAsync.WithRawResponse
156+
157+
fun syntheticDataGeneration(): SyntheticDataGenerationServiceAsync.WithRawResponse
158+
159+
fun telemetry(): TelemetryServiceAsync.WithRawResponse
160+
161+
fun datasetio(): DatasetioServiceAsync.WithRawResponse
162+
163+
fun scoring(): ScoringServiceAsync.WithRawResponse
164+
165+
fun scoringFunctions(): ScoringFunctionServiceAsync.WithRawResponse
166+
167+
fun benchmarks(): BenchmarkServiceAsync.WithRawResponse
168+
}
111169
}

0 commit comments

Comments
 (0)