Skip to content

release: 0.45.0 #417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 9, 2025
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.44.5"
".": "0.45.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: 80
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-4bce8217a697c729ac98046d4caf2c9e826b54c427fb0ab4f98e549a2e0ce31c.yml
openapi_spec_hash: 7996d2c34cc44fe2ce9ffe93c0ab774e
config_hash: bcd2cacdcb9fae9938f273cd167f613c
configured_endpoints: 95
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-44b20fa9d24544217fe6bb48852037537030a1ad29b202936425110744fe66fb.yml
openapi_spec_hash: ea86343b5e9858a74e85da8ab2c532f6
config_hash: 69e3afd56ccb0f0f822a7a9dc130fc99
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 0.45.0 (2025-04-09)

Full Changelog: [v0.44.5...v0.45.0](https://github.com/openai/openai-java/compare/v0.44.5...v0.45.0)

### Features

* **api:** Add evalapi to sdk ([b567998](https://github.com/openai/openai-java/commit/b56799843d71a81b8d99fae6fb04c0dff731afce))


### Bug Fixes

* **client:** trim '/' and empty character in base URL ([#424](https://github.com/openai/openai-java/issues/424)) ([37370df](https://github.com/openai/openai-java/commit/37370df673921c01a511dab2f87e0fe62107a151))


### Chores

* add missing `deploymentModel` ([acb132e](https://github.com/openai/openai-java/commit/acb132e45467fd74f5860c54d93a66ad8e1216a3))
* **tests:** improve enum examples ([#416](https://github.com/openai/openai-java/issues/416)) ([a698758](https://github.com/openai/openai-java/commit/a69875817d67a60a612df14bf3ea06352e2fa265))

## 0.44.5 (2025-04-08)

Full Changelog: [v0.44.4...v0.44.5](https://github.com/openai/openai-java/compare/v0.44.4...v0.44.5)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,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/0.44.5)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/0.44.5/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/0.44.5)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/0.45.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/0.45.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/0.45.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 also available on [javadoc.io](https://javadoc.io/doc/com.openai/openai-java/0.44.5).
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.45.0).

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

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

```kotlin
implementation("com.openai:openai-java:0.44.5")
implementation("com.openai:openai-java:0.45.0")
```

### Maven
Expand All @@ -38,7 +38,7 @@ implementation("com.openai:openai-java:0.44.5")
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java</artifactId>
<version>0.44.5</version>
<version>0.45.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 = "0.44.5" // x-release-please-version
version = "0.45.0" // x-release-please-version
}

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

fun responses(): ResponseService

fun evals(): EvalService

/**
* Closes this client, relinquishing any underlying resources.
*
Expand Down Expand Up @@ -117,5 +120,7 @@ interface OpenAIClient {
fun uploads(): UploadService.WithRawResponse

fun responses(): ResponseService.WithRawResponse

fun evals(): EvalService.WithRawResponse
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.openai.services.async.BetaServiceAsync
import com.openai.services.async.ChatServiceAsync
import com.openai.services.async.CompletionServiceAsync
import com.openai.services.async.EmbeddingServiceAsync
import com.openai.services.async.EvalServiceAsync
import com.openai.services.async.FileServiceAsync
import com.openai.services.async.FineTuningServiceAsync
import com.openai.services.async.ImageServiceAsync
Expand Down Expand Up @@ -74,6 +75,8 @@ interface OpenAIClientAsync {

fun responses(): ResponseServiceAsync

fun evals(): EvalServiceAsync

/**
* Closes this client, relinquishing any underlying resources.
*
Expand Down Expand Up @@ -117,5 +120,7 @@ interface OpenAIClientAsync {
fun uploads(): UploadServiceAsync.WithRawResponse

fun responses(): ResponseServiceAsync.WithRawResponse

fun evals(): EvalServiceAsync.WithRawResponse
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import com.openai.services.async.CompletionServiceAsync
import com.openai.services.async.CompletionServiceAsyncImpl
import com.openai.services.async.EmbeddingServiceAsync
import com.openai.services.async.EmbeddingServiceAsyncImpl
import com.openai.services.async.EvalServiceAsync
import com.openai.services.async.EvalServiceAsyncImpl
import com.openai.services.async.FileServiceAsync
import com.openai.services.async.FileServiceAsyncImpl
import com.openai.services.async.FineTuningServiceAsync
Expand Down Expand Up @@ -100,6 +102,8 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
ResponseServiceAsyncImpl(clientOptionsWithUserAgent)
}

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

override fun sync(): OpenAIClient = sync

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

override fun responses(): ResponseServiceAsync = responses

override fun evals(): EvalServiceAsync = evals

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

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

private val evals: EvalServiceAsync.WithRawResponse by lazy {
EvalServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}

override fun completions(): CompletionServiceAsync.WithRawResponse = completions

override fun chat(): ChatServiceAsync.WithRawResponse = chat
Expand Down Expand Up @@ -220,5 +230,7 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
override fun uploads(): UploadServiceAsync.WithRawResponse = uploads

override fun responses(): ResponseServiceAsync.WithRawResponse = responses

override fun evals(): EvalServiceAsync.WithRawResponse = evals
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import com.openai.services.blocking.CompletionService
import com.openai.services.blocking.CompletionServiceImpl
import com.openai.services.blocking.EmbeddingService
import com.openai.services.blocking.EmbeddingServiceImpl
import com.openai.services.blocking.EvalService
import com.openai.services.blocking.EvalServiceImpl
import com.openai.services.blocking.FileService
import com.openai.services.blocking.FileServiceImpl
import com.openai.services.blocking.FineTuningService
Expand Down Expand Up @@ -90,6 +92,8 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
ResponseServiceImpl(clientOptionsWithUserAgent)
}

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

override fun async(): OpenAIClientAsync = async

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

override fun responses(): ResponseService = responses

override fun evals(): EvalService = evals

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

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

private val evals: EvalService.WithRawResponse by lazy {
EvalServiceImpl.WithRawResponseImpl(clientOptions)
}

override fun completions(): CompletionService.WithRawResponse = completions

override fun chat(): ChatService.WithRawResponse = chat
Expand Down Expand Up @@ -210,5 +220,7 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
override fun uploads(): UploadService.WithRawResponse = uploads

override fun responses(): ResponseService.WithRawResponse = responses

override fun evals(): EvalService.WithRawResponse = evals
}
}
4 changes: 3 additions & 1 deletion openai-java-core/src/main/kotlin/com/openai/core/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ internal fun Any?.contentToString(): String {
internal fun isAzureEndpoint(baseUrl: String): Boolean {
// Azure Endpoint should be in the format of `https://<region>.openai.azure.com`.
// Or `https://<region>.azure-api.net` for Azure OpenAI Management URL.
return baseUrl.endsWith(".openai.azure.com", true) || baseUrl.endsWith(".azure-api.net", true)
val trimmedBaseUrl = baseUrl.trim().trimEnd('/')
return trimmedBaseUrl.endsWith(".openai.azure.com", true) ||
trimmedBaseUrl.endsWith(".azure-api.net", true)
}

internal interface Enum
Loading