From 3d35cf9c912bc330713cbb7a2f4dc9c7fc47b712 Mon Sep 17 00:00:00 2001 From: apcha-oai <228803254+apcha-oai@users.noreply.github.com> Date: Wed, 26 Aug 2026 23:09:38 +0000 Subject: [PATCH] feat(api): make function call output call IDs optional Castiron-Internal-PR: https://github.com/openai/openai-java-internal/pull/51 Castiron-Source-SHA: 04866d3e83bf2ba2292c21ea60c9eabc957df1e2 Castiron-Public-Base-SHA: 35324bf54adf68ea1853f7684bdbdf29c9fd329c --- .castiron.stats.yml | 14 ++-- api_reference/openapi.transformed.yml | 24 +++--- .../BetaResponseFunctionToolCallOutputItem.kt | 76 +++++++++-------- .../beta/responses/BetaResponseInjectEvent.kt | 34 ++++++++ .../BetaResponseInjectFailedEvent.kt | 34 ++++++++ .../beta/responses/BetaResponseInputItem.kt | 83 ++++++++++--------- .../conversations/ConversationCreateParams.kt | 65 +++++++++++++++ .../conversations/items/ItemCreateParams.kt | 65 +++++++++++++++ .../ResponseFunctionToolCallOutputItem.kt | 76 +++++++++-------- .../models/responses/ResponseInputItem.kt | 83 ++++++++++--------- ...aResponseFunctionToolCallOutputItemTest.kt | 6 +- .../responses/BetaResponseInputItemTest.kt | 4 +- .../beta/responses/BetaResponseItemTest.kt | 4 +- .../responses/BetaResponseOutputItemTest.kt | 4 +- .../items/ConversationItemTest.kt | 4 +- .../ResponseFunctionToolCallOutputItemTest.kt | 6 +- .../models/responses/ResponseInputItemTest.kt | 4 +- .../models/responses/ResponseItemTest.kt | 4 +- .../responses/ResponseOutputItemTest.kt | 4 +- 19 files changed, 395 insertions(+), 199 deletions(-) diff --git a/.castiron.stats.yml b/.castiron.stats.yml index aa846039d..5d6cafb24 100644 --- a/.castiron.stats.yml +++ b/.castiron.stats.yml @@ -1,8 +1,8 @@ schema_version: 1 -generation_id: d5f4ed15-606a-40de-99cc-7624ca170180 -openapi_spec_hash: b2c62b342b04685226037c980f2b5a7a -openapi_transformed_spec_hash: ba44bf31326f01a1d886b7510dd9da8a -config_hash: 4fbbbcf377bcc17646cccb9fcfbac14a -codegen_sha: 41b7af5cc4a284522463cb9ac54053a29f9642ef -codegen_hash: 6c8ab5a5c306f169798c284065aa2844565e87ef175da1e1227914c9d7b4a9e7 -public_codegen_sha: 7661007907a5a6520bb17cffeeb1732809872c33 +generation_id: 2582da1f-8818-4a38-8a5e-f2a460596a3b +openapi_spec_hash: 32e9f9c8096eae027754def9afb89dc0 +openapi_transformed_spec_hash: a5861d7f7b67f6845c9499fdec7324a5 +config_hash: 5c00fe18ea913ed0186f9894adc02a70 +codegen_sha: 60cd82adcea1d595899112511aaf9cf9ced7ab54 +codegen_hash: 157a1c53e8ed2d058cca05b73e91dfc159cb5f016b21d1581a17577ad9296e63 +public_codegen_sha: 21201cc03353dc220a304f4145f33f80e4357db8 diff --git a/api_reference/openapi.transformed.yml b/api_reference/openapi.transformed.yml index 164fe8c28..556cdd2d9 100644 --- a/api_reference/openapi.transformed.yml +++ b/api_reference/openapi.transformed.yml @@ -37968,7 +37968,6 @@ components: - incomplete required: - type - - call_id - output FunctionToolCallOutputResource: allOf: @@ -63939,10 +63938,12 @@ components: example: fc_123 - type: 'null' call_id: - type: string - maxLength: 64 - minLength: 1 - description: The unique ID of the function tool call generated by the model. + anyOf: + - type: string + maxLength: 64 + minLength: 1 + description: The unique ID of the function tool call generated by the model. + - type: 'null' type: type: string enum: @@ -63994,7 +63995,6 @@ components: type: object required: - type - - call_id - output title: Function tool call output description: The output of a function tool call. @@ -71251,10 +71251,12 @@ components: example: fc_123 - type: 'null' call_id: - type: string - maxLength: 64 - minLength: 1 - description: The unique ID of the function tool call generated by the model. + anyOf: + - type: string + maxLength: 64 + minLength: 1 + description: The unique ID of the function tool call generated by the model. + - type: 'null' type: type: string enum: @@ -71306,7 +71308,6 @@ components: type: object required: - type - - call_id - output title: Function tool call output description: The output of a function tool call. @@ -73658,7 +73659,6 @@ components: - incomplete required: - type - - call_id - output BetaFunctionToolCallResource: allOf: diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItem.kt index 20b6f10c2..47e80a5b8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItem.kt @@ -34,11 +34,11 @@ class BetaResponseFunctionToolCallOutputItem @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val id: JsonField, - private val callId: JsonField, private val output: JsonField, private val status: JsonField, private val type: JsonValue, private val agent: JsonField, + private val callId: JsonField, private val caller: JsonField, private val createdBy: JsonField, private val name: JsonField, @@ -49,22 +49,22 @@ private constructor( @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), - @JsonProperty("call_id") @ExcludeMissing callId: JsonField = JsonMissing.of(), @JsonProperty("output") @ExcludeMissing output: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(), @JsonProperty("agent") @ExcludeMissing agent: JsonField = JsonMissing.of(), + @JsonProperty("call_id") @ExcludeMissing callId: JsonField = JsonMissing.of(), @JsonProperty("caller") @ExcludeMissing caller: JsonField = JsonMissing.of(), @JsonProperty("created_by") @ExcludeMissing createdBy: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("namespace") @ExcludeMissing namespace: JsonField = JsonMissing.of(), ) : this( id, - callId, output, status, type, agent, + callId, caller, createdBy, name, @@ -80,14 +80,6 @@ private constructor( */ fun id(): String = id.getRequired("id") - /** - * The unique ID of the function tool call generated by the model. - * - * @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). - */ - fun callId(): String = callId.getRequired("call_id") - /** * The output from the function call generated by your code. Can be a string or an list of * output content. @@ -127,6 +119,14 @@ private constructor( */ fun agent(): Optional = agent.getOptional("agent") + /** + * The unique ID of the function tool call generated by the model. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun callId(): Optional = callId.getOptional("call_id") + /** * The execution context that produced this tool call. * @@ -166,13 +166,6 @@ private constructor( */ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - /** - * Returns the raw JSON value of [callId]. - * - * Unlike [callId], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("call_id") @ExcludeMissing fun _callId(): JsonField = callId - /** * Returns the raw JSON value of [output]. * @@ -194,6 +187,13 @@ private constructor( */ @JsonProperty("agent") @ExcludeMissing fun _agent(): JsonField = agent + /** + * Returns the raw JSON value of [callId]. + * + * Unlike [callId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("call_id") @ExcludeMissing fun _callId(): JsonField = callId + /** * Returns the raw JSON value of [caller]. * @@ -243,7 +243,6 @@ private constructor( * The following fields are required: * ```java * .id() - * .callId() * .output() * .status() * ``` @@ -255,11 +254,11 @@ private constructor( class Builder internal constructor() { private var id: JsonField? = null - private var callId: JsonField? = null private var output: JsonField? = null private var status: JsonField? = null private var type: JsonValue = JsonValue.from("function_call_output") private var agent: JsonField = JsonMissing.of() + private var callId: JsonField = JsonMissing.of() private var caller: JsonField = JsonMissing.of() private var createdBy: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() @@ -271,11 +270,11 @@ private constructor( betaResponseFunctionToolCallOutputItem: BetaResponseFunctionToolCallOutputItem ) = apply { id = betaResponseFunctionToolCallOutputItem.id - callId = betaResponseFunctionToolCallOutputItem.callId output = betaResponseFunctionToolCallOutputItem.output status = betaResponseFunctionToolCallOutputItem.status type = betaResponseFunctionToolCallOutputItem.type agent = betaResponseFunctionToolCallOutputItem.agent + callId = betaResponseFunctionToolCallOutputItem.callId caller = betaResponseFunctionToolCallOutputItem.caller createdBy = betaResponseFunctionToolCallOutputItem.createdBy name = betaResponseFunctionToolCallOutputItem.name @@ -295,17 +294,6 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The unique ID of the function tool call generated by the model. */ - fun callId(callId: String) = callId(JsonField.of(callId)) - - /** - * Sets [Builder.callId] to an arbitrary JSON value. - * - * You should usually call [Builder.callId] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun callId(callId: JsonField) = apply { this.callId = callId } - /** * The output from the function call generated by your code. Can be a string or an list of * output content. @@ -369,6 +357,17 @@ private constructor( */ fun agent(agent: JsonField) = apply { this.agent = agent } + /** The unique ID of the function tool call generated by the model. */ + fun callId(callId: String) = callId(JsonField.of(callId)) + + /** + * Sets [Builder.callId] to an arbitrary JSON value. + * + * You should usually call [Builder.callId] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun callId(callId: JsonField) = apply { this.callId = callId } + /** The execution context that produced this tool call. */ fun caller(caller: Caller?) = caller(JsonField.ofNullable(caller)) @@ -462,7 +461,6 @@ private constructor( * The following fields are required: * ```java * .id() - * .callId() * .output() * .status() * ``` @@ -472,11 +470,11 @@ private constructor( fun build(): BetaResponseFunctionToolCallOutputItem = BetaResponseFunctionToolCallOutputItem( checkRequired("id", id), - checkRequired("callId", callId), checkRequired("output", output), checkRequired("status", status), type, agent, + callId, caller, createdBy, name, @@ -501,7 +499,6 @@ private constructor( } id() - callId() output().validate() status().validate() _type().let { @@ -510,6 +507,7 @@ private constructor( } } agent().ifPresent { it.validate() } + callId() caller().ifPresent { it.validate() } createdBy() name() @@ -533,11 +531,11 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (id.asKnown().isPresent) 1 else 0) + - (if (callId.asKnown().isPresent) 1 else 0) + (output.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + type.let { if (it == JsonValue.from("function_call_output")) 1 else 0 } + (agent.asKnown().getOrNull()?.validity() ?: 0) + + (if (callId.asKnown().isPresent) 1 else 0) + (caller.asKnown().getOrNull()?.validity() ?: 0) + (if (createdBy.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + @@ -1815,11 +1813,11 @@ private constructor( return other is BetaResponseFunctionToolCallOutputItem && id == other.id && - callId == other.callId && output == other.output && status == other.status && type == other.type && agent == other.agent && + callId == other.callId && caller == other.caller && createdBy == other.createdBy && name == other.name && @@ -1830,11 +1828,11 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( id, - callId, output, status, type, agent, + callId, caller, createdBy, name, @@ -1846,5 +1844,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BetaResponseFunctionToolCallOutputItem{id=$id, callId=$callId, output=$output, status=$status, type=$type, agent=$agent, caller=$caller, createdBy=$createdBy, name=$name, namespace=$namespace, additionalProperties=$additionalProperties}" + "BetaResponseFunctionToolCallOutputItem{id=$id, output=$output, status=$status, type=$type, agent=$agent, callId=$callId, caller=$caller, createdBy=$createdBy, name=$name, namespace=$namespace, additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectEvent.kt index 04740f6e8..1ab6c5857 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectEvent.kt @@ -213,6 +213,40 @@ private constructor( fun addInput(functionCallOutput: BetaResponseInputItem.FunctionCallOutput) = addInput(BetaResponseInputItem.ofFunctionCallOutput(functionCallOutput)) + /** + * Alias for calling [addInput] with the following: + * ```java + * BetaResponseInputItem.FunctionCallOutput.builder() + * .output(output) + * .build() + * ``` + */ + fun addFunctionCallOutputInput(output: BetaResponseInputItem.FunctionCallOutput.Output) = + addInput(BetaResponseInputItem.FunctionCallOutput.builder().output(output).build()) + + /** + * Alias for calling [addFunctionCallOutputInput] with + * `BetaResponseInputItem.FunctionCallOutput.Output.ofString(string)`. + */ + fun addFunctionCallOutputInput(string: String) = + addFunctionCallOutputInput( + BetaResponseInputItem.FunctionCallOutput.Output.ofString(string) + ) + + /** + * Alias for calling [addFunctionCallOutputInput] with + * `BetaResponseInputItem.FunctionCallOutput.Output.ofBetaResponseFunctionCallOutputItemList(betaResponseFunctionCallOutputItemList)`. + */ + fun addFunctionCallOutputInputOfBetaResponseFunctionCallOutputItemList( + betaResponseFunctionCallOutputItemList: List + ) = + addFunctionCallOutputInput( + BetaResponseInputItem.FunctionCallOutput.Output + .ofBetaResponseFunctionCallOutputItemList( + betaResponseFunctionCallOutputItemList + ) + ) + /** * Alias for calling [addInput] with `BetaResponseInputItem.ofAgentMessage(agentMessage)`. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectFailedEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectFailedEvent.kt index cfafe0b28..fb7c80d39 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectFailedEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectFailedEvent.kt @@ -290,6 +290,40 @@ private constructor( fun addInput(functionCallOutput: BetaResponseInputItem.FunctionCallOutput) = addInput(BetaResponseInputItem.ofFunctionCallOutput(functionCallOutput)) + /** + * Alias for calling [addInput] with the following: + * ```java + * BetaResponseInputItem.FunctionCallOutput.builder() + * .output(output) + * .build() + * ``` + */ + fun addFunctionCallOutputInput(output: BetaResponseInputItem.FunctionCallOutput.Output) = + addInput(BetaResponseInputItem.FunctionCallOutput.builder().output(output).build()) + + /** + * Alias for calling [addFunctionCallOutputInput] with + * `BetaResponseInputItem.FunctionCallOutput.Output.ofString(string)`. + */ + fun addFunctionCallOutputInput(string: String) = + addFunctionCallOutputInput( + BetaResponseInputItem.FunctionCallOutput.Output.ofString(string) + ) + + /** + * Alias for calling [addFunctionCallOutputInput] with + * `BetaResponseInputItem.FunctionCallOutput.Output.ofBetaResponseFunctionCallOutputItemList(betaResponseFunctionCallOutputItemList)`. + */ + fun addFunctionCallOutputInputOfBetaResponseFunctionCallOutputItemList( + betaResponseFunctionCallOutputItemList: List + ) = + addFunctionCallOutputInput( + BetaResponseInputItem.FunctionCallOutput.Output + .ofBetaResponseFunctionCallOutputItemList( + betaResponseFunctionCallOutputItemList + ) + ) + /** * Alias for calling [addInput] with `BetaResponseInputItem.ofAgentMessage(agentMessage)`. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt index 5f78e009d..c56995745 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt @@ -3602,11 +3602,11 @@ private constructor( class FunctionCallOutput @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val callId: JsonField, private val output: JsonField, private val type: JsonValue, private val id: JsonField, private val agent: JsonField, + private val callId: JsonField, private val caller: JsonField, private val name: JsonField, private val namespace: JsonField, @@ -3616,26 +3616,18 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("call_id") @ExcludeMissing callId: JsonField = JsonMissing.of(), @JsonProperty("output") @ExcludeMissing output: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(), @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), @JsonProperty("agent") @ExcludeMissing agent: JsonField = JsonMissing.of(), + @JsonProperty("call_id") @ExcludeMissing callId: JsonField = JsonMissing.of(), @JsonProperty("caller") @ExcludeMissing caller: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("namespace") @ExcludeMissing namespace: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), - ) : this(callId, output, type, id, agent, caller, name, namespace, status, mutableMapOf()) - - /** - * The unique ID of the function tool call generated by the model. - * - * @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). - */ - fun callId(): String = callId.getRequired("call_id") + ) : this(output, type, id, agent, callId, caller, name, namespace, status, mutableMapOf()) /** * Text, image, or file output of the function tool call. @@ -3675,6 +3667,14 @@ private constructor( */ fun agent(): Optional = agent.getOptional("agent") + /** + * The unique ID of the function tool call generated by the model. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun callId(): Optional = callId.getOptional("call_id") + /** * The execution context that produced this tool call. * @@ -3708,13 +3708,6 @@ private constructor( */ fun status(): Optional = status.getOptional("status") - /** - * Returns the raw JSON value of [callId]. - * - * Unlike [callId], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("call_id") @ExcludeMissing fun _callId(): JsonField = callId - /** * Returns the raw JSON value of [output]. * @@ -3736,6 +3729,13 @@ private constructor( */ @JsonProperty("agent") @ExcludeMissing fun _agent(): JsonField = agent + /** + * Returns the raw JSON value of [callId]. + * + * Unlike [callId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("call_id") @ExcludeMissing fun _callId(): JsonField = callId + /** * Returns the raw JSON value of [caller]. * @@ -3783,7 +3783,6 @@ private constructor( * * The following fields are required: * ```java - * .callId() * .output() * ``` */ @@ -3793,11 +3792,11 @@ private constructor( /** A builder for [FunctionCallOutput]. */ class Builder internal constructor() { - private var callId: JsonField? = null private var output: JsonField? = null private var type: JsonValue = JsonValue.from("function_call_output") private var id: JsonField = JsonMissing.of() private var agent: JsonField = JsonMissing.of() + private var callId: JsonField = JsonMissing.of() private var caller: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var namespace: JsonField = JsonMissing.of() @@ -3806,11 +3805,11 @@ private constructor( @JvmSynthetic internal fun from(functionCallOutput: FunctionCallOutput) = apply { - callId = functionCallOutput.callId output = functionCallOutput.output type = functionCallOutput.type id = functionCallOutput.id agent = functionCallOutput.agent + callId = functionCallOutput.callId caller = functionCallOutput.caller name = functionCallOutput.name namespace = functionCallOutput.namespace @@ -3818,18 +3817,6 @@ private constructor( additionalProperties = functionCallOutput.additionalProperties.toMutableMap() } - /** The unique ID of the function tool call generated by the model. */ - fun callId(callId: String) = callId(JsonField.of(callId)) - - /** - * Sets [Builder.callId] to an arbitrary JSON value. - * - * You should usually call [Builder.callId] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun callId(callId: JsonField) = apply { this.callId = callId } - /** Text, image, or file output of the function tool call. */ fun output(output: Output) = output(JsonField.of(output)) @@ -3905,6 +3892,21 @@ private constructor( */ fun agent(agent: JsonField) = apply { this.agent = agent } + /** The unique ID of the function tool call generated by the model. */ + fun callId(callId: String?) = callId(JsonField.ofNullable(callId)) + + /** Alias for calling [Builder.callId] with `callId.orElse(null)`. */ + fun callId(callId: Optional) = callId(callId.getOrNull()) + + /** + * Sets [Builder.callId] to an arbitrary JSON value. + * + * You should usually call [Builder.callId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun callId(callId: JsonField) = apply { this.callId = callId } + /** The execution context that produced this tool call. */ fun caller(caller: Caller?) = caller(JsonField.ofNullable(caller)) @@ -4011,7 +4013,6 @@ private constructor( * * The following fields are required: * ```java - * .callId() * .output() * ``` * @@ -4019,11 +4020,11 @@ private constructor( */ fun build(): FunctionCallOutput = FunctionCallOutput( - checkRequired("callId", callId), checkRequired("output", output), type, id, agent, + callId, caller, name, namespace, @@ -4048,7 +4049,6 @@ private constructor( return@apply } - callId() output().validate() _type().let { if (it != JsonValue.from("function_call_output")) { @@ -4057,6 +4057,7 @@ private constructor( } id() agent().ifPresent { it.validate() } + callId() caller().ifPresent { it.validate() } name() namespace() @@ -4080,11 +4081,11 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (callId.asKnown().isPresent) 1 else 0) + - (output.asKnown().getOrNull()?.validity() ?: 0) + + (output.asKnown().getOrNull()?.validity() ?: 0) + type.let { if (it == JsonValue.from("function_call_output")) 1 else 0 } + (if (id.asKnown().isPresent) 1 else 0) + (agent.asKnown().getOrNull()?.validity() ?: 0) + + (if (callId.asKnown().isPresent) 1 else 0) + (caller.asKnown().getOrNull()?.validity() ?: 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (namespace.asKnown().isPresent) 1 else 0) + @@ -5123,11 +5124,11 @@ private constructor( } return other is FunctionCallOutput && - callId == other.callId && output == other.output && type == other.type && id == other.id && agent == other.agent && + callId == other.callId && caller == other.caller && name == other.name && namespace == other.namespace && @@ -5137,11 +5138,11 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( - callId, output, type, id, agent, + callId, caller, name, namespace, @@ -5153,7 +5154,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "FunctionCallOutput{callId=$callId, output=$output, type=$type, id=$id, agent=$agent, caller=$caller, name=$name, namespace=$namespace, status=$status, additionalProperties=$additionalProperties}" + "FunctionCallOutput{output=$output, type=$type, id=$id, agent=$agent, callId=$callId, caller=$caller, name=$name, namespace=$namespace, status=$status, additionalProperties=$additionalProperties}" } /** A message routed between agents. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/conversations/ConversationCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/conversations/ConversationCreateParams.kt index 0b59d97f2..d0403f474 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/conversations/ConversationCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/conversations/ConversationCreateParams.kt @@ -23,6 +23,7 @@ import com.openai.models.responses.ResponseComputerToolCall import com.openai.models.responses.ResponseCustomToolCall import com.openai.models.responses.ResponseCustomToolCallOutput import com.openai.models.responses.ResponseFileSearchToolCall +import com.openai.models.responses.ResponseFunctionCallOutputItem import com.openai.models.responses.ResponseFunctionToolCall import com.openai.models.responses.ResponseFunctionWebSearch import com.openai.models.responses.ResponseInputItem @@ -196,6 +197,38 @@ private constructor( body.addItem(functionCallOutput) } + /** + * Alias for calling [addItem] with the following: + * ```java + * ResponseInputItem.FunctionCallOutput.builder() + * .output(output) + * .build() + * ``` + */ + fun addFunctionCallOutputItem(output: ResponseInputItem.FunctionCallOutput.Output) = apply { + body.addFunctionCallOutputItem(output) + } + + /** + * Alias for calling [addFunctionCallOutputItem] with + * `ResponseInputItem.FunctionCallOutput.Output.ofString(string)`. + */ + fun addFunctionCallOutputItem(string: String) = apply { + body.addFunctionCallOutputItem(string) + } + + /** + * Alias for calling [addFunctionCallOutputItem] with + * `ResponseInputItem.FunctionCallOutput.Output.ofResponseFunctionCallOutputItemList(responseFunctionCallOutputItemList)`. + */ + fun addFunctionCallOutputItemOfResponseFunctionCallOutputItemList( + responseFunctionCallOutputItemList: List + ) = apply { + body.addFunctionCallOutputItemOfResponseFunctionCallOutputItemList( + responseFunctionCallOutputItemList + ) + } + /** * Alias for calling [addItem] with `ResponseInputItem.ofToolSearchCall(toolSearchCall)`. */ @@ -725,6 +758,38 @@ private constructor( fun addItem(functionCallOutput: ResponseInputItem.FunctionCallOutput) = addItem(ResponseInputItem.ofFunctionCallOutput(functionCallOutput)) + /** + * Alias for calling [addItem] with the following: + * ```java + * ResponseInputItem.FunctionCallOutput.builder() + * .output(output) + * .build() + * ``` + */ + fun addFunctionCallOutputItem(output: ResponseInputItem.FunctionCallOutput.Output) = + addItem(ResponseInputItem.FunctionCallOutput.builder().output(output).build()) + + /** + * Alias for calling [addFunctionCallOutputItem] with + * `ResponseInputItem.FunctionCallOutput.Output.ofString(string)`. + */ + fun addFunctionCallOutputItem(string: String) = + addFunctionCallOutputItem( + ResponseInputItem.FunctionCallOutput.Output.ofString(string) + ) + + /** + * Alias for calling [addFunctionCallOutputItem] with + * `ResponseInputItem.FunctionCallOutput.Output.ofResponseFunctionCallOutputItemList(responseFunctionCallOutputItemList)`. + */ + fun addFunctionCallOutputItemOfResponseFunctionCallOutputItemList( + responseFunctionCallOutputItemList: List + ) = + addFunctionCallOutputItem( + ResponseInputItem.FunctionCallOutput.Output + .ofResponseFunctionCallOutputItemList(responseFunctionCallOutputItemList) + ) + /** * Alias for calling [addItem] with * `ResponseInputItem.ofToolSearchCall(toolSearchCall)`. diff --git a/openai-java-core/src/main/kotlin/com/openai/models/conversations/items/ItemCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/conversations/items/ItemCreateParams.kt index df200b6c4..9ed2492f1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/conversations/items/ItemCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/conversations/items/ItemCreateParams.kt @@ -24,6 +24,7 @@ import com.openai.models.responses.ResponseComputerToolCall import com.openai.models.responses.ResponseCustomToolCall import com.openai.models.responses.ResponseCustomToolCallOutput import com.openai.models.responses.ResponseFileSearchToolCall +import com.openai.models.responses.ResponseFunctionCallOutputItem import com.openai.models.responses.ResponseFunctionToolCall import com.openai.models.responses.ResponseFunctionWebSearch import com.openai.models.responses.ResponseIncludable @@ -218,6 +219,38 @@ private constructor( body.addItem(functionCallOutput) } + /** + * Alias for calling [addItem] with the following: + * ```java + * ResponseInputItem.FunctionCallOutput.builder() + * .output(output) + * .build() + * ``` + */ + fun addFunctionCallOutputItem(output: ResponseInputItem.FunctionCallOutput.Output) = apply { + body.addFunctionCallOutputItem(output) + } + + /** + * Alias for calling [addFunctionCallOutputItem] with + * `ResponseInputItem.FunctionCallOutput.Output.ofString(string)`. + */ + fun addFunctionCallOutputItem(string: String) = apply { + body.addFunctionCallOutputItem(string) + } + + /** + * Alias for calling [addFunctionCallOutputItem] with + * `ResponseInputItem.FunctionCallOutput.Output.ofResponseFunctionCallOutputItemList(responseFunctionCallOutputItemList)`. + */ + fun addFunctionCallOutputItemOfResponseFunctionCallOutputItemList( + responseFunctionCallOutputItemList: List + ) = apply { + body.addFunctionCallOutputItemOfResponseFunctionCallOutputItemList( + responseFunctionCallOutputItemList + ) + } + /** * Alias for calling [addItem] with `ResponseInputItem.ofToolSearchCall(toolSearchCall)`. */ @@ -720,6 +753,38 @@ private constructor( fun addItem(functionCallOutput: ResponseInputItem.FunctionCallOutput) = addItem(ResponseInputItem.ofFunctionCallOutput(functionCallOutput)) + /** + * Alias for calling [addItem] with the following: + * ```java + * ResponseInputItem.FunctionCallOutput.builder() + * .output(output) + * .build() + * ``` + */ + fun addFunctionCallOutputItem(output: ResponseInputItem.FunctionCallOutput.Output) = + addItem(ResponseInputItem.FunctionCallOutput.builder().output(output).build()) + + /** + * Alias for calling [addFunctionCallOutputItem] with + * `ResponseInputItem.FunctionCallOutput.Output.ofString(string)`. + */ + fun addFunctionCallOutputItem(string: String) = + addFunctionCallOutputItem( + ResponseInputItem.FunctionCallOutput.Output.ofString(string) + ) + + /** + * Alias for calling [addFunctionCallOutputItem] with + * `ResponseInputItem.FunctionCallOutput.Output.ofResponseFunctionCallOutputItemList(responseFunctionCallOutputItemList)`. + */ + fun addFunctionCallOutputItemOfResponseFunctionCallOutputItemList( + responseFunctionCallOutputItemList: List + ) = + addFunctionCallOutputItem( + ResponseInputItem.FunctionCallOutput.Output + .ofResponseFunctionCallOutputItemList(responseFunctionCallOutputItemList) + ) + /** * Alias for calling [addItem] with * `ResponseInputItem.ofToolSearchCall(toolSearchCall)`. diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItem.kt index 848c9249c..b9c6f54d4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItem.kt @@ -34,10 +34,10 @@ class ResponseFunctionToolCallOutputItem @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val id: JsonField, - private val callId: JsonField, private val output: JsonField, private val status: JsonField, private val type: JsonValue, + private val callId: JsonField, private val caller: JsonField, private val createdBy: JsonField, private val name: JsonField, @@ -48,15 +48,15 @@ private constructor( @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), - @JsonProperty("call_id") @ExcludeMissing callId: JsonField = JsonMissing.of(), @JsonProperty("output") @ExcludeMissing output: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(), + @JsonProperty("call_id") @ExcludeMissing callId: JsonField = JsonMissing.of(), @JsonProperty("caller") @ExcludeMissing caller: JsonField = JsonMissing.of(), @JsonProperty("created_by") @ExcludeMissing createdBy: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("namespace") @ExcludeMissing namespace: JsonField = JsonMissing.of(), - ) : this(id, callId, output, status, type, caller, createdBy, name, namespace, mutableMapOf()) + ) : this(id, output, status, type, callId, caller, createdBy, name, namespace, mutableMapOf()) /** * The unique ID of the function call tool output. @@ -66,14 +66,6 @@ private constructor( */ fun id(): String = id.getRequired("id") - /** - * The unique ID of the function tool call generated by the model. - * - * @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). - */ - fun callId(): String = callId.getRequired("call_id") - /** * The output from the function call generated by your code. Can be a string or an list of * output content. @@ -105,6 +97,14 @@ private constructor( */ @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type + /** + * The unique ID of the function tool call generated by the model. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun callId(): Optional = callId.getOptional("call_id") + /** * The execution context that produced this tool call. * @@ -144,13 +144,6 @@ private constructor( */ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - /** - * Returns the raw JSON value of [callId]. - * - * Unlike [callId], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("call_id") @ExcludeMissing fun _callId(): JsonField = callId - /** * Returns the raw JSON value of [output]. * @@ -165,6 +158,13 @@ private constructor( */ @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + /** + * Returns the raw JSON value of [callId]. + * + * Unlike [callId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("call_id") @ExcludeMissing fun _callId(): JsonField = callId + /** * Returns the raw JSON value of [caller]. * @@ -214,7 +214,6 @@ private constructor( * The following fields are required: * ```java * .id() - * .callId() * .output() * .status() * ``` @@ -226,10 +225,10 @@ private constructor( class Builder internal constructor() { private var id: JsonField? = null - private var callId: JsonField? = null private var output: JsonField? = null private var status: JsonField? = null private var type: JsonValue = JsonValue.from("function_call_output") + private var callId: JsonField = JsonMissing.of() private var caller: JsonField = JsonMissing.of() private var createdBy: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() @@ -240,10 +239,10 @@ private constructor( internal fun from(responseFunctionToolCallOutputItem: ResponseFunctionToolCallOutputItem) = apply { id = responseFunctionToolCallOutputItem.id - callId = responseFunctionToolCallOutputItem.callId output = responseFunctionToolCallOutputItem.output status = responseFunctionToolCallOutputItem.status type = responseFunctionToolCallOutputItem.type + callId = responseFunctionToolCallOutputItem.callId caller = responseFunctionToolCallOutputItem.caller createdBy = responseFunctionToolCallOutputItem.createdBy name = responseFunctionToolCallOutputItem.name @@ -263,17 +262,6 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The unique ID of the function tool call generated by the model. */ - fun callId(callId: String) = callId(JsonField.of(callId)) - - /** - * Sets [Builder.callId] to an arbitrary JSON value. - * - * You should usually call [Builder.callId] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun callId(callId: JsonField) = apply { this.callId = callId } - /** * The output from the function call generated by your code. Can be a string or an list of * output content. @@ -323,6 +311,17 @@ private constructor( */ fun type(type: JsonValue) = apply { this.type = type } + /** The unique ID of the function tool call generated by the model. */ + fun callId(callId: String) = callId(JsonField.of(callId)) + + /** + * Sets [Builder.callId] to an arbitrary JSON value. + * + * You should usually call [Builder.callId] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun callId(callId: JsonField) = apply { this.callId = callId } + /** The execution context that produced this tool call. */ fun caller(caller: Caller?) = caller(JsonField.ofNullable(caller)) @@ -416,7 +415,6 @@ private constructor( * The following fields are required: * ```java * .id() - * .callId() * .output() * .status() * ``` @@ -426,10 +424,10 @@ private constructor( fun build(): ResponseFunctionToolCallOutputItem = ResponseFunctionToolCallOutputItem( checkRequired("id", id), - checkRequired("callId", callId), checkRequired("output", output), checkRequired("status", status), type, + callId, caller, createdBy, name, @@ -454,7 +452,6 @@ private constructor( } id() - callId() output().validate() status().validate() _type().let { @@ -462,6 +459,7 @@ private constructor( throw OpenAIInvalidDataException("'type' is invalid, received $it") } } + callId() caller().ifPresent { it.validate() } createdBy() name() @@ -485,10 +483,10 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (id.asKnown().isPresent) 1 else 0) + - (if (callId.asKnown().isPresent) 1 else 0) + (output.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + type.let { if (it == JsonValue.from("function_call_output")) 1 else 0 } + + (if (callId.asKnown().isPresent) 1 else 0) + (caller.asKnown().getOrNull()?.validity() ?: 0) + (if (createdBy.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + @@ -1582,10 +1580,10 @@ private constructor( return other is ResponseFunctionToolCallOutputItem && id == other.id && - callId == other.callId && output == other.output && status == other.status && type == other.type && + callId == other.callId && caller == other.caller && createdBy == other.createdBy && name == other.name && @@ -1596,10 +1594,10 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( id, - callId, output, status, type, + callId, caller, createdBy, name, @@ -1611,5 +1609,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ResponseFunctionToolCallOutputItem{id=$id, callId=$callId, output=$output, status=$status, type=$type, caller=$caller, createdBy=$createdBy, name=$name, namespace=$namespace, additionalProperties=$additionalProperties}" + "ResponseFunctionToolCallOutputItem{id=$id, output=$output, status=$status, type=$type, callId=$callId, caller=$caller, createdBy=$createdBy, name=$name, namespace=$namespace, additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputItem.kt index ea17d922d..1b30d84bc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputItem.kt @@ -3053,10 +3053,10 @@ private constructor( class FunctionCallOutput @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val callId: JsonField, private val output: JsonField, private val type: JsonValue, private val id: JsonField, + private val callId: JsonField, private val caller: JsonField, private val name: JsonField, private val namespace: JsonField, @@ -3066,25 +3066,17 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("call_id") @ExcludeMissing callId: JsonField = JsonMissing.of(), @JsonProperty("output") @ExcludeMissing output: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(), @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("call_id") @ExcludeMissing callId: JsonField = JsonMissing.of(), @JsonProperty("caller") @ExcludeMissing caller: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("namespace") @ExcludeMissing namespace: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), - ) : this(callId, output, type, id, caller, name, namespace, status, mutableMapOf()) - - /** - * The unique ID of the function tool call generated by the model. - * - * @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). - */ - fun callId(): String = callId.getRequired("call_id") + ) : this(output, type, id, callId, caller, name, namespace, status, mutableMapOf()) /** * Text, image, or file output of the function tool call. @@ -3116,6 +3108,14 @@ private constructor( */ fun id(): Optional = id.getOptional("id") + /** + * The unique ID of the function tool call generated by the model. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun callId(): Optional = callId.getOptional("call_id") + /** * The execution context that produced this tool call. * @@ -3149,13 +3149,6 @@ private constructor( */ fun status(): Optional = status.getOptional("status") - /** - * Returns the raw JSON value of [callId]. - * - * Unlike [callId], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("call_id") @ExcludeMissing fun _callId(): JsonField = callId - /** * Returns the raw JSON value of [output]. * @@ -3170,6 +3163,13 @@ private constructor( */ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + /** + * Returns the raw JSON value of [callId]. + * + * Unlike [callId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("call_id") @ExcludeMissing fun _callId(): JsonField = callId + /** * Returns the raw JSON value of [caller]. * @@ -3217,7 +3217,6 @@ private constructor( * * The following fields are required: * ```java - * .callId() * .output() * ``` */ @@ -3227,10 +3226,10 @@ private constructor( /** A builder for [FunctionCallOutput]. */ class Builder internal constructor() { - private var callId: JsonField? = null private var output: JsonField? = null private var type: JsonValue = JsonValue.from("function_call_output") private var id: JsonField = JsonMissing.of() + private var callId: JsonField = JsonMissing.of() private var caller: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var namespace: JsonField = JsonMissing.of() @@ -3239,10 +3238,10 @@ private constructor( @JvmSynthetic internal fun from(functionCallOutput: FunctionCallOutput) = apply { - callId = functionCallOutput.callId output = functionCallOutput.output type = functionCallOutput.type id = functionCallOutput.id + callId = functionCallOutput.callId caller = functionCallOutput.caller name = functionCallOutput.name namespace = functionCallOutput.namespace @@ -3250,18 +3249,6 @@ private constructor( additionalProperties = functionCallOutput.additionalProperties.toMutableMap() } - /** The unique ID of the function tool call generated by the model. */ - fun callId(callId: String) = callId(JsonField.of(callId)) - - /** - * Sets [Builder.callId] to an arbitrary JSON value. - * - * You should usually call [Builder.callId] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun callId(callId: JsonField) = apply { this.callId = callId } - /** Text, image, or file output of the function tool call. */ fun output(output: Output) = output(JsonField.of(output)) @@ -3328,6 +3315,21 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } + /** The unique ID of the function tool call generated by the model. */ + fun callId(callId: String?) = callId(JsonField.ofNullable(callId)) + + /** Alias for calling [Builder.callId] with `callId.orElse(null)`. */ + fun callId(callId: Optional) = callId(callId.getOrNull()) + + /** + * Sets [Builder.callId] to an arbitrary JSON value. + * + * You should usually call [Builder.callId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun callId(callId: JsonField) = apply { this.callId = callId } + /** The execution context that produced this tool call. */ fun caller(caller: Caller?) = caller(JsonField.ofNullable(caller)) @@ -3434,7 +3436,6 @@ private constructor( * * The following fields are required: * ```java - * .callId() * .output() * ``` * @@ -3442,10 +3443,10 @@ private constructor( */ fun build(): FunctionCallOutput = FunctionCallOutput( - checkRequired("callId", callId), checkRequired("output", output), type, id, + callId, caller, name, namespace, @@ -3470,7 +3471,6 @@ private constructor( return@apply } - callId() output().validate() _type().let { if (it != JsonValue.from("function_call_output")) { @@ -3478,6 +3478,7 @@ private constructor( } } id() + callId() caller().ifPresent { it.validate() } name() namespace() @@ -3501,10 +3502,10 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (callId.asKnown().isPresent) 1 else 0) + - (output.asKnown().getOrNull()?.validity() ?: 0) + + (output.asKnown().getOrNull()?.validity() ?: 0) + type.let { if (it == JsonValue.from("function_call_output")) 1 else 0 } + (if (id.asKnown().isPresent) 1 else 0) + + (if (callId.asKnown().isPresent) 1 else 0) + (caller.asKnown().getOrNull()?.validity() ?: 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (namespace.asKnown().isPresent) 1 else 0) + @@ -4355,10 +4356,10 @@ private constructor( } return other is FunctionCallOutput && - callId == other.callId && output == other.output && type == other.type && id == other.id && + callId == other.callId && caller == other.caller && name == other.name && namespace == other.namespace && @@ -4368,10 +4369,10 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( - callId, output, type, id, + callId, caller, name, namespace, @@ -4383,7 +4384,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "FunctionCallOutput{callId=$callId, output=$output, type=$type, id=$id, caller=$caller, name=$name, namespace=$namespace, status=$status, additionalProperties=$additionalProperties}" + "FunctionCallOutput{output=$output, type=$type, id=$id, callId=$callId, caller=$caller, name=$name, namespace=$namespace, status=$status, additionalProperties=$additionalProperties}" } class ToolSearchCall diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItemTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItemTest.kt index 7c0245bab..b9945daae 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItemTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItemTest.kt @@ -14,7 +14,6 @@ internal class BetaResponseFunctionToolCallOutputItemTest { val betaResponseFunctionToolCallOutputItem = BetaResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(BetaResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) .agent( @@ -22,6 +21,7 @@ internal class BetaResponseFunctionToolCallOutputItemTest { .agentName("agent_name") .build() ) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") @@ -29,7 +29,6 @@ internal class BetaResponseFunctionToolCallOutputItemTest { .build() assertThat(betaResponseFunctionToolCallOutputItem.id()).isEqualTo("id") - assertThat(betaResponseFunctionToolCallOutputItem.callId()).isEqualTo("call_id") assertThat(betaResponseFunctionToolCallOutputItem.output()) .isEqualTo(BetaResponseFunctionToolCallOutputItem.Output.ofString("string")) assertThat(betaResponseFunctionToolCallOutputItem.status()) @@ -40,6 +39,7 @@ internal class BetaResponseFunctionToolCallOutputItemTest { .agentName("agent_name") .build() ) + assertThat(betaResponseFunctionToolCallOutputItem.callId()).contains("call_id") assertThat(betaResponseFunctionToolCallOutputItem.caller()) .contains(BetaResponseFunctionToolCallOutputItem.Caller.ofDirect()) assertThat(betaResponseFunctionToolCallOutputItem.createdBy()).contains("created_by") @@ -53,7 +53,6 @@ internal class BetaResponseFunctionToolCallOutputItemTest { val betaResponseFunctionToolCallOutputItem = BetaResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(BetaResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) .agent( @@ -61,6 +60,7 @@ internal class BetaResponseFunctionToolCallOutputItemTest { .agentName("agent_name") .build() ) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputItemTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputItemTest.kt index adb46cf8b..75965d79f 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputItemTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputItemTest.kt @@ -817,7 +817,6 @@ internal class BetaResponseInputItemTest { fun ofFunctionCallOutput() { val functionCallOutput = BetaResponseInputItem.FunctionCallOutput.builder() - .callId("x") .output("string") .id("fc_123") .agent( @@ -825,6 +824,7 @@ internal class BetaResponseInputItemTest { .agentName("agent_name") .build() ) + .callId("x") .callerDirect() .name("x") .namespace("namespace") @@ -876,7 +876,6 @@ internal class BetaResponseInputItemTest { val betaResponseInputItem = BetaResponseInputItem.ofFunctionCallOutput( BetaResponseInputItem.FunctionCallOutput.builder() - .callId("x") .output("string") .id("fc_123") .agent( @@ -884,6 +883,7 @@ internal class BetaResponseInputItemTest { .agentName("agent_name") .build() ) + .callId("x") .callerDirect() .name("x") .namespace("namespace") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseItemTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseItemTest.kt index 68359b96e..0dd6cd652 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseItemTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseItemTest.kt @@ -726,7 +726,6 @@ internal class BetaResponseItemTest { val functionCallOutput = BetaResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(BetaResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) .agent( @@ -734,6 +733,7 @@ internal class BetaResponseItemTest { .agentName("agent_name") .build() ) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") @@ -783,7 +783,6 @@ internal class BetaResponseItemTest { BetaResponseItem.ofFunctionCallOutput( BetaResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(BetaResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) .agent( @@ -791,6 +790,7 @@ internal class BetaResponseItemTest { .agentName("agent_name") .build() ) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputItemTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputItemTest.kt index 38a65ad8a..43aed6412 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputItemTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputItemTest.kt @@ -316,7 +316,6 @@ internal class BetaResponseOutputItemTest { val functionCallOutput = BetaResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(BetaResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) .agent( @@ -324,6 +323,7 @@ internal class BetaResponseOutputItemTest { .agentName("agent_name") .build() ) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") @@ -372,7 +372,6 @@ internal class BetaResponseOutputItemTest { BetaResponseOutputItem.ofFunctionCallOutput( BetaResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(BetaResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) .agent( @@ -380,6 +379,7 @@ internal class BetaResponseOutputItemTest { .agentName("agent_name") .build() ) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/conversations/items/ConversationItemTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/conversations/items/ConversationItemTest.kt index b1a9d2b0a..19c00c240 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/conversations/items/ConversationItemTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/conversations/items/ConversationItemTest.kt @@ -196,9 +196,9 @@ internal class ConversationItemTest { val functionCallOutput = ResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(ResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") @@ -244,9 +244,9 @@ internal class ConversationItemTest { ConversationItem.ofFunctionCallOutput( ResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(ResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItemTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItemTest.kt index fc616fc5e..fea8bc31e 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItemTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItemTest.kt @@ -14,9 +14,9 @@ internal class ResponseFunctionToolCallOutputItemTest { val responseFunctionToolCallOutputItem = ResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(ResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") @@ -24,11 +24,11 @@ internal class ResponseFunctionToolCallOutputItemTest { .build() assertThat(responseFunctionToolCallOutputItem.id()).isEqualTo("id") - assertThat(responseFunctionToolCallOutputItem.callId()).isEqualTo("call_id") assertThat(responseFunctionToolCallOutputItem.output()) .isEqualTo(ResponseFunctionToolCallOutputItem.Output.ofString("string")) assertThat(responseFunctionToolCallOutputItem.status()) .isEqualTo(ResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) + assertThat(responseFunctionToolCallOutputItem.callId()).contains("call_id") assertThat(responseFunctionToolCallOutputItem.caller()) .contains(ResponseFunctionToolCallOutputItem.Caller.ofDirect()) assertThat(responseFunctionToolCallOutputItem.createdBy()).contains("created_by") @@ -42,9 +42,9 @@ internal class ResponseFunctionToolCallOutputItemTest { val responseFunctionToolCallOutputItem = ResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(ResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseInputItemTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseInputItemTest.kt index fc6f018a9..fca76ee4c 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseInputItemTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseInputItemTest.kt @@ -744,9 +744,9 @@ internal class ResponseInputItemTest { fun ofFunctionCallOutput() { val functionCallOutput = ResponseInputItem.FunctionCallOutput.builder() - .callId("x") .output("string") .id("fc_123") + .callId("x") .callerDirect() .name("x") .namespace("namespace") @@ -795,9 +795,9 @@ internal class ResponseInputItemTest { val responseInputItem = ResponseInputItem.ofFunctionCallOutput( ResponseInputItem.FunctionCallOutput.builder() - .callId("x") .output("string") .id("fc_123") + .callId("x") .callerDirect() .name("x") .namespace("namespace") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseItemTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseItemTest.kt index 5a352c4e5..46c1f9a48 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseItemTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseItemTest.kt @@ -660,9 +660,9 @@ internal class ResponseItemTest { val functionCallOutput = ResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(ResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") @@ -709,9 +709,9 @@ internal class ResponseItemTest { ResponseItem.ofFunctionCallOutput( ResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(ResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseOutputItemTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseOutputItemTest.kt index 3ad1f30cc..28d530409 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseOutputItemTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseOutputItemTest.kt @@ -291,9 +291,9 @@ internal class ResponseOutputItemTest { val functionCallOutput = ResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(ResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name") @@ -339,9 +339,9 @@ internal class ResponseOutputItemTest { ResponseOutputItem.ofFunctionCallOutput( ResponseFunctionToolCallOutputItem.builder() .id("id") - .callId("call_id") .output("string") .status(ResponseFunctionToolCallOutputItem.Status.IN_PROGRESS) + .callId("call_id") .callerDirect() .createdBy("created_by") .name("name")