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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.5.0"
".": "3.5.1"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 118
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-7807ec6037efcee1af7decbfd3974a42b761fb6c6a71b4050fe43484d7fcbac4.yml
openapi_spec_hash: da6851e3891ad2659a50ed6a736fd32a
config_hash: 74d955cdc2377213f5268ea309090f6c
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-16cb18bed32bae8c5840fb39a1bf664026cc40463ad0c487dcb0df1bd3d72db0.yml
openapi_spec_hash: 4cb51b22f98dee1a90bc7add82d1d132
config_hash: 930dac3aa861344867e4ac84f037b5df
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 3.5.1 (2025-09-10)

Full Changelog: [v3.5.0...v3.5.1](https://github.com/openai/openai-java/compare/v3.5.0...v3.5.1)

### Chores

* **api:** fix realtime GA types ([10cd1c4](https://github.com/openai/openai-java/commit/10cd1c49b63b63aa7d3a357ab5b0e982628cd933))

## 3.5.0 (2025-09-08)

Full Changelog: [v3.4.1...v3.5.0](https://github.com/openai/openai-java/compare/v3.4.1...v3.5.0)
Expand Down
14 changes: 7 additions & 7 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/3.5.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/3.5.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/3.5.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/3.5.1)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/3.5.1/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/3.5.1)

<!-- 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/3.5.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/3.5.1).

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

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

```kotlin
implementation("com.openai:openai-java:3.5.0")
implementation("com.openai:openai-java:3.5.1")
```

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

Expand Down Expand Up @@ -1342,7 +1342,7 @@ If you're using Spring Boot, then you can use the SDK's [Spring Boot starter](ht
#### Gradle

```kotlin
implementation("com.openai:openai-java-spring-boot-starter:3.5.0")
implementation("com.openai:openai-java-spring-boot-starter:3.5.1")
```

#### Maven
Expand All @@ -1351,7 +1351,7 @@ implementation("com.openai:openai-java-spring-boot-starter:3.5.0")
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java-spring-boot-starter</artifactId>
<version>3.5.0</version>
<version>3.5.1</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 = "3.5.0" // x-release-please-version
version = "3.5.1" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private constructor(

/**
* Optional idle timeout after which turn detection will auto-timeout when no additional audio
* is received.
* is received and emits a `timeout_triggered` event.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
Expand Down Expand Up @@ -298,7 +298,7 @@ private constructor(

/**
* Optional idle timeout after which turn detection will auto-timeout when no additional
* audio is received.
* audio is received and emits a `timeout_triggered` event.
*/
fun idleTimeoutMs(idleTimeoutMs: Long?) = idleTimeoutMs(JsonField.ofNullable(idleTimeoutMs))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ private constructor(
private val responseCancel: ResponseCancelEvent? = null,
private val responseCreate: ResponseCreateEvent? = null,
private val sessionUpdate: SessionUpdateEvent? = null,
private val transcriptionSessionUpdate: TranscriptionSessionUpdate? = null,
private val _json: JsonValue? = null,
) {

Expand Down Expand Up @@ -175,10 +174,6 @@ private constructor(
*/
fun sessionUpdate(): Optional<SessionUpdateEvent> = Optional.ofNullable(sessionUpdate)

/** Send this event to update a transcription session. */
fun transcriptionSessionUpdate(): Optional<TranscriptionSessionUpdate> =
Optional.ofNullable(transcriptionSessionUpdate)

fun isConversationItemCreate(): Boolean = conversationItemCreate != null

fun isConversationItemDelete(): Boolean = conversationItemDelete != null
Expand All @@ -201,8 +196,6 @@ private constructor(

fun isSessionUpdate(): Boolean = sessionUpdate != null

fun isTranscriptionSessionUpdate(): Boolean = transcriptionSessionUpdate != null

/**
* Add a new Item to the Conversation's context, including messages, function calls, and
* function call responses. This event can be used both to populate a "history" of the
Expand Down Expand Up @@ -340,10 +333,6 @@ private constructor(
*/
fun asSessionUpdate(): SessionUpdateEvent = sessionUpdate.getOrThrow("sessionUpdate")

/** Send this event to update a transcription session. */
fun asTranscriptionSessionUpdate(): TranscriptionSessionUpdate =
transcriptionSessionUpdate.getOrThrow("transcriptionSessionUpdate")

fun _json(): Optional<JsonValue> = Optional.ofNullable(_json)

fun <T> accept(visitor: Visitor<T>): T =
Expand All @@ -367,8 +356,6 @@ private constructor(
responseCancel != null -> visitor.visitResponseCancel(responseCancel)
responseCreate != null -> visitor.visitResponseCreate(responseCreate)
sessionUpdate != null -> visitor.visitSessionUpdate(sessionUpdate)
transcriptionSessionUpdate != null ->
visitor.visitTranscriptionSessionUpdate(transcriptionSessionUpdate)
else -> visitor.unknown(_json)
}

Expand Down Expand Up @@ -440,12 +427,6 @@ private constructor(
override fun visitSessionUpdate(sessionUpdate: SessionUpdateEvent) {
sessionUpdate.validate()
}

override fun visitTranscriptionSessionUpdate(
transcriptionSessionUpdate: TranscriptionSessionUpdate
) {
transcriptionSessionUpdate.validate()
}
}
)
validated = true
Expand Down Expand Up @@ -509,10 +490,6 @@ private constructor(
override fun visitSessionUpdate(sessionUpdate: SessionUpdateEvent) =
sessionUpdate.validity()

override fun visitTranscriptionSessionUpdate(
transcriptionSessionUpdate: TranscriptionSessionUpdate
) = transcriptionSessionUpdate.validity()

override fun unknown(json: JsonValue?) = 0
}
)
Expand All @@ -533,8 +510,7 @@ private constructor(
inputAudioBufferCommit == other.inputAudioBufferCommit &&
responseCancel == other.responseCancel &&
responseCreate == other.responseCreate &&
sessionUpdate == other.sessionUpdate &&
transcriptionSessionUpdate == other.transcriptionSessionUpdate
sessionUpdate == other.sessionUpdate
}

override fun hashCode(): Int =
Expand All @@ -550,7 +526,6 @@ private constructor(
responseCancel,
responseCreate,
sessionUpdate,
transcriptionSessionUpdate,
)

override fun toString(): String =
Expand All @@ -574,8 +549,6 @@ private constructor(
responseCancel != null -> "RealtimeClientEvent{responseCancel=$responseCancel}"
responseCreate != null -> "RealtimeClientEvent{responseCreate=$responseCreate}"
sessionUpdate != null -> "RealtimeClientEvent{sessionUpdate=$sessionUpdate}"
transcriptionSessionUpdate != null ->
"RealtimeClientEvent{transcriptionSessionUpdate=$transcriptionSessionUpdate}"
_json != null -> "RealtimeClientEvent{_unknown=$_json}"
else -> throw IllegalStateException("Invalid RealtimeClientEvent")
}
Expand Down Expand Up @@ -736,11 +709,6 @@ private constructor(
@JvmStatic
fun ofSessionUpdate(sessionUpdate: SessionUpdateEvent) =
RealtimeClientEvent(sessionUpdate = sessionUpdate)

/** Send this event to update a transcription session. */
@JvmStatic
fun ofTranscriptionSessionUpdate(transcriptionSessionUpdate: TranscriptionSessionUpdate) =
RealtimeClientEvent(transcriptionSessionUpdate = transcriptionSessionUpdate)
}

/**
Expand Down Expand Up @@ -886,11 +854,6 @@ private constructor(
*/
fun visitSessionUpdate(sessionUpdate: SessionUpdateEvent): T

/** Send this event to update a transcription session. */
fun visitTranscriptionSessionUpdate(
transcriptionSessionUpdate: TranscriptionSessionUpdate
): T

/**
* Maps an unknown variant of [RealtimeClientEvent] to a value of type [T].
*
Expand Down Expand Up @@ -969,11 +932,6 @@ private constructor(
RealtimeClientEvent(sessionUpdate = it, _json = json)
} ?: RealtimeClientEvent(_json = json)
}
"transcription_session.update" -> {
return tryDeserialize(node, jacksonTypeRef<TranscriptionSessionUpdate>())?.let {
RealtimeClientEvent(transcriptionSessionUpdate = it, _json = json)
} ?: RealtimeClientEvent(_json = json)
}
}

return RealtimeClientEvent(_json = json)
Expand Down Expand Up @@ -1007,8 +965,6 @@ private constructor(
value.responseCancel != null -> generator.writeObject(value.responseCancel)
value.responseCreate != null -> generator.writeObject(value.responseCreate)
value.sessionUpdate != null -> generator.writeObject(value.sessionUpdate)
value.transcriptionSessionUpdate != null ->
generator.writeObject(value.transcriptionSessionUpdate)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid RealtimeClientEvent")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull

class Models
class RealtimeFunctionTool
private constructor(
private val description: JsonField<String>,
private val name: JsonField<String>,
Expand Down Expand Up @@ -99,11 +99,11 @@ private constructor(

companion object {

/** Returns a mutable builder for constructing an instance of [Models]. */
/** Returns a mutable builder for constructing an instance of [RealtimeFunctionTool]. */
@JvmStatic fun builder() = Builder()
}

/** A builder for [Models]. */
/** A builder for [RealtimeFunctionTool]. */
class Builder internal constructor() {

private var description: JsonField<String> = JsonMissing.of()
Expand All @@ -113,12 +113,12 @@ private constructor(
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(models: Models) = apply {
description = models.description
name = models.name
parameters = models.parameters
type = models.type
additionalProperties = models.additionalProperties.toMutableMap()
internal fun from(realtimeFunctionTool: RealtimeFunctionTool) = apply {
description = realtimeFunctionTool.description
name = realtimeFunctionTool.name
parameters = realtimeFunctionTool.parameters
type = realtimeFunctionTool.type
additionalProperties = realtimeFunctionTool.additionalProperties.toMutableMap()
}

/**
Expand Down Expand Up @@ -181,17 +181,23 @@ private constructor(
}

/**
* Returns an immutable instance of [Models].
* Returns an immutable instance of [RealtimeFunctionTool].
*
* Further updates to this [Builder] will not mutate the returned instance.
*/
fun build(): Models =
Models(description, name, parameters, type, additionalProperties.toMutableMap())
fun build(): RealtimeFunctionTool =
RealtimeFunctionTool(
description,
name,
parameters,
type,
additionalProperties.toMutableMap(),
)
}

private var validated: Boolean = false

fun validate(): Models = apply {
fun validate(): RealtimeFunctionTool = apply {
if (validated) {
return@apply
}
Expand Down Expand Up @@ -346,7 +352,7 @@ private constructor(
return true
}

return other is Models &&
return other is RealtimeFunctionTool &&
description == other.description &&
name == other.name &&
parameters == other.parameters &&
Expand All @@ -361,5 +367,5 @@ private constructor(
override fun hashCode(): Int = hashCode

override fun toString() =
"Models{description=$description, name=$name, parameters=$parameters, type=$type, additionalProperties=$additionalProperties}"
"RealtimeFunctionTool{description=$description, name=$name, parameters=$parameters, type=$type, additionalProperties=$additionalProperties}"
}
Loading
Loading