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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AzureOpenAIServiceVersion private constructor(@get:JvmName("value") val va
@JvmStatic
fun latestPreviewVersion(): AzureOpenAIServiceVersion {
// We can update the value every preview announcement.
return V2025_01_01_PREVIEW
return V2025_03_01_PREVIEW
}

@JvmStatic
Expand All @@ -41,6 +41,8 @@ class AzureOpenAIServiceVersion private constructor(@get:JvmName("value") val va
@JvmStatic val V2024_10_01_PREVIEW = fromString("2024-10-01-preview")
@JvmStatic val V2024_12_01_PREVIEW = fromString("2024-12-01-preview")
@JvmStatic val V2025_01_01_PREVIEW = fromString("2025-01-01-preview")
@JvmStatic val V2025_02_01_PREVIEW = fromString("2025-02-01-preview")
@JvmStatic val V2025_03_01_PREVIEW = fromString("2025-03-01-preview")
}

override fun equals(other: Any?): Boolean =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ internal fun HttpRequest.Builder.addPathSegmentsForAzure(
clientOptions: ClientOptions,
deploymentModel: String?,
): HttpRequest.Builder = apply {
if (isAzureEndpoint(clientOptions.baseUrl) && deploymentModel != null) {
addPathSegments("openai", "deployments", deploymentModel)
if (isAzureEndpoint(clientOptions.baseUrl)) {
addPathSegment("openai")
deploymentModel?.let { addPathSegments("deployments", it) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ private constructor(
@get:JvmName("timeout") val timeout: Timeout,
@get:JvmName("maxRetries") val maxRetries: Int,
@get:JvmName("credential") val credential: Credential,
@get:JvmName("azureServiceVersion") val azureServiceVersion: AzureOpenAIServiceVersion?,
private val organization: String?,
private val project: String?,
) {
Expand Down Expand Up @@ -102,6 +103,7 @@ private constructor(
timeout = clientOptions.timeout
maxRetries = clientOptions.maxRetries
credential = clientOptions.credential
azureServiceVersion = clientOptions.azureServiceVersion
organization = clientOptions.organization
project = clientOptions.project
}
Expand Down Expand Up @@ -350,6 +352,7 @@ private constructor(
timeout,
maxRetries,
credential,
azureServiceVersion,
organization,
project,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ class ResponseServiceAsyncImpl internal constructor(private val clientOptions: C
.addPathSegments("responses")
.body(json(clientOptions.jsonMapper, params._body()))
.build()
.prepareAsync(
clientOptions,
params,
deploymentModel = params.model().toString(),
)
.prepareAsync(clientOptions, params, deploymentModel = null)
val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
return request
.thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
Expand Down Expand Up @@ -148,11 +144,7 @@ class ResponseServiceAsyncImpl internal constructor(private val clientOptions: C
)
)
.build()
.prepareAsync(
clientOptions,
params,
deploymentModel = params.model().toString(),
)
.prepareAsync(clientOptions, params, deploymentModel = null)
val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
return request
.thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ResponseServiceImpl internal constructor(private val clientOptions: Client
.addPathSegments("responses")
.body(json(clientOptions.jsonMapper, params._body()))
.build()
.prepare(clientOptions, params, deploymentModel = params.model().toString())
.prepare(clientOptions, params, deploymentModel = null)
val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
val response = clientOptions.httpClient.execute(request, requestOptions)
return response.parseable {
Expand Down Expand Up @@ -128,7 +128,7 @@ class ResponseServiceImpl internal constructor(private val clientOptions: Client
)
)
.build()
.prepare(clientOptions, params, deploymentModel = params.model().toString())
.prepare(clientOptions, params, deploymentModel = null)
val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
val response = clientOptions.httpClient.execute(request, requestOptions)
return response.parseable {
Expand Down
Loading