Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.0.0"
".": "2.1.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 99
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-d51538ac955164de98b0c94a0a4718d96623fe39bf31a1d168be06c93c94e645.yml
openapi_spec_hash: 33e00a48df8f94c94f46290c489f132b
config_hash: c42d37618b8628ce7e1c76437db5dd8f
configured_endpoints: 109
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fc64d7c2c8f51f750813375356c3f3fdfc7fc1b1b34f19c20a5410279d445d37.yml
openapi_spec_hash: 618285fc70199ee32b9ebe4bf72f7e4c
config_hash: c497f6b750cc89c0bf2eefc0bc839c70
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 2.1.0 (2025-05-22)

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

### Features

* **api:** new streaming helpers for background responses ([a82279d](https://github.com/openai/openai-java/commit/a82279dfafef8a6a6276de104a5b58cffac63559))


### Bug Fixes

* **internal:** fix issues with new items in structured responses ([931f7b8](https://github.com/openai/openai-java/commit/931f7b8ce3a83dfbbbd46d34bf99a66fa7e888e3))
* **tests:** fix file test ([a82adfd](https://github.com/openai/openai-java/commit/a82adfd42bbb06da2c3c18f12cafd6b8ee38cc85))

## 2.0.0 (2025-05-21)

Full Changelog: [v1.6.1...v2.0.0](https://github.com/openai/openai-java/compare/v1.6.1...v2.0.0)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

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

[![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)
[![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)
[![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)
[![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)

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

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

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

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).
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).

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

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

```kotlin
implementation("com.openai:openai-java:2.0.0")
implementation("com.openai:openai-java:2.1.0")
```

### Maven
Expand All @@ -31,7 +31,7 @@ implementation("com.openai:openai-java:2.0.0")
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.openai"
version = "2.0.0" // x-release-please-version
version = "2.1.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.openai.services.blocking.BatchService
import com.openai.services.blocking.BetaService
import com.openai.services.blocking.ChatService
import com.openai.services.blocking.CompletionService
import com.openai.services.blocking.ContainerService
import com.openai.services.blocking.EmbeddingService
import com.openai.services.blocking.EvalService
import com.openai.services.blocking.FileService
Expand Down Expand Up @@ -80,6 +81,8 @@ interface OpenAIClient {

fun evals(): EvalService

fun containers(): ContainerService

/**
* Closes this client, relinquishing any underlying resources.
*
Expand Down Expand Up @@ -127,5 +130,7 @@ interface OpenAIClient {
fun responses(): ResponseService.WithRawResponse

fun evals(): EvalService.WithRawResponse

fun containers(): ContainerService.WithRawResponse
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.openai.services.async.BatchServiceAsync
import com.openai.services.async.BetaServiceAsync
import com.openai.services.async.ChatServiceAsync
import com.openai.services.async.CompletionServiceAsync
import com.openai.services.async.ContainerServiceAsync
import com.openai.services.async.EmbeddingServiceAsync
import com.openai.services.async.EvalServiceAsync
import com.openai.services.async.FileServiceAsync
Expand Down Expand Up @@ -80,6 +81,8 @@ interface OpenAIClientAsync {

fun evals(): EvalServiceAsync

fun containers(): ContainerServiceAsync

/**
* Closes this client, relinquishing any underlying resources.
*
Expand Down Expand Up @@ -127,5 +130,7 @@ interface OpenAIClientAsync {
fun responses(): ResponseServiceAsync.WithRawResponse

fun evals(): EvalServiceAsync.WithRawResponse

fun containers(): ContainerServiceAsync.WithRawResponse
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import com.openai.services.async.ChatServiceAsync
import com.openai.services.async.ChatServiceAsyncImpl
import com.openai.services.async.CompletionServiceAsync
import com.openai.services.async.CompletionServiceAsyncImpl
import com.openai.services.async.ContainerServiceAsync
import com.openai.services.async.ContainerServiceAsyncImpl
import com.openai.services.async.EmbeddingServiceAsync
import com.openai.services.async.EmbeddingServiceAsyncImpl
import com.openai.services.async.EvalServiceAsync
Expand Down Expand Up @@ -110,6 +112,10 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl

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

private val containers: ContainerServiceAsync by lazy {
ContainerServiceAsyncImpl(clientOptionsWithUserAgent)
}

override fun sync(): OpenAIClient = sync

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

override fun evals(): EvalServiceAsync = evals

override fun containers(): ContainerServiceAsync = containers

override fun close() = clientOptions.httpClient.close()

class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
Expand Down Expand Up @@ -215,6 +223,10 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
EvalServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}

private val containers: ContainerServiceAsync.WithRawResponse by lazy {
ContainerServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}

override fun completions(): CompletionServiceAsync.WithRawResponse = completions

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

override fun evals(): EvalServiceAsync.WithRawResponse = evals

override fun containers(): ContainerServiceAsync.WithRawResponse = containers
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import com.openai.services.blocking.ChatService
import com.openai.services.blocking.ChatServiceImpl
import com.openai.services.blocking.CompletionService
import com.openai.services.blocking.CompletionServiceImpl
import com.openai.services.blocking.ContainerService
import com.openai.services.blocking.ContainerServiceImpl
import com.openai.services.blocking.EmbeddingService
import com.openai.services.blocking.EmbeddingServiceImpl
import com.openai.services.blocking.EvalService
Expand Down Expand Up @@ -98,6 +100,10 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient

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

private val containers: ContainerService by lazy {
ContainerServiceImpl(clientOptionsWithUserAgent)
}

override fun async(): OpenAIClientAsync = async

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

override fun evals(): EvalService = evals

override fun containers(): ContainerService = containers

override fun close() = clientOptions.httpClient.close()

class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
Expand Down Expand Up @@ -203,6 +211,10 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
EvalServiceImpl.WithRawResponseImpl(clientOptions)
}

private val containers: ContainerService.WithRawResponse by lazy {
ContainerServiceImpl.WithRawResponseImpl(clientOptions)
}

override fun completions(): CompletionService.WithRawResponse = completions

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

override fun evals(): EvalService.WithRawResponse = evals

override fun containers(): ContainerService.WithRawResponse = containers
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ private constructor(
fun topP(): Optional<Double> = body.topP()

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

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

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

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