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.6.0"
".": "3.6.1"
}
4 changes: 2 additions & 2 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-ea23db36b0899cc715f56d0098956069b2d92880f448adff3a4ac1bb53cb2cec.yml
openapi_spec_hash: 36f76ea31297c9593bcfae453f6255cc
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-937fcfac8cbab692796cd9822b37e48a311e2220a8b103106ded0ee92a0b9484.yml
openapi_spec_hash: 74a0c58b5b8c4e06792d79b685e02a01
config_hash: 666d6bb4b564f0d9d431124b5d1a0665
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 3.6.1 (2025-09-22)

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

### Bug Fixes

* **api:** fix mcp tool name ([d2e947d](https://github.com/openai/openai-java/commit/d2e947dc5a8585f0200c6ff96d093fa0997a39e7))


### Chores

* **api:** openapi updates for conversations ([0dbcc0a](https://github.com/openai/openai-java/commit/0dbcc0a4c7cdd514a3405213fc173708ca1b5013))
* improve example values ([109a350](https://github.com/openai/openai-java/commit/109a350313bb39d7d62d56020fdc458d798924ee))
* improve formatter performance ([3fce946](https://github.com/openai/openai-java/commit/3fce946567568c0dc92b247c984c4dfcb34f603d))

## 3.6.0 (2025-09-19)

Full Changelog: [v3.5.3...v3.6.0](https://github.com/openai/openai-java/compare/v3.5.3...v3.6.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.6.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/3.6.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/3.6.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/3.6.1)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/3.6.1/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/3.6.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.6.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.6.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.6.0")
implementation("com.openai:openai-java:3.6.1")
```

### Maven
Expand All @@ -33,7 +33,7 @@ implementation("com.openai:openai-java:3.6.0")
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java</artifactId>
<version>3.6.0</version>
<version>3.6.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.6.0")
implementation("com.openai:openai-java-spring-boot-starter:3.6.1")
```

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

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

override fun _queryParams(): QueryParams = additionalQueryParams

/** Create a conversation */
class Body
private constructor(
private val items: JsonField<List<ResponseInputItem>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull

/** Delete a conversation with the given ID. */
/** Delete a conversation. Items in the conversation will not be deleted. */
class ConversationDeleteParams
private constructor(
private val conversationId: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull

/** Get a conversation with the given ID. */
/** Get a conversation */
class ConversationRetrieveParams
private constructor(
private val conversationId: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull

/** Update a conversation's metadata with the given ID. */
/** Update a conversation */
class ConversationUpdateParams
private constructor(
private val conversationId: String?,
Expand All @@ -35,13 +35,15 @@ private constructor(
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful for storing
* additional information about the object in a structured format, and querying for objects via
* API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are
* strings with a maximum length of 512 characters.
* API or the dashboard.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
* Keys are strings with a maximum length of 64 characters. Values are strings with a maximum
* length of 512 characters.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun metadata(): Metadata = body.metadata()
fun metadata(): Optional<Metadata> = body.metadata()

/**
* Returns the raw JSON value of [metadata].
Expand Down Expand Up @@ -107,10 +109,15 @@ private constructor(
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful for
* storing additional information about the object in a structured format, and querying for
* objects via API or the dashboard. Keys are strings with a maximum length of 64
* characters. Values are strings with a maximum length of 512 characters.
* objects via API or the dashboard.
*
* Keys are strings with a maximum length of 64 characters. Values are strings with a
* maximum length of 512 characters.
*/
fun metadata(metadata: Metadata) = apply { body.metadata(metadata) }
fun metadata(metadata: Metadata?) = apply { body.metadata(metadata) }

/** Alias for calling [Builder.metadata] with `metadata.orElse(null)`. */
fun metadata(metadata: Optional<Metadata>) = metadata(metadata.getOrNull())

/**
* Sets [Builder.metadata] to an arbitrary JSON value.
Expand Down Expand Up @@ -287,13 +294,15 @@ private constructor(
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful for
* storing additional information about the object in a structured format, and querying for
* objects via API or the dashboard. Keys are strings with a maximum length of 64
* characters. Values are strings with a maximum length of 512 characters.
* objects via API or the dashboard.
*
* Keys are strings with a maximum length of 64 characters. Values are strings with a
* maximum length of 512 characters.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun metadata(): Metadata = metadata.getRequired("metadata")
fun metadata(): Optional<Metadata> = metadata.getOptional("metadata")

/**
* Returns the raw JSON value of [metadata].
Expand Down Expand Up @@ -342,10 +351,15 @@ private constructor(
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful for
* storing additional information about the object in a structured format, and querying
* for objects via API or the dashboard. Keys are strings with a maximum length of 64
* characters. Values are strings with a maximum length of 512 characters.
* for objects via API or the dashboard.
*
* Keys are strings with a maximum length of 64 characters. Values are strings with a
* maximum length of 512 characters.
*/
fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata))
fun metadata(metadata: Metadata?) = metadata(JsonField.ofNullable(metadata))

/** Alias for calling [Builder.metadata] with `metadata.orElse(null)`. */
fun metadata(metadata: Optional<Metadata>) = metadata(metadata.getOrNull())

/**
* Sets [Builder.metadata] to an arbitrary JSON value.
Expand Down Expand Up @@ -398,7 +412,7 @@ private constructor(
return@apply
}

metadata().validate()
metadata().ifPresent { it.validate() }
validated = true
}

Expand Down Expand Up @@ -440,8 +454,10 @@ private constructor(
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful for storing
* additional information about the object in a structured format, and querying for objects via
* API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are
* strings with a maximum length of 512 characters.
* API or the dashboard.
*
* Keys are strings with a maximum length of 64 characters. Values are strings with a maximum
* length of 512 characters.
*/
class Metadata
@JsonCreator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private constructor(
private val functionCallOutput: RealtimeConversationItemFunctionCallOutput? = null,
private val mcpApprovalResponse: RealtimeMcpApprovalResponse? = null,
private val mcpListTools: RealtimeMcpListTools? = null,
private val mcpToolCall: RealtimeMcpToolCall? = null,
private val mcpCall: RealtimeMcpToolCall? = null,
private val mcpApprovalRequest: RealtimeMcpApprovalRequest? = null,
private val _json: JsonValue? = null,
) {
Expand Down Expand Up @@ -74,7 +74,7 @@ private constructor(
fun mcpListTools(): Optional<RealtimeMcpListTools> = Optional.ofNullable(mcpListTools)

/** A Realtime item representing an invocation of a tool on an MCP server. */
fun mcpToolCall(): Optional<RealtimeMcpToolCall> = Optional.ofNullable(mcpToolCall)
fun mcpCall(): Optional<RealtimeMcpToolCall> = Optional.ofNullable(mcpCall)

/** A Realtime item requesting human approval of a tool invocation. */
fun mcpApprovalRequest(): Optional<RealtimeMcpApprovalRequest> =
Expand All @@ -97,7 +97,7 @@ private constructor(

fun isMcpListTools(): Boolean = mcpListTools != null

fun isMcpToolCall(): Boolean = mcpToolCall != null
fun isMcpCall(): Boolean = mcpCall != null

fun isMcpApprovalRequest(): Boolean = mcpApprovalRequest != null

Expand Down Expand Up @@ -137,7 +137,7 @@ private constructor(
fun asMcpListTools(): RealtimeMcpListTools = mcpListTools.getOrThrow("mcpListTools")

/** A Realtime item representing an invocation of a tool on an MCP server. */
fun asMcpToolCall(): RealtimeMcpToolCall = mcpToolCall.getOrThrow("mcpToolCall")
fun asMcpCall(): RealtimeMcpToolCall = mcpCall.getOrThrow("mcpCall")

/** A Realtime item requesting human approval of a tool invocation. */
fun asMcpApprovalRequest(): RealtimeMcpApprovalRequest =
Expand All @@ -163,7 +163,7 @@ private constructor(
functionCallOutput != null -> visitor.visitFunctionCallOutput(functionCallOutput)
mcpApprovalResponse != null -> visitor.visitMcpApprovalResponse(mcpApprovalResponse)
mcpListTools != null -> visitor.visitMcpListTools(mcpListTools)
mcpToolCall != null -> visitor.visitMcpToolCall(mcpToolCall)
mcpCall != null -> visitor.visitMcpCall(mcpCall)
mcpApprovalRequest != null -> visitor.visitMcpApprovalRequest(mcpApprovalRequest)
else -> visitor.unknown(_json)
}
Expand Down Expand Up @@ -216,8 +216,8 @@ private constructor(
mcpListTools.validate()
}

override fun visitMcpToolCall(mcpToolCall: RealtimeMcpToolCall) {
mcpToolCall.validate()
override fun visitMcpCall(mcpCall: RealtimeMcpToolCall) {
mcpCall.validate()
}

override fun visitMcpApprovalRequest(
Expand Down Expand Up @@ -274,8 +274,7 @@ private constructor(
override fun visitMcpListTools(mcpListTools: RealtimeMcpListTools) =
mcpListTools.validity()

override fun visitMcpToolCall(mcpToolCall: RealtimeMcpToolCall) =
mcpToolCall.validity()
override fun visitMcpCall(mcpCall: RealtimeMcpToolCall) = mcpCall.validity()

override fun visitMcpApprovalRequest(
mcpApprovalRequest: RealtimeMcpApprovalRequest
Expand All @@ -299,7 +298,7 @@ private constructor(
functionCallOutput == other.functionCallOutput &&
mcpApprovalResponse == other.mcpApprovalResponse &&
mcpListTools == other.mcpListTools &&
mcpToolCall == other.mcpToolCall &&
mcpCall == other.mcpCall &&
mcpApprovalRequest == other.mcpApprovalRequest
}

Expand All @@ -312,7 +311,7 @@ private constructor(
functionCallOutput,
mcpApprovalResponse,
mcpListTools,
mcpToolCall,
mcpCall,
mcpApprovalRequest,
)

Expand All @@ -329,7 +328,7 @@ private constructor(
mcpApprovalResponse != null ->
"ConversationItem{mcpApprovalResponse=$mcpApprovalResponse}"
mcpListTools != null -> "ConversationItem{mcpListTools=$mcpListTools}"
mcpToolCall != null -> "ConversationItem{mcpToolCall=$mcpToolCall}"
mcpCall != null -> "ConversationItem{mcpCall=$mcpCall}"
mcpApprovalRequest != null -> "ConversationItem{mcpApprovalRequest=$mcpApprovalRequest}"
_json != null -> "ConversationItem{_unknown=$_json}"
else -> throw IllegalStateException("Invalid ConversationItem")
Expand Down Expand Up @@ -392,9 +391,7 @@ private constructor(
ConversationItem(mcpListTools = mcpListTools)

/** A Realtime item representing an invocation of a tool on an MCP server. */
@JvmStatic
fun ofMcpToolCall(mcpToolCall: RealtimeMcpToolCall) =
ConversationItem(mcpToolCall = mcpToolCall)
@JvmStatic fun ofMcpCall(mcpCall: RealtimeMcpToolCall) = ConversationItem(mcpCall = mcpCall)

/** A Realtime item requesting human approval of a tool invocation. */
@JvmStatic
Expand Down Expand Up @@ -445,7 +442,7 @@ private constructor(
fun visitMcpListTools(mcpListTools: RealtimeMcpListTools): T

/** A Realtime item representing an invocation of a tool on an MCP server. */
fun visitMcpToolCall(mcpToolCall: RealtimeMcpToolCall): T
fun visitMcpCall(mcpCall: RealtimeMcpToolCall): T

/** A Realtime item requesting human approval of a tool invocation. */
fun visitMcpApprovalRequest(mcpApprovalRequest: RealtimeMcpApprovalRequest): T
Expand Down Expand Up @@ -546,9 +543,9 @@ private constructor(
ConversationItem(mcpListTools = it, _json = json)
} ?: ConversationItem(_json = json)
}
"mcp_tool_call" -> {
"mcp_call" -> {
return tryDeserialize(node, jacksonTypeRef<RealtimeMcpToolCall>())?.let {
ConversationItem(mcpToolCall = it, _json = json)
ConversationItem(mcpCall = it, _json = json)
} ?: ConversationItem(_json = json)
}
"mcp_approval_request" -> {
Expand Down Expand Up @@ -581,7 +578,7 @@ private constructor(
value.mcpApprovalResponse != null ->
generator.writeObject(value.mcpApprovalResponse)
value.mcpListTools != null -> generator.writeObject(value.mcpListTools)
value.mcpToolCall != null -> generator.writeObject(value.mcpToolCall)
value.mcpCall != null -> generator.writeObject(value.mcpCall)
value.mcpApprovalRequest != null -> generator.writeObject(value.mcpApprovalRequest)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid ConversationItem")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,8 @@ private constructor(
fun item(mcpListTools: RealtimeMcpListTools) =
item(ConversationItem.ofMcpListTools(mcpListTools))

/** Alias for calling [item] with `ConversationItem.ofMcpToolCall(mcpToolCall)`. */
fun item(mcpToolCall: RealtimeMcpToolCall) =
item(ConversationItem.ofMcpToolCall(mcpToolCall))
/** Alias for calling [item] with `ConversationItem.ofMcpCall(mcpCall)`. */
fun item(mcpCall: RealtimeMcpToolCall) = item(ConversationItem.ofMcpCall(mcpCall))

/**
* Alias for calling [item] with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,8 @@ private constructor(
fun item(mcpListTools: RealtimeMcpListTools) =
item(ConversationItem.ofMcpListTools(mcpListTools))

/** Alias for calling [item] with `ConversationItem.ofMcpToolCall(mcpToolCall)`. */
fun item(mcpToolCall: RealtimeMcpToolCall) =
item(ConversationItem.ofMcpToolCall(mcpToolCall))
/** Alias for calling [item] with `ConversationItem.ofMcpCall(mcpCall)`. */
fun item(mcpCall: RealtimeMcpToolCall) = item(ConversationItem.ofMcpCall(mcpCall))

/**
* Alias for calling [item] with
Expand Down
Loading