Skip to content

Commit 62a5c1d

Browse files
release: 0.44.2 (#402)
* fix(client): support responses API for Azure (#387) * response url support * add the missing azureServiceVersion param * add new Azure OpenAI service API version * update async client as well * Spotless: format * address feedbacks * release: 0.44.2 --------- Co-authored-by: Shawn Fang <[email protected]> Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent e28dcb8 commit 62a5c1d

File tree

9 files changed

+28
-22
lines changed

9 files changed

+28
-22
lines changed

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.44.1"
2+
".": "0.44.2"
33
}

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.44.2 (2025-04-04)
4+
5+
Full Changelog: [v0.44.1...v0.44.2](https://github.com/openai/openai-java/compare/v0.44.1...v0.44.2)
6+
7+
### Bug Fixes
8+
9+
* **client:** support responses API for Azure ([#387](https://github.com/openai/openai-java/issues/387)) ([f7f09aa](https://github.com/openai/openai-java/commit/f7f09aa1a3dd77f5565083ece85f8056b53e2e54))
10+
311
## 0.44.1 (2025-04-04)
412

513
Full Changelog: [v0.44.0...v0.44.1](https://github.com/openai/openai-java/compare/v0.44.0...v0.44.1)

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
1010
<!-- x-release-please-start-version -->
1111

12-
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/0.44.1)
13-
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/0.44.1/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/0.44.1)
12+
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/0.44.2)
13+
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/0.44.2/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/0.44.2)
1414

1515
<!-- x-release-please-end -->
1616

1717
The OpenAI Java SDK provides convenient access to the [OpenAI REST API](https://platform.openai.com/docs) from applications written in Java.
1818

1919
<!-- x-release-please-start-version -->
2020

21-
The REST API documentation can be found on [platform.openai.com](https://platform.openai.com/docs). Javadocs are also available on [javadoc.io](https://javadoc.io/doc/com.openai/openai-java/0.44.1).
21+
The REST API documentation can be found on [platform.openai.com](https://platform.openai.com/docs). Javadocs are also available on [javadoc.io](https://javadoc.io/doc/com.openai/openai-java/0.44.2).
2222

2323
<!-- x-release-please-end -->
2424

@@ -29,7 +29,7 @@ The REST API documentation can be found on [platform.openai.com](https://platfor
2929
### Gradle
3030

3131
```kotlin
32-
implementation("com.openai:openai-java:0.44.1")
32+
implementation("com.openai:openai-java:0.44.2")
3333
```
3434

3535
### Maven
@@ -38,7 +38,7 @@ implementation("com.openai:openai-java:0.44.1")
3838
<dependency>
3939
<groupId>com.openai</groupId>
4040
<artifactId>openai-java</artifactId>
41-
<version>0.44.1</version>
41+
<version>0.44.2</version>
4242
</dependency>
4343
```
4444

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88

99
allprojects {
1010
group = "com.openai"
11-
version = "0.44.1" // x-release-please-version
11+
version = "0.44.2" // x-release-please-version
1212
}
1313

1414
subprojects {

openai-java-core/src/main/kotlin/com/openai/azure/AzureOpenAIServiceVersion.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class AzureOpenAIServiceVersion private constructor(@get:JvmName("value") val va
1717
@JvmStatic
1818
fun latestPreviewVersion(): AzureOpenAIServiceVersion {
1919
// We can update the value every preview announcement.
20-
return V2025_01_01_PREVIEW
20+
return V2025_03_01_PREVIEW
2121
}
2222

2323
@JvmStatic
@@ -41,6 +41,8 @@ class AzureOpenAIServiceVersion private constructor(@get:JvmName("value") val va
4141
@JvmStatic val V2024_10_01_PREVIEW = fromString("2024-10-01-preview")
4242
@JvmStatic val V2024_12_01_PREVIEW = fromString("2024-12-01-preview")
4343
@JvmStatic val V2025_01_01_PREVIEW = fromString("2025-01-01-preview")
44+
@JvmStatic val V2025_02_01_PREVIEW = fromString("2025-02-01-preview")
45+
@JvmStatic val V2025_03_01_PREVIEW = fromString("2025-03-01-preview")
4446
}
4547

4648
override fun equals(other: Any?): Boolean =

openai-java-core/src/main/kotlin/com/openai/azure/HttpRequestBuilderExtensions.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ internal fun HttpRequest.Builder.addPathSegmentsForAzure(
1010
clientOptions: ClientOptions,
1111
deploymentModel: String?,
1212
): HttpRequest.Builder = apply {
13-
if (isAzureEndpoint(clientOptions.baseUrl) && deploymentModel != null) {
14-
addPathSegments("openai", "deployments", deploymentModel)
13+
if (isAzureEndpoint(clientOptions.baseUrl)) {
14+
addPathSegment("openai")
15+
deploymentModel?.let { addPathSegments("deployments", it) }
1516
}
1617
}
1718

openai-java-core/src/main/kotlin/com/openai/core/ClientOptions.kt

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ private constructor(
3535
@get:JvmName("timeout") val timeout: Timeout,
3636
@get:JvmName("maxRetries") val maxRetries: Int,
3737
@get:JvmName("credential") val credential: Credential,
38+
@get:JvmName("azureServiceVersion") val azureServiceVersion: AzureOpenAIServiceVersion?,
3839
private val organization: String?,
3940
private val project: String?,
4041
) {
@@ -102,6 +103,7 @@ private constructor(
102103
timeout = clientOptions.timeout
103104
maxRetries = clientOptions.maxRetries
104105
credential = clientOptions.credential
106+
azureServiceVersion = clientOptions.azureServiceVersion
105107
organization = clientOptions.organization
106108
project = clientOptions.project
107109
}
@@ -350,6 +352,7 @@ private constructor(
350352
timeout,
351353
maxRetries,
352354
credential,
355+
azureServiceVersion,
353356
organization,
354357
project,
355358
)

openai-java-core/src/main/kotlin/com/openai/services/async/ResponseServiceAsyncImpl.kt

+2-10
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,7 @@ class ResponseServiceAsyncImpl internal constructor(private val clientOptions: C
103103
.addPathSegments("responses")
104104
.body(json(clientOptions.jsonMapper, params._body()))
105105
.build()
106-
.prepareAsync(
107-
clientOptions,
108-
params,
109-
deploymentModel = params.model().toString(),
110-
)
106+
.prepareAsync(clientOptions, params, deploymentModel = null)
111107
val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
112108
return request
113109
.thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
@@ -148,11 +144,7 @@ class ResponseServiceAsyncImpl internal constructor(private val clientOptions: C
148144
)
149145
)
150146
.build()
151-
.prepareAsync(
152-
clientOptions,
153-
params,
154-
deploymentModel = params.model().toString(),
155-
)
147+
.prepareAsync(clientOptions, params, deploymentModel = null)
156148
val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
157149
return request
158150
.thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }

openai-java-core/src/main/kotlin/com/openai/services/blocking/ResponseServiceImpl.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class ResponseServiceImpl internal constructor(private val clientOptions: Client
9090
.addPathSegments("responses")
9191
.body(json(clientOptions.jsonMapper, params._body()))
9292
.build()
93-
.prepare(clientOptions, params, deploymentModel = params.model().toString())
93+
.prepare(clientOptions, params, deploymentModel = null)
9494
val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
9595
val response = clientOptions.httpClient.execute(request, requestOptions)
9696
return response.parseable {
@@ -128,7 +128,7 @@ class ResponseServiceImpl internal constructor(private val clientOptions: Client
128128
)
129129
)
130130
.build()
131-
.prepare(clientOptions, params, deploymentModel = params.model().toString())
131+
.prepare(clientOptions, params, deploymentModel = null)
132132
val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
133133
val response = clientOptions.httpClient.execute(request, requestOptions)
134134
return response.parseable {

0 commit comments

Comments
 (0)