Skip to content

Commit 75f65c4

Browse files
Merge pull request #481 from openai/release-please--branches--main--changes--next
release: 2.1.0
2 parents 6d93489 + c53206e commit 75f65c4

File tree

209 files changed

+40303
-2484
lines changed

Some content is hidden

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

209 files changed

+40303
-2484
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.0.0"
2+
".": "2.1.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 99
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-d51538ac955164de98b0c94a0a4718d96623fe39bf31a1d168be06c93c94e645.yml
3-
openapi_spec_hash: 33e00a48df8f94c94f46290c489f132b
4-
config_hash: c42d37618b8628ce7e1c76437db5dd8f
1+
configured_endpoints: 109
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fc64d7c2c8f51f750813375356c3f3fdfc7fc1b1b34f19c20a5410279d445d37.yml
3+
openapi_spec_hash: 618285fc70199ee32b9ebe4bf72f7e4c
4+
config_hash: c497f6b750cc89c0bf2eefc0bc839c70

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 2.1.0 (2025-05-22)
4+
5+
Full Changelog: [v2.0.0...v2.1.0](https://github.com/openai/openai-java/compare/v2.0.0...v2.1.0)
6+
7+
### Features
8+
9+
* **api:** new streaming helpers for background responses ([a82279d](https://github.com/openai/openai-java/commit/a82279dfafef8a6a6276de104a5b58cffac63559))
10+
11+
12+
### Bug Fixes
13+
14+
* **internal:** fix issues with new items in structured responses ([931f7b8](https://github.com/openai/openai-java/commit/931f7b8ce3a83dfbbbd46d34bf99a66fa7e888e3))
15+
* **tests:** fix file test ([a82adfd](https://github.com/openai/openai-java/commit/a82adfd42bbb06da2c3c18f12cafd6b8ee38cc85))
16+
317
## 2.0.0 (2025-05-21)
418

519
Full Changelog: [v1.6.1...v2.0.0](https://github.com/openai/openai-java/compare/v1.6.1...v2.0.0)

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
<!-- x-release-please-start-version -->
44

5-
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/2.0.0)
6-
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/2.0.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/2.0.0)
5+
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/2.1.0)
6+
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/2.1.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/2.1.0)
77

88
<!-- x-release-please-end -->
99

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

1212
<!-- x-release-please-start-version -->
1313

14-
The REST API documentation can be found on [platform.openai.com](https://platform.openai.com/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openai/openai-java/2.0.0).
14+
The REST API documentation can be found on [platform.openai.com](https://platform.openai.com/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openai/openai-java/2.1.0).
1515

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

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

2424
```kotlin
25-
implementation("com.openai:openai-java:2.0.0")
25+
implementation("com.openai:openai-java:2.1.0")
2626
```
2727

2828
### Maven
@@ -31,7 +31,7 @@ implementation("com.openai:openai-java:2.0.0")
3131
<dependency>
3232
<groupId>com.openai</groupId>
3333
<artifactId>openai-java</artifactId>
34-
<version>2.0.0</version>
34+
<version>2.1.0</version>
3535
</dependency>
3636
```
3737

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88

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

1414
subprojects {

openai-java-core/src/main/kotlin/com/openai/client/OpenAIClient.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.openai.services.blocking.BatchService
77
import com.openai.services.blocking.BetaService
88
import com.openai.services.blocking.ChatService
99
import com.openai.services.blocking.CompletionService
10+
import com.openai.services.blocking.ContainerService
1011
import com.openai.services.blocking.EmbeddingService
1112
import com.openai.services.blocking.EvalService
1213
import com.openai.services.blocking.FileService
@@ -80,6 +81,8 @@ interface OpenAIClient {
8081

8182
fun evals(): EvalService
8283

84+
fun containers(): ContainerService
85+
8386
/**
8487
* Closes this client, relinquishing any underlying resources.
8588
*
@@ -127,5 +130,7 @@ interface OpenAIClient {
127130
fun responses(): ResponseService.WithRawResponse
128131

129132
fun evals(): EvalService.WithRawResponse
133+
134+
fun containers(): ContainerService.WithRawResponse
130135
}
131136
}

openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientAsync.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.openai.services.async.BatchServiceAsync
77
import com.openai.services.async.BetaServiceAsync
88
import com.openai.services.async.ChatServiceAsync
99
import com.openai.services.async.CompletionServiceAsync
10+
import com.openai.services.async.ContainerServiceAsync
1011
import com.openai.services.async.EmbeddingServiceAsync
1112
import com.openai.services.async.EvalServiceAsync
1213
import com.openai.services.async.FileServiceAsync
@@ -80,6 +81,8 @@ interface OpenAIClientAsync {
8081

8182
fun evals(): EvalServiceAsync
8283

84+
fun containers(): ContainerServiceAsync
85+
8386
/**
8487
* Closes this client, relinquishing any underlying resources.
8588
*
@@ -127,5 +130,7 @@ interface OpenAIClientAsync {
127130
fun responses(): ResponseServiceAsync.WithRawResponse
128131

129132
fun evals(): EvalServiceAsync.WithRawResponse
133+
134+
fun containers(): ContainerServiceAsync.WithRawResponse
130135
}
131136
}

openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientAsyncImpl.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import com.openai.services.async.ChatServiceAsync
1414
import com.openai.services.async.ChatServiceAsyncImpl
1515
import com.openai.services.async.CompletionServiceAsync
1616
import com.openai.services.async.CompletionServiceAsyncImpl
17+
import com.openai.services.async.ContainerServiceAsync
18+
import com.openai.services.async.ContainerServiceAsyncImpl
1719
import com.openai.services.async.EmbeddingServiceAsync
1820
import com.openai.services.async.EmbeddingServiceAsyncImpl
1921
import com.openai.services.async.EvalServiceAsync
@@ -110,6 +112,10 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
110112

111113
private val evals: EvalServiceAsync by lazy { EvalServiceAsyncImpl(clientOptionsWithUserAgent) }
112114

115+
private val containers: ContainerServiceAsync by lazy {
116+
ContainerServiceAsyncImpl(clientOptionsWithUserAgent)
117+
}
118+
113119
override fun sync(): OpenAIClient = sync
114120

115121
override fun withRawResponse(): OpenAIClientAsync.WithRawResponse = withRawResponse
@@ -146,6 +152,8 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
146152

147153
override fun evals(): EvalServiceAsync = evals
148154

155+
override fun containers(): ContainerServiceAsync = containers
156+
149157
override fun close() = clientOptions.httpClient.close()
150158

151159
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -215,6 +223,10 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
215223
EvalServiceAsyncImpl.WithRawResponseImpl(clientOptions)
216224
}
217225

226+
private val containers: ContainerServiceAsync.WithRawResponse by lazy {
227+
ContainerServiceAsyncImpl.WithRawResponseImpl(clientOptions)
228+
}
229+
218230
override fun completions(): CompletionServiceAsync.WithRawResponse = completions
219231

220232
override fun chat(): ChatServiceAsync.WithRawResponse = chat
@@ -246,5 +258,7 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
246258
override fun responses(): ResponseServiceAsync.WithRawResponse = responses
247259

248260
override fun evals(): EvalServiceAsync.WithRawResponse = evals
261+
262+
override fun containers(): ContainerServiceAsync.WithRawResponse = containers
249263
}
250264
}

openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientImpl.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import com.openai.services.blocking.ChatService
1414
import com.openai.services.blocking.ChatServiceImpl
1515
import com.openai.services.blocking.CompletionService
1616
import com.openai.services.blocking.CompletionServiceImpl
17+
import com.openai.services.blocking.ContainerService
18+
import com.openai.services.blocking.ContainerServiceImpl
1719
import com.openai.services.blocking.EmbeddingService
1820
import com.openai.services.blocking.EmbeddingServiceImpl
1921
import com.openai.services.blocking.EvalService
@@ -98,6 +100,10 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
98100

99101
private val evals: EvalService by lazy { EvalServiceImpl(clientOptionsWithUserAgent) }
100102

103+
private val containers: ContainerService by lazy {
104+
ContainerServiceImpl(clientOptionsWithUserAgent)
105+
}
106+
101107
override fun async(): OpenAIClientAsync = async
102108

103109
override fun withRawResponse(): OpenAIClient.WithRawResponse = withRawResponse
@@ -134,6 +140,8 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
134140

135141
override fun evals(): EvalService = evals
136142

143+
override fun containers(): ContainerService = containers
144+
137145
override fun close() = clientOptions.httpClient.close()
138146

139147
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -203,6 +211,10 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
203211
EvalServiceImpl.WithRawResponseImpl(clientOptions)
204212
}
205213

214+
private val containers: ContainerService.WithRawResponse by lazy {
215+
ContainerServiceImpl.WithRawResponseImpl(clientOptions)
216+
}
217+
206218
override fun completions(): CompletionService.WithRawResponse = completions
207219

208220
override fun chat(): ChatService.WithRawResponse = chat
@@ -234,5 +246,7 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
234246
override fun responses(): ResponseService.WithRawResponse = responses
235247

236248
override fun evals(): EvalService.WithRawResponse = evals
249+
250+
override fun containers(): ContainerService.WithRawResponse = containers
237251
}
238252
}

openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCreateParams.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ private constructor(
399399
fun topP(): Optional<Double> = body.topP()
400400

401401
/**
402-
* A unique identifier representing your end-user, which can help OpenAI to monitor and detect
403-
* abuse.
402+
* A stable identifier for your end-users. Used to boost cache hit rates by better bucketing
403+
* similar requests and to help OpenAI detect and prevent abuse.
404404
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
405405
*
406406
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
@@ -1590,8 +1590,8 @@ private constructor(
15901590
fun topP(topP: JsonField<Double>) = apply { body.topP(topP) }
15911591

15921592
/**
1593-
* A unique identifier representing your end-user, which can help OpenAI to monitor and
1594-
* detect abuse.
1593+
* A stable identifier for your end-users. Used to boost cache hit rates by better bucketing
1594+
* similar requests and to help OpenAI detect and prevent abuse.
15951595
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
15961596
*/
15971597
fun user(user: String) = apply { body.user(user) }
@@ -2260,8 +2260,8 @@ private constructor(
22602260
fun topP(): Optional<Double> = topP.getOptional("top_p")
22612261

22622262
/**
2263-
* A unique identifier representing your end-user, which can help OpenAI to monitor and
2264-
* detect abuse.
2263+
* A stable identifier for your end-users. Used to boost cache hit rates by better bucketing
2264+
* similar requests and to help OpenAI detect and prevent abuse.
22652265
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
22662266
*
22672267
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
@@ -3587,8 +3587,8 @@ private constructor(
35873587
fun topP(topP: JsonField<Double>) = apply { this.topP = topP }
35883588

35893589
/**
3590-
* A unique identifier representing your end-user, which can help OpenAI to monitor and
3591-
* detect abuse.
3590+
* A stable identifier for your end-users. Used to boost cache hit rates by better
3591+
* bucketing similar requests and to help OpenAI detect and prevent abuse.
35923592
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
35933593
*/
35943594
fun user(user: String) = user(JsonField.of(user))

0 commit comments

Comments
 (0)