diff --git a/.castiron.stats.yml b/.castiron.stats.yml index 854608b18..2885422fa 100644 --- a/.castiron.stats.yml +++ b/.castiron.stats.yml @@ -1,7 +1,7 @@ schema_version: 1 -generation_id: f129221a-b2b2-4a04-8fb5-bc9ae13a7385 -openapi_spec_hash: 172b67425fa2f92adad8d6ffac9968bd -openapi_transformed_spec_hash: 65ec527530a65399ed22f0a46cd03cd9 +generation_id: c7d28dc2-cc3d-47a3-9b98-f74f327d7d06 +openapi_spec_hash: c735bf35306196d3be264afacd380ef5 +openapi_transformed_spec_hash: 26fd6dfec1625525dae954f7de5f80c1 config_hash: 4e0613192a6ffb1791a25180a99a769c -codegen_sha: 924bd07d3d31b02eab58145f7aea65676e41a32e -codegen_hash: a82daaf0c7cbb8da5c442b1b5b85d86c5ebd1df1115786926274e8d148747111 +codegen_sha: 8a8a0ff64e79040ac5f29532ff061bdfa567764a +codegen_hash: b296d6e5af2a21ef64ed15e9b4984854ca700063db8490798bd25ebbf58e3b34 diff --git a/api_reference/openapi.transformed.yml b/api_reference/openapi.transformed.yml index 12bf6ad70..a7eb92394 100644 --- a/api_reference/openapi.transformed.yml +++ b/api_reference/openapi.transformed.yml @@ -84956,6 +84956,9 @@ components: compaction: $ref: '#/components/schemas/CompactionResource' description: The effective context compaction settings. + experimental: + $ref: '#/components/schemas/ExperimentalConfigResource' + description: The effective experimental settings for the agent. required: - model - reasoning @@ -86398,8 +86401,12 @@ components: - $ref: '#/components/schemas/CompactionParam' - type: 'null' description: Context compaction settings. Omit to keep the current settings. A supplied object replaces the settings; null or an empty object enables background compaction. + experimental: + $ref: '#/components/schemas/ExperimentalConfigOverridesParam' + default: {} + description: Experimental settings to merge by key. Omitted settings keep their current values. additionalProperties: false - description: Agent configuration for a session. Omitted fields inherit from `agent_id` when supplied. Supplied objects and arrays replace the whole field; null resets nullable fields. + description: Agent configuration for a session. Omitted fields inherit from `agent_id` when supplied. Supplied objects and arrays replace the whole field, except experimental settings, which merge by key. Null resets nullable fields. EnvironmentParamNone: type: object properties: @@ -89870,6 +89877,9 @@ components: compaction: $ref: '#/components/schemas/CompactionResource' description: The effective context compaction settings. + experimental: + $ref: '#/components/schemas/ExperimentalConfigResource' + description: The effective experimental settings for the agent. required: - id - object @@ -90329,6 +90339,11 @@ components: - $ref: '#/components/schemas/CompactionParam' - type: 'null' description: Context compaction settings. Omission or null enables background compaction. + experimental: + $ref: '#/components/schemas/ExperimentalConfigParam' + default: + time_awareness: false + description: Experimental agent settings. All experimental features default to disabled. required: - model additionalProperties: false @@ -90404,6 +90419,10 @@ components: - $ref: '#/components/schemas/CompactionParam' - type: 'null' description: Context compaction settings. Omit to keep the current settings. A supplied object replaces the settings; null or an empty object enables background compaction. + experimental: + $ref: '#/components/schemas/ExperimentalConfigOverridesParam' + default: {} + description: Experimental settings to merge by key. Omitted settings keep their current values. additionalProperties: false description: Fields to replace on an existing reusable agent. DeletedAgentResource: @@ -90989,6 +91008,9 @@ components: compaction: $ref: '#/components/schemas/CompactionResource' description: The effective context compaction settings. + experimental: + $ref: '#/components/schemas/ExperimentalConfigResource' + description: The effective experimental settings for the agent. required: - id - name @@ -111076,6 +111098,33 @@ components: type: string format: binary description: A transparent PNG overlaid on the first image to guide the edit. Must match that image's dimensions after orientation and contain transparent pixels. Supports GPT Image 2.5 and 2.6. Cannot be combined with mask. + ExperimentalConfigOverridesParam: + type: object + properties: + time_awareness: + type: boolean + description: Whether to give the model periodic current-time reminders. Omit to keep the current setting. + additionalProperties: false + description: Experimental settings to update. Omitted settings keep their current values. + ExperimentalConfigParam: + type: object + properties: + time_awareness: + type: boolean + default: false + description: Whether to give the model periodic current-time reminders. Defaults to false. + additionalProperties: false + description: Experimental agent settings. These features may change. + ExperimentalConfigResource: + type: object + properties: + time_awareness: + type: boolean + description: Whether the model receives periodic current-time reminders. + required: + - time_awareness + additionalProperties: false + description: The effective experimental settings for an agent. SessionSpendControlResource: type: object properties: diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/Agent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/Agent.kt index 93ef7dcef..db2bc084f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/Agent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/Agent.kt @@ -40,6 +40,7 @@ private constructor( private val tools: JsonField>, private val updatedAt: JsonField, private val compaction: JsonField, + private val experimental: JsonField, private val additionalProperties: MutableMap, ) { @@ -71,6 +72,9 @@ private constructor( @JsonProperty("compaction") @ExcludeMissing compaction: JsonField = JsonMissing.of(), + @JsonProperty("experimental") + @ExcludeMissing + experimental: JsonField = JsonMissing.of(), ) : this( id, createdAt, @@ -86,6 +90,7 @@ private constructor( tools, updatedAt, compaction, + experimental, mutableMapOf(), ) @@ -206,6 +211,14 @@ private constructor( */ fun compaction(): Optional = compaction.getOptional("compaction") + /** + * The effective experimental settings for the agent. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun experimental(): Optional = experimental.getOptional("experimental") + /** * Returns the raw JSON value of [id]. * @@ -307,6 +320,15 @@ private constructor( @ExcludeMissing fun _compaction(): JsonField = compaction + /** + * Returns the raw JSON value of [experimental]. + * + * Unlike [experimental], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("experimental") + @ExcludeMissing + fun _experimental(): JsonField = experimental + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -337,6 +359,7 @@ private constructor( "tools" to this.tools, "updated_at" to this.updatedAt, "compaction" to this.compaction, + "experimental" to this.experimental, ) /** @@ -392,6 +415,7 @@ private constructor( private var tools: JsonField>? = null private var updatedAt: JsonField? = null private var compaction: JsonField = JsonMissing.of() + private var experimental: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -410,6 +434,7 @@ private constructor( tools = agent.tools.map { it.toMutableList() } updatedAt = agent.updatedAt compaction = agent.compaction + experimental = agent.experimental additionalProperties = agent.additionalProperties.toMutableMap() } @@ -657,6 +682,20 @@ private constructor( */ fun compaction(compaction: JsonField) = apply { this.compaction = compaction } + /** The effective experimental settings for the agent. */ + fun experimental(experimental: Experimental) = experimental(JsonField.of(experimental)) + + /** + * Sets [Builder.experimental] to an arbitrary JSON value. + * + * You should usually call [Builder.experimental] with a well-typed [Experimental] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun experimental(experimental: JsonField) = apply { + this.experimental = experimental + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -713,6 +752,7 @@ private constructor( checkRequired("tools", tools).map { it.toImmutable() }, checkRequired("updatedAt", updatedAt), compaction, + experimental, additionalProperties.toMutableMap(), ) } @@ -750,6 +790,7 @@ private constructor( tools().forEach { it.validate() } updatedAt() compaction().ifPresent { it.validate() } + experimental().ifPresent { it.validate() } validated = true } @@ -781,7 +822,8 @@ private constructor( (text.asKnown().getOrNull()?.validity() ?: 0) + (tools.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (updatedAt.asKnown().isPresent) 1 else 0) + - (compaction.asKnown().getOrNull()?.validity() ?: 0) + (compaction.asKnown().getOrNull()?.validity() ?: 0) + + (experimental.asKnown().getOrNull()?.validity() ?: 0) /** Custom string key-value pairs attached to the agent. */ class Metadata @@ -1260,6 +1302,201 @@ private constructor( "Compaction{async=$async, additionalProperties=$additionalProperties}" } + /** The effective experimental settings for the agent. */ + class Experimental + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val timeAwareness: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("time_awareness") + @ExcludeMissing + timeAwareness: JsonField = JsonMissing.of() + ) : this(timeAwareness, mutableMapOf()) + + /** + * Whether the model receives periodic current-time reminders. + * + * @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 timeAwareness(): Boolean = timeAwareness.getRequired("time_awareness") + + /** + * Returns the raw JSON value of [timeAwareness]. + * + * Unlike [timeAwareness], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("time_awareness") + @ExcludeMissing + fun _timeAwareness(): JsonField = timeAwareness + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + /** + * Returns an immutable snapshot of all present JSON properties, including declared and + * additional properties. + * + * Keys use their JSON names. Declared properties take precedence over additional properties + * with the same name. Missing properties are omitted, while explicit nulls and unrecognized + * values are preserved. + */ + fun _allProperties(): Map = + collectAllProperties(additionalProperties, "time_awareness" to this.timeAwareness) + + /** + * Returns the legacy additional-properties view. + * + * @deprecated Use [_allProperties] to access both declared and additional JSON properties. + * This accessor retains its legacy additional-properties behavior. + */ + @Deprecated("Use _allProperties() to access both declared and additional JSON properties.") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Experimental]. + * + * The following fields are required: + * ```java + * .timeAwareness() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Experimental]. */ + class Builder internal constructor() { + + private var timeAwareness: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(experimental: Experimental) = apply { + timeAwareness = experimental.timeAwareness + additionalProperties = experimental.additionalProperties.toMutableMap() + } + + /** Whether the model receives periodic current-time reminders. */ + fun timeAwareness(timeAwareness: Boolean) = timeAwareness(JsonField.of(timeAwareness)) + + /** + * Sets [Builder.timeAwareness] to an arbitrary JSON value. + * + * You should usually call [Builder.timeAwareness] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun timeAwareness(timeAwareness: JsonField) = apply { + this.timeAwareness = timeAwareness + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Experimental]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .timeAwareness() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Experimental = + Experimental( + checkRequired("timeAwareness", timeAwareness), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenAIInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Experimental = apply { + if (validated) { + return@apply + } + + timeAwareness() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OpenAIInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = (if (timeAwareness.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Experimental && + timeAwareness == other.timeAwareness && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(timeAwareness, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Experimental{timeAwareness=$timeAwareness, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -1280,6 +1517,7 @@ private constructor( tools == other.tools && updatedAt == other.updatedAt && compaction == other.compaction && + experimental == other.experimental && additionalProperties == other.additionalProperties } @@ -1299,6 +1537,7 @@ private constructor( tools, updatedAt, compaction, + experimental, additionalProperties, ) } @@ -1306,5 +1545,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Agent{id=$id, createdAt=$createdAt, instructions=$instructions, metadata=$metadata, model=$model, multiAgent=$multiAgent, name=$name, object_=$object_, reasoning=$reasoning, serviceTier=$serviceTier, text=$text, tools=$tools, updatedAt=$updatedAt, compaction=$compaction, additionalProperties=$additionalProperties}" + "Agent{id=$id, createdAt=$createdAt, instructions=$instructions, metadata=$metadata, model=$model, multiAgent=$multiAgent, name=$name, object_=$object_, reasoning=$reasoning, serviceTier=$serviceTier, text=$text, tools=$tools, updatedAt=$updatedAt, compaction=$compaction, experimental=$experimental, additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentCreateParams.kt index d8f8dcac7..21a822414 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentCreateParams.kt @@ -51,6 +51,14 @@ private constructor( */ fun compaction(): Optional = body.compaction() + /** + * Experimental agent settings. All experimental features default to disabled. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun experimental(): Optional = body.experimental() + /** * Additional instructions appended to the agent's default base instructions. Omit or set to * null to add no custom instructions. @@ -133,6 +141,13 @@ private constructor( */ fun _compaction(): JsonField = body._compaction() + /** + * Returns the raw JSON value of [experimental]. + * + * Unlike [experimental], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _experimental(): JsonField = body._experimental() + /** * Returns the raw JSON value of [instructions]. * @@ -233,9 +248,9 @@ private constructor( * Otherwise, it's more convenient to use the top-level setters instead: * - [model] * - [compaction] + * - [experimental] * - [instructions] * - [metadata] - * - [multiAgent] * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -266,6 +281,20 @@ private constructor( */ fun compaction(compaction: JsonField) = apply { body.compaction(compaction) } + /** Experimental agent settings. All experimental features default to disabled. */ + fun experimental(experimental: Experimental) = apply { body.experimental(experimental) } + + /** + * Sets [Builder.experimental] to an arbitrary JSON value. + * + * You should usually call [Builder.experimental] with a well-typed [Experimental] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun experimental(experimental: JsonField) = apply { + body.experimental(experimental) + } + /** * Additional instructions appended to the agent's default base instructions. Omit or set to * null to add no custom instructions. @@ -595,6 +624,7 @@ private constructor( private constructor( private val model: JsonField, private val compaction: JsonField, + private val experimental: JsonField, private val instructions: JsonField, private val metadata: JsonField, private val multiAgent: JsonField, @@ -612,6 +642,9 @@ private constructor( @JsonProperty("compaction") @ExcludeMissing compaction: JsonField = JsonMissing.of(), + @JsonProperty("experimental") + @ExcludeMissing + experimental: JsonField = JsonMissing.of(), @JsonProperty("instructions") @ExcludeMissing instructions: JsonField = JsonMissing.of(), @@ -637,6 +670,7 @@ private constructor( ) : this( model, compaction, + experimental, instructions, metadata, multiAgent, @@ -664,6 +698,14 @@ private constructor( */ fun compaction(): Optional = compaction.getOptional("compaction") + /** + * Experimental agent settings. All experimental features default to disabled. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun experimental(): Optional = experimental.getOptional("experimental") + /** * Additional instructions appended to the agent's default base instructions. Omit or set to * null to add no custom instructions. @@ -748,6 +790,16 @@ private constructor( @ExcludeMissing fun _compaction(): JsonField = compaction + /** + * Returns the raw JSON value of [experimental]. + * + * Unlike [experimental], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("experimental") + @ExcludeMissing + fun _experimental(): JsonField = experimental + /** * Returns the raw JSON value of [instructions]. * @@ -833,6 +885,7 @@ private constructor( additionalProperties, "model" to this.model, "compaction" to this.compaction, + "experimental" to this.experimental, "instructions" to this.instructions, "metadata" to this.metadata, "multi_agent" to this.multiAgent, @@ -875,6 +928,7 @@ private constructor( private var model: JsonField? = null private var compaction: JsonField = JsonMissing.of() + private var experimental: JsonField = JsonMissing.of() private var instructions: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var multiAgent: JsonField = JsonMissing.of() @@ -889,6 +943,7 @@ private constructor( internal fun from(body: Body) = apply { model = body.model compaction = body.compaction + experimental = body.experimental instructions = body.instructions metadata = body.metadata multiAgent = body.multiAgent @@ -929,6 +984,20 @@ private constructor( this.compaction = compaction } + /** Experimental agent settings. All experimental features default to disabled. */ + fun experimental(experimental: Experimental) = experimental(JsonField.of(experimental)) + + /** + * Sets [Builder.experimental] to an arbitrary JSON value. + * + * You should usually call [Builder.experimental] with a well-typed [Experimental] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun experimental(experimental: JsonField) = apply { + this.experimental = experimental + } + /** * Additional instructions appended to the agent's default base instructions. Omit or * set to null to add no custom instructions. @@ -1162,6 +1231,7 @@ private constructor( Body( checkRequired("model", model), compaction, + experimental, instructions, metadata, multiAgent, @@ -1192,6 +1262,7 @@ private constructor( model() compaction().ifPresent { it.validate() } + experimental().ifPresent { it.validate() } instructions() metadata().ifPresent { it.validate() } multiAgent().ifPresent { it.validate() } @@ -1221,6 +1292,7 @@ private constructor( internal fun validity(): Int = (if (model.asKnown().isPresent) 1 else 0) + (compaction.asKnown().getOrNull()?.validity() ?: 0) + + (experimental.asKnown().getOrNull()?.validity() ?: 0) + (if (instructions.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (multiAgent.asKnown().getOrNull()?.validity() ?: 0) + @@ -1238,6 +1310,7 @@ private constructor( return other is Body && model == other.model && compaction == other.compaction && + experimental == other.experimental && instructions == other.instructions && metadata == other.metadata && multiAgent == other.multiAgent && @@ -1253,6 +1326,7 @@ private constructor( Objects.hash( model, compaction, + experimental, instructions, metadata, multiAgent, @@ -1268,7 +1342,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{model=$model, compaction=$compaction, instructions=$instructions, metadata=$metadata, multiAgent=$multiAgent, name=$name, reasoning=$reasoning, serviceTier=$serviceTier, text=$text, tools=$tools, additionalProperties=$additionalProperties}" + "Body{model=$model, compaction=$compaction, experimental=$experimental, instructions=$instructions, metadata=$metadata, multiAgent=$multiAgent, name=$name, reasoning=$reasoning, serviceTier=$serviceTier, text=$text, tools=$tools, additionalProperties=$additionalProperties}" } /** Context compaction settings. Omission or null enables background compaction. */ @@ -1454,6 +1528,184 @@ private constructor( "Compaction{async=$async, additionalProperties=$additionalProperties}" } + /** Experimental agent settings. All experimental features default to disabled. */ + class Experimental + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val timeAwareness: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("time_awareness") + @ExcludeMissing + timeAwareness: JsonField = JsonMissing.of() + ) : this(timeAwareness, mutableMapOf()) + + /** + * Whether to give the model periodic current-time reminders. Defaults to false. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun timeAwareness(): Optional = timeAwareness.getOptional("time_awareness") + + /** + * Returns the raw JSON value of [timeAwareness]. + * + * Unlike [timeAwareness], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("time_awareness") + @ExcludeMissing + fun _timeAwareness(): JsonField = timeAwareness + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + /** + * Returns an immutable snapshot of all present JSON properties, including declared and + * additional properties. + * + * Keys use their JSON names. Declared properties take precedence over additional properties + * with the same name. Missing properties are omitted, while explicit nulls and unrecognized + * values are preserved. + */ + fun _allProperties(): Map = + collectAllProperties(additionalProperties, "time_awareness" to this.timeAwareness) + + /** + * Returns the legacy additional-properties view. + * + * @deprecated Use [_allProperties] to access both declared and additional JSON properties. + * This accessor retains its legacy additional-properties behavior. + */ + @Deprecated("Use _allProperties() to access both declared and additional JSON properties.") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Experimental]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Experimental]. */ + class Builder internal constructor() { + + private var timeAwareness: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(experimental: Experimental) = apply { + timeAwareness = experimental.timeAwareness + additionalProperties = experimental.additionalProperties.toMutableMap() + } + + /** Whether to give the model periodic current-time reminders. Defaults to false. */ + fun timeAwareness(timeAwareness: Boolean) = timeAwareness(JsonField.of(timeAwareness)) + + /** + * Sets [Builder.timeAwareness] to an arbitrary JSON value. + * + * You should usually call [Builder.timeAwareness] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun timeAwareness(timeAwareness: JsonField) = apply { + this.timeAwareness = timeAwareness + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Experimental]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Experimental = + Experimental(timeAwareness, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenAIInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Experimental = apply { + if (validated) { + return@apply + } + + timeAwareness() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OpenAIInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = (if (timeAwareness.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Experimental && + timeAwareness == other.timeAwareness && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(timeAwareness, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Experimental{timeAwareness=$timeAwareness, additionalProperties=$additionalProperties}" + } + /** * Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. Omission * or null defaults to an empty map. diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSession.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSession.kt index fd1662e64..aa90f1a42 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSession.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSession.kt @@ -779,6 +779,7 @@ private constructor( private val text: JsonField, private val tools: JsonField>, private val compaction: JsonField, + private val experimental: JsonField, private val additionalProperties: MutableMap, ) { @@ -806,6 +807,9 @@ private constructor( @JsonProperty("compaction") @ExcludeMissing compaction: JsonField = JsonMissing.of(), + @JsonProperty("experimental") + @ExcludeMissing + experimental: JsonField = JsonMissing.of(), ) : this( id, instructions, @@ -817,6 +821,7 @@ private constructor( text, tools, compaction, + experimental, mutableMapOf(), ) @@ -901,6 +906,14 @@ private constructor( */ fun compaction(): Optional = compaction.getOptional("compaction") + /** + * The effective experimental settings for the agent. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun experimental(): Optional = experimental.getOptional("experimental") + /** * Returns the raw JSON value of [id]. * @@ -982,6 +995,16 @@ private constructor( @ExcludeMissing fun _compaction(): JsonField = compaction + /** + * Returns the raw JSON value of [experimental]. + * + * Unlike [experimental], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("experimental") + @ExcludeMissing + fun _experimental(): JsonField = experimental + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -1008,6 +1031,7 @@ private constructor( "text" to this.text, "tools" to this.tools, "compaction" to this.compaction, + "experimental" to this.experimental, ) /** @@ -1056,6 +1080,7 @@ private constructor( private var text: JsonField? = null private var tools: JsonField>? = null private var compaction: JsonField = JsonMissing.of() + private var experimental: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -1070,6 +1095,7 @@ private constructor( text = agent.text tools = agent.tools.map { it.toMutableList() } compaction = agent.compaction + experimental = agent.experimental additionalProperties = agent.additionalProperties.toMutableMap() } @@ -1275,6 +1301,20 @@ private constructor( this.compaction = compaction } + /** The effective experimental settings for the agent. */ + fun experimental(experimental: Experimental) = experimental(JsonField.of(experimental)) + + /** + * Sets [Builder.experimental] to an arbitrary JSON value. + * + * You should usually call [Builder.experimental] with a well-typed [Experimental] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun experimental(experimental: JsonField) = apply { + this.experimental = experimental + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1324,6 +1364,7 @@ private constructor( checkRequired("text", text), checkRequired("tools", tools).map { it.toImmutable() }, compaction, + experimental, additionalProperties.toMutableMap(), ) } @@ -1354,6 +1395,7 @@ private constructor( text().validate() tools().forEach { it.validate() } compaction().ifPresent { it.validate() } + experimental().ifPresent { it.validate() } validated = true } @@ -1382,7 +1424,8 @@ private constructor( (serviceTier.asKnown().getOrNull()?.validity() ?: 0) + (text.asKnown().getOrNull()?.validity() ?: 0) + (tools.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (compaction.asKnown().getOrNull()?.validity() ?: 0) + (compaction.asKnown().getOrNull()?.validity() ?: 0) + + (experimental.asKnown().getOrNull()?.validity() ?: 0) /** The effective service-tier policy for model requests. Defaults to `auto`. */ class ServiceTier @JsonCreator private constructor(private val value: JsonField) : @@ -1741,6 +1784,209 @@ private constructor( "Compaction{async=$async, additionalProperties=$additionalProperties}" } + /** The effective experimental settings for the agent. */ + class Experimental + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val timeAwareness: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("time_awareness") + @ExcludeMissing + timeAwareness: JsonField = JsonMissing.of() + ) : this(timeAwareness, mutableMapOf()) + + /** + * Whether the model receives periodic current-time reminders. + * + * @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 timeAwareness(): Boolean = timeAwareness.getRequired("time_awareness") + + /** + * Returns the raw JSON value of [timeAwareness]. + * + * Unlike [timeAwareness], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("time_awareness") + @ExcludeMissing + fun _timeAwareness(): JsonField = timeAwareness + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + /** + * Returns an immutable snapshot of all present JSON properties, including declared and + * additional properties. + * + * Keys use their JSON names. Declared properties take precedence over additional + * properties with the same name. Missing properties are omitted, while explicit nulls + * and unrecognized values are preserved. + */ + fun _allProperties(): Map = + collectAllProperties(additionalProperties, "time_awareness" to this.timeAwareness) + + /** + * Returns the legacy additional-properties view. + * + * @deprecated Use [_allProperties] to access both declared and additional JSON + * properties. This accessor retains its legacy additional-properties behavior. + */ + @Deprecated( + "Use _allProperties() to access both declared and additional JSON properties." + ) + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Experimental]. + * + * The following fields are required: + * ```java + * .timeAwareness() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Experimental]. */ + class Builder internal constructor() { + + private var timeAwareness: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(experimental: Experimental) = apply { + timeAwareness = experimental.timeAwareness + additionalProperties = experimental.additionalProperties.toMutableMap() + } + + /** Whether the model receives periodic current-time reminders. */ + fun timeAwareness(timeAwareness: Boolean) = + timeAwareness(JsonField.of(timeAwareness)) + + /** + * Sets [Builder.timeAwareness] to an arbitrary JSON value. + * + * You should usually call [Builder.timeAwareness] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun timeAwareness(timeAwareness: JsonField) = apply { + this.timeAwareness = timeAwareness + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Experimental]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .timeAwareness() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Experimental = + Experimental( + checkRequired("timeAwareness", timeAwareness), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenAIInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Experimental = apply { + if (validated) { + return@apply + } + + timeAwareness() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OpenAIInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = (if (timeAwareness.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Experimental && + timeAwareness == other.timeAwareness && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(timeAwareness, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Experimental{timeAwareness=$timeAwareness, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -1757,6 +2003,7 @@ private constructor( text == other.text && tools == other.tools && compaction == other.compaction && + experimental == other.experimental && additionalProperties == other.additionalProperties } @@ -1772,6 +2019,7 @@ private constructor( text, tools, compaction, + experimental, additionalProperties, ) } @@ -1779,7 +2027,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Agent{id=$id, instructions=$instructions, model=$model, multiAgent=$multiAgent, name=$name, reasoning=$reasoning, serviceTier=$serviceTier, text=$text, tools=$tools, compaction=$compaction, additionalProperties=$additionalProperties}" + "Agent{id=$id, instructions=$instructions, model=$model, multiAgent=$multiAgent, name=$name, reasoning=$reasoning, serviceTier=$serviceTier, text=$text, tools=$tools, compaction=$compaction, experimental=$experimental, additionalProperties=$additionalProperties}" } /** Custom string key-value pairs attached to the session. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentUpdateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentUpdateParams.kt index 3a6060501..1a9821657 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentUpdateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentUpdateParams.kt @@ -46,6 +46,14 @@ private constructor( */ fun compaction(): Optional = body.compaction() + /** + * Experimental settings to merge by key. Omitted settings keep their current values. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun experimental(): Optional = body.experimental() + /** * Additional instructions appended to the agent's default base instructions. Omit to leave * unchanged. @@ -129,6 +137,13 @@ private constructor( */ fun _compaction(): JsonField = body._compaction() + /** + * Returns the raw JSON value of [experimental]. + * + * Unlike [experimental], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _experimental(): JsonField = body._experimental() + /** * Returns the raw JSON value of [instructions]. * @@ -237,10 +252,10 @@ private constructor( * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: * - [compaction] + * - [experimental] * - [instructions] * - [metadata] * - [model] - * - [multiAgent] * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -263,6 +278,20 @@ private constructor( */ fun compaction(compaction: JsonField) = apply { body.compaction(compaction) } + /** Experimental settings to merge by key. Omitted settings keep their current values. */ + fun experimental(experimental: Experimental) = apply { body.experimental(experimental) } + + /** + * Sets [Builder.experimental] to an arbitrary JSON value. + * + * You should usually call [Builder.experimental] with a well-typed [Experimental] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun experimental(experimental: JsonField) = apply { + body.experimental(experimental) + } + /** * Additional instructions appended to the agent's default base instructions. Omit to leave * unchanged. @@ -602,6 +631,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val compaction: JsonField, + private val experimental: JsonField, private val instructions: JsonField, private val metadata: JsonField, private val model: JsonField, @@ -619,6 +649,9 @@ private constructor( @JsonProperty("compaction") @ExcludeMissing compaction: JsonField = JsonMissing.of(), + @JsonProperty("experimental") + @ExcludeMissing + experimental: JsonField = JsonMissing.of(), @JsonProperty("instructions") @ExcludeMissing instructions: JsonField = JsonMissing.of(), @@ -644,6 +677,7 @@ private constructor( tools: JsonField> = JsonMissing.of(), ) : this( compaction, + experimental, instructions, metadata, model, @@ -665,6 +699,14 @@ private constructor( */ fun compaction(): Optional = compaction.getOptional("compaction") + /** + * Experimental settings to merge by key. Omitted settings keep their current values. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun experimental(): Optional = experimental.getOptional("experimental") + /** * Additional instructions appended to the agent's default base instructions. Omit to leave * unchanged. @@ -750,6 +792,16 @@ private constructor( @ExcludeMissing fun _compaction(): JsonField = compaction + /** + * Returns the raw JSON value of [experimental]. + * + * Unlike [experimental], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("experimental") + @ExcludeMissing + fun _experimental(): JsonField = experimental + /** * Returns the raw JSON value of [instructions]. * @@ -841,6 +893,7 @@ private constructor( collectAllProperties( additionalProperties, "compaction" to this.compaction, + "experimental" to this.experimental, "instructions" to this.instructions, "metadata" to this.metadata, "model" to this.model, @@ -876,6 +929,7 @@ private constructor( class Builder internal constructor() { private var compaction: JsonField = JsonMissing.of() + private var experimental: JsonField = JsonMissing.of() private var instructions: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() @@ -890,6 +944,7 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { compaction = body.compaction + experimental = body.experimental instructions = body.instructions metadata = body.metadata model = body.model @@ -922,6 +977,22 @@ private constructor( this.compaction = compaction } + /** + * Experimental settings to merge by key. Omitted settings keep their current values. + */ + fun experimental(experimental: Experimental) = experimental(JsonField.of(experimental)) + + /** + * Sets [Builder.experimental] to an arbitrary JSON value. + * + * You should usually call [Builder.experimental] with a well-typed [Experimental] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun experimental(experimental: JsonField) = apply { + this.experimental = experimental + } + /** * Additional instructions appended to the agent's default base instructions. Omit to * leave unchanged. @@ -1157,6 +1228,7 @@ private constructor( fun build(): Body = Body( compaction, + experimental, instructions, metadata, model, @@ -1187,6 +1259,7 @@ private constructor( } compaction().ifPresent { it.validate() } + experimental().ifPresent { it.validate() } instructions() metadata().ifPresent { it.validate() } model() @@ -1216,6 +1289,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (compaction.asKnown().getOrNull()?.validity() ?: 0) + + (experimental.asKnown().getOrNull()?.validity() ?: 0) + (if (instructions.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (model.asKnown().isPresent) 1 else 0) + @@ -1233,6 +1307,7 @@ private constructor( return other is Body && compaction == other.compaction && + experimental == other.experimental && instructions == other.instructions && metadata == other.metadata && model == other.model && @@ -1248,6 +1323,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( compaction, + experimental, instructions, metadata, model, @@ -1264,7 +1340,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{compaction=$compaction, instructions=$instructions, metadata=$metadata, model=$model, multiAgent=$multiAgent, name=$name, reasoning=$reasoning, serviceTier=$serviceTier, text=$text, tools=$tools, additionalProperties=$additionalProperties}" + "Body{compaction=$compaction, experimental=$experimental, instructions=$instructions, metadata=$metadata, model=$model, multiAgent=$multiAgent, name=$name, reasoning=$reasoning, serviceTier=$serviceTier, text=$text, tools=$tools, additionalProperties=$additionalProperties}" } /** @@ -1453,6 +1529,188 @@ private constructor( "Compaction{async=$async, additionalProperties=$additionalProperties}" } + /** Experimental settings to merge by key. Omitted settings keep their current values. */ + class Experimental + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val timeAwareness: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("time_awareness") + @ExcludeMissing + timeAwareness: JsonField = JsonMissing.of() + ) : this(timeAwareness, mutableMapOf()) + + /** + * Whether to give the model periodic current-time reminders. Omit to keep the current + * setting. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun timeAwareness(): Optional = timeAwareness.getOptional("time_awareness") + + /** + * Returns the raw JSON value of [timeAwareness]. + * + * Unlike [timeAwareness], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("time_awareness") + @ExcludeMissing + fun _timeAwareness(): JsonField = timeAwareness + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + /** + * Returns an immutable snapshot of all present JSON properties, including declared and + * additional properties. + * + * Keys use their JSON names. Declared properties take precedence over additional properties + * with the same name. Missing properties are omitted, while explicit nulls and unrecognized + * values are preserved. + */ + fun _allProperties(): Map = + collectAllProperties(additionalProperties, "time_awareness" to this.timeAwareness) + + /** + * Returns the legacy additional-properties view. + * + * @deprecated Use [_allProperties] to access both declared and additional JSON properties. + * This accessor retains its legacy additional-properties behavior. + */ + @Deprecated("Use _allProperties() to access both declared and additional JSON properties.") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Experimental]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Experimental]. */ + class Builder internal constructor() { + + private var timeAwareness: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(experimental: Experimental) = apply { + timeAwareness = experimental.timeAwareness + additionalProperties = experimental.additionalProperties.toMutableMap() + } + + /** + * Whether to give the model periodic current-time reminders. Omit to keep the current + * setting. + */ + fun timeAwareness(timeAwareness: Boolean) = timeAwareness(JsonField.of(timeAwareness)) + + /** + * Sets [Builder.timeAwareness] to an arbitrary JSON value. + * + * You should usually call [Builder.timeAwareness] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun timeAwareness(timeAwareness: JsonField) = apply { + this.timeAwareness = timeAwareness + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Experimental]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Experimental = + Experimental(timeAwareness, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenAIInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Experimental = apply { + if (validated) { + return@apply + } + + timeAwareness() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OpenAIInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = (if (timeAwareness.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Experimental && + timeAwareness == other.timeAwareness && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(timeAwareness, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Experimental{timeAwareness=$timeAwareness, additionalProperties=$additionalProperties}" + } + /** * Replaces all metadata. Omit to leave unchanged, or pass null or {} to clear it. Up to 16 * string key-value pairs, with keys up to 64 and values up to 512 characters. diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/sessions/SessionCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/sessions/SessionCreateParams.kt index 76c8902c5..210fba182 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/sessions/SessionCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/sessions/SessionCreateParams.kt @@ -1050,6 +1050,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val compaction: JsonField, + private val experimental: JsonField, private val instructions: JsonField, private val model: JsonField, private val multiAgent: JsonField, @@ -1065,6 +1066,9 @@ private constructor( @JsonProperty("compaction") @ExcludeMissing compaction: JsonField = JsonMissing.of(), + @JsonProperty("experimental") + @ExcludeMissing + experimental: JsonField = JsonMissing.of(), @JsonProperty("instructions") @ExcludeMissing instructions: JsonField = JsonMissing.of(), @@ -1086,6 +1090,7 @@ private constructor( tools: JsonField> = JsonMissing.of(), ) : this( compaction, + experimental, instructions, model, multiAgent, @@ -1105,6 +1110,14 @@ private constructor( */ fun compaction(): Optional = compaction.getOptional("compaction") + /** + * Experimental settings to merge by key. Omitted settings keep their current values. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun experimental(): Optional = experimental.getOptional("experimental") + /** * Additional instructions appended to the agent's default base instructions. Omit to leave * unchanged. @@ -1173,6 +1186,16 @@ private constructor( @ExcludeMissing fun _compaction(): JsonField = compaction + /** + * Returns the raw JSON value of [experimental]. + * + * Unlike [experimental], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("experimental") + @ExcludeMissing + fun _experimental(): JsonField = experimental + /** * Returns the raw JSON value of [instructions]. * @@ -1248,6 +1271,7 @@ private constructor( collectAllProperties( additionalProperties, "compaction" to this.compaction, + "experimental" to this.experimental, "instructions" to this.instructions, "model" to this.model, "multi_agent" to this.multiAgent, @@ -1281,6 +1305,7 @@ private constructor( class Builder internal constructor() { private var compaction: JsonField = JsonMissing.of() + private var experimental: JsonField = JsonMissing.of() private var instructions: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var multiAgent: JsonField = JsonMissing.of() @@ -1293,6 +1318,7 @@ private constructor( @JvmSynthetic internal fun from(agent: Agent) = apply { compaction = agent.compaction + experimental = agent.experimental instructions = agent.instructions model = agent.model multiAgent = agent.multiAgent @@ -1323,6 +1349,22 @@ private constructor( this.compaction = compaction } + /** + * Experimental settings to merge by key. Omitted settings keep their current values. + */ + fun experimental(experimental: Experimental) = experimental(JsonField.of(experimental)) + + /** + * Sets [Builder.experimental] to an arbitrary JSON value. + * + * You should usually call [Builder.experimental] with a well-typed [Experimental] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun experimental(experimental: JsonField) = apply { + this.experimental = experimental + } + /** * Additional instructions appended to the agent's default base instructions. Omit to * leave unchanged. @@ -1519,6 +1561,7 @@ private constructor( fun build(): Agent = Agent( compaction, + experimental, instructions, model, multiAgent, @@ -1547,6 +1590,7 @@ private constructor( } compaction().ifPresent { it.validate() } + experimental().ifPresent { it.validate() } instructions() model() multiAgent().ifPresent { it.validate() } @@ -1574,6 +1618,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (compaction.asKnown().getOrNull()?.validity() ?: 0) + + (experimental.asKnown().getOrNull()?.validity() ?: 0) + (if (instructions.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (multiAgent.asKnown().getOrNull()?.validity() ?: 0) + @@ -1775,6 +1820,195 @@ private constructor( "Compaction{async=$async, additionalProperties=$additionalProperties}" } + /** Experimental settings to merge by key. Omitted settings keep their current values. */ + class Experimental + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val timeAwareness: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("time_awareness") + @ExcludeMissing + timeAwareness: JsonField = JsonMissing.of() + ) : this(timeAwareness, mutableMapOf()) + + /** + * Whether to give the model periodic current-time reminders. Omit to keep the current + * setting. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun timeAwareness(): Optional = timeAwareness.getOptional("time_awareness") + + /** + * Returns the raw JSON value of [timeAwareness]. + * + * Unlike [timeAwareness], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("time_awareness") + @ExcludeMissing + fun _timeAwareness(): JsonField = timeAwareness + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + /** + * Returns an immutable snapshot of all present JSON properties, including declared and + * additional properties. + * + * Keys use their JSON names. Declared properties take precedence over additional + * properties with the same name. Missing properties are omitted, while explicit nulls + * and unrecognized values are preserved. + */ + fun _allProperties(): Map = + collectAllProperties(additionalProperties, "time_awareness" to this.timeAwareness) + + /** + * Returns the legacy additional-properties view. + * + * @deprecated Use [_allProperties] to access both declared and additional JSON + * properties. This accessor retains its legacy additional-properties behavior. + */ + @Deprecated( + "Use _allProperties() to access both declared and additional JSON properties." + ) + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Experimental]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Experimental]. */ + class Builder internal constructor() { + + private var timeAwareness: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(experimental: Experimental) = apply { + timeAwareness = experimental.timeAwareness + additionalProperties = experimental.additionalProperties.toMutableMap() + } + + /** + * Whether to give the model periodic current-time reminders. Omit to keep the + * current setting. + */ + fun timeAwareness(timeAwareness: Boolean) = + timeAwareness(JsonField.of(timeAwareness)) + + /** + * Sets [Builder.timeAwareness] to an arbitrary JSON value. + * + * You should usually call [Builder.timeAwareness] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun timeAwareness(timeAwareness: JsonField) = apply { + this.timeAwareness = timeAwareness + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Experimental]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Experimental = + Experimental(timeAwareness, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenAIInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Experimental = apply { + if (validated) { + return@apply + } + + timeAwareness() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OpenAIInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = (if (timeAwareness.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Experimental && + timeAwareness == other.timeAwareness && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(timeAwareness, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Experimental{timeAwareness=$timeAwareness, additionalProperties=$additionalProperties}" + } + /** The service tier used for model requests. */ class ServiceTier @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -1966,6 +2200,7 @@ private constructor( return other is Agent && compaction == other.compaction && + experimental == other.experimental && instructions == other.instructions && model == other.model && multiAgent == other.multiAgent && @@ -1979,6 +2214,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( compaction, + experimental, instructions, model, multiAgent, @@ -1993,7 +2229,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Agent{compaction=$compaction, instructions=$instructions, model=$model, multiAgent=$multiAgent, reasoning=$reasoning, serviceTier=$serviceTier, text=$text, tools=$tools, additionalProperties=$additionalProperties}" + "Agent{compaction=$compaction, experimental=$experimental, instructions=$instructions, model=$model, multiAgent=$multiAgent, reasoning=$reasoning, serviceTier=$serviceTier, text=$text, tools=$tools, additionalProperties=$additionalProperties}" } /** diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentCreateParamsTest.kt index e6734dfdf..7163a5bf9 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentCreateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentCreateParamsTest.kt @@ -14,6 +14,7 @@ internal class AgentCreateParamsTest { AgentCreateParams.builder() .model("model") .compaction(AgentCreateParams.Compaction.builder().async(true).build()) + .experimental(AgentCreateParams.Experimental.builder().timeAwareness(true).build()) .instructions("instructions") .metadata( AgentCreateParams.Metadata.builder() @@ -58,6 +59,7 @@ internal class AgentCreateParamsTest { AgentCreateParams.builder() .model("model") .compaction(AgentCreateParams.Compaction.builder().async(true).build()) + .experimental(AgentCreateParams.Experimental.builder().timeAwareness(true).build()) .instructions("instructions") .metadata( AgentCreateParams.Metadata.builder() @@ -100,6 +102,8 @@ internal class AgentCreateParamsTest { assertThat(body.model()).isEqualTo("model") assertThat(body.compaction()) .contains(AgentCreateParams.Compaction.builder().async(true).build()) + assertThat(body.experimental()) + .contains(AgentCreateParams.Experimental.builder().timeAwareness(true).build()) assertThat(body.instructions()).contains("instructions") assertThat(body.metadata()) .contains( diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentListPageResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentListPageResponseTest.kt index 2df0de02f..a4a566b5e 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentListPageResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentListPageResponseTest.kt @@ -59,6 +59,7 @@ internal class AgentListPageResponseTest { ) .updatedAt(0L) .compaction(Agent.Compaction.builder().async(true).build()) + .experimental(Agent.Experimental.builder().timeAwareness(true).build()) .build() ) .firstId("first_id") @@ -106,6 +107,7 @@ internal class AgentListPageResponseTest { ) .updatedAt(0L) .compaction(Agent.Compaction.builder().async(true).build()) + .experimental(Agent.Experimental.builder().timeAwareness(true).build()) .build() ) assertThat(agentListPageResponse.firstId()).contains("first_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionCreatedEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionCreatedEventTest.kt index 15d7c1793..fcf90d717 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionCreatedEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionCreatedEventTest.kt @@ -58,6 +58,11 @@ internal class AgentSessionCreatedEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -173,6 +178,11 @@ internal class AgentSessionCreatedEventTest { .build() ) .compaction(AgentSession.Agent.Compaction.builder().async(true).build()) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionEventTest.kt index 3aa50d384..1a98315c9 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionEventTest.kt @@ -575,6 +575,11 @@ internal class AgentSessionEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -737,6 +742,11 @@ internal class AgentSessionEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -1724,6 +1734,11 @@ internal class AgentSessionEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -1886,6 +1901,11 @@ internal class AgentSessionEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -2021,6 +2041,11 @@ internal class AgentSessionEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -2183,6 +2208,11 @@ internal class AgentSessionEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -2318,6 +2348,11 @@ internal class AgentSessionEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -2480,6 +2515,11 @@ internal class AgentSessionEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -2615,6 +2655,11 @@ internal class AgentSessionEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -2777,6 +2822,11 @@ internal class AgentSessionEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionFailedEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionFailedEventTest.kt index ba192bda0..e17a52ecb 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionFailedEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionFailedEventTest.kt @@ -58,6 +58,11 @@ internal class AgentSessionFailedEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -173,6 +178,11 @@ internal class AgentSessionFailedEventTest { .build() ) .compaction(AgentSession.Agent.Compaction.builder().async(true).build()) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionIdleEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionIdleEventTest.kt index 9b51f1b25..aa61bf507 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionIdleEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionIdleEventTest.kt @@ -58,6 +58,11 @@ internal class AgentSessionIdleEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -173,6 +178,11 @@ internal class AgentSessionIdleEventTest { .build() ) .compaction(AgentSession.Agent.Compaction.builder().async(true).build()) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionInProgressEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionInProgressEventTest.kt index a32651b2b..f82476f08 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionInProgressEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionInProgressEventTest.kt @@ -58,6 +58,11 @@ internal class AgentSessionInProgressEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -173,6 +178,11 @@ internal class AgentSessionInProgressEventTest { .build() ) .compaction(AgentSession.Agent.Compaction.builder().async(true).build()) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionRequiresActionEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionRequiresActionEventTest.kt index 255654454..d8726573b 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionRequiresActionEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionRequiresActionEventTest.kt @@ -58,6 +58,11 @@ internal class AgentSessionRequiresActionEventTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -173,6 +178,11 @@ internal class AgentSessionRequiresActionEventTest { .build() ) .compaction(AgentSession.Agent.Compaction.builder().async(true).build()) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionTest.kt index 4f20cc2b8..3a7410d29 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionTest.kt @@ -53,6 +53,9 @@ internal class AgentSessionTest { .build() ) .compaction(AgentSession.Agent.Compaction.builder().async(true).build()) + .experimental( + AgentSession.Agent.Experimental.builder().timeAwareness(true).build() + ) .build() ) .createdAt(0L) @@ -151,6 +154,9 @@ internal class AgentSessionTest { .build() ) .compaction(AgentSession.Agent.Compaction.builder().async(true).build()) + .experimental( + AgentSession.Agent.Experimental.builder().timeAwareness(true).build() + ) .build() ) assertThat(agentSession.createdAt()).isEqualTo(0L) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentTest.kt index cd94a4bf2..d3226c122 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentTest.kt @@ -49,6 +49,7 @@ internal class AgentTest { ) .updatedAt(0L) .compaction(Agent.Compaction.builder().async(true).build()) + .experimental(Agent.Experimental.builder().timeAwareness(true).build()) .build() assertThat(agent.id()).isEqualTo("id") @@ -91,6 +92,8 @@ internal class AgentTest { ) assertThat(agent.updatedAt()).isEqualTo(0L) assertThat(agent.compaction()).contains(Agent.Compaction.builder().async(true).build()) + assertThat(agent.experimental()) + .contains(Agent.Experimental.builder().timeAwareness(true).build()) val jsonMapper = jsonMapper() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentUpdateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentUpdateParamsTest.kt index 46c730c76..04283b768 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentUpdateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentUpdateParamsTest.kt @@ -14,6 +14,7 @@ internal class AgentUpdateParamsTest { AgentUpdateParams.builder() .agentId("agent_id") .compaction(AgentUpdateParams.Compaction.builder().async(true).build()) + .experimental(AgentUpdateParams.Experimental.builder().timeAwareness(true).build()) .instructions("instructions") .metadata( AgentUpdateParams.Metadata.builder() @@ -68,6 +69,7 @@ internal class AgentUpdateParamsTest { AgentUpdateParams.builder() .agentId("agent_id") .compaction(AgentUpdateParams.Compaction.builder().async(true).build()) + .experimental(AgentUpdateParams.Experimental.builder().timeAwareness(true).build()) .instructions("instructions") .metadata( AgentUpdateParams.Metadata.builder() @@ -110,6 +112,8 @@ internal class AgentUpdateParamsTest { assertThat(body.compaction()) .contains(AgentUpdateParams.Compaction.builder().async(true).build()) + assertThat(body.experimental()) + .contains(AgentUpdateParams.Experimental.builder().timeAwareness(true).build()) assertThat(body.instructions()).contains("instructions") assertThat(body.metadata()) .contains( diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionCreateParamsTest.kt index 6adc0bff2..a782f1ca2 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionCreateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionCreateParamsTest.kt @@ -21,6 +21,9 @@ internal class SessionCreateParamsTest { .agent( SessionCreateParams.Agent.builder() .compaction(SessionCreateParams.Agent.Compaction.builder().async(true).build()) + .experimental( + SessionCreateParams.Agent.Experimental.builder().timeAwareness(true).build() + ) .instructions("instructions") .model("model") .multiAgent( @@ -78,6 +81,11 @@ internal class SessionCreateParamsTest { .compaction( SessionCreateParams.Agent.Compaction.builder().async(true).build() ) + .experimental( + SessionCreateParams.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .instructions("instructions") .model("model") .multiAgent( @@ -131,6 +139,9 @@ internal class SessionCreateParamsTest { .contains( SessionCreateParams.Agent.builder() .compaction(SessionCreateParams.Agent.Compaction.builder().async(true).build()) + .experimental( + SessionCreateParams.Agent.Experimental.builder().timeAwareness(true).build() + ) .instructions("instructions") .model("model") .multiAgent( diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionListPageResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionListPageResponseTest.kt index df289d78c..fc83fec33 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionListPageResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionListPageResponseTest.kt @@ -63,6 +63,11 @@ internal class SessionListPageResponseTest { .compaction( AgentSession.Agent.Compaction.builder().async(true).build() ) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) @@ -180,6 +185,11 @@ internal class SessionListPageResponseTest { .build() ) .compaction(AgentSession.Agent.Compaction.builder().async(true).build()) + .experimental( + AgentSession.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .build() ) .createdAt(0L) diff --git a/openai-java-core/src/test/kotlin/com/openai/services/async/beta/AgentServiceAsyncTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/async/beta/AgentServiceAsyncTest.kt index b16351d3b..75f4cf902 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/async/beta/AgentServiceAsyncTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/async/beta/AgentServiceAsyncTest.kt @@ -32,6 +32,9 @@ internal class AgentServiceAsyncTest { AgentCreateParams.builder() .model("model") .compaction(AgentCreateParams.Compaction.builder().async(true).build()) + .experimental( + AgentCreateParams.Experimental.builder().timeAwareness(true).build() + ) .instructions("instructions") .metadata( AgentCreateParams.Metadata.builder() @@ -108,6 +111,9 @@ internal class AgentServiceAsyncTest { AgentUpdateParams.builder() .agentId("agent_id") .compaction(AgentUpdateParams.Compaction.builder().async(true).build()) + .experimental( + AgentUpdateParams.Experimental.builder().timeAwareness(true).build() + ) .instructions("instructions") .metadata( AgentUpdateParams.Metadata.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/services/async/beta/agents/SessionServiceAsyncTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/async/beta/agents/SessionServiceAsyncTest.kt index f7bbdbad9..2b853c79d 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/async/beta/agents/SessionServiceAsyncTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/async/beta/agents/SessionServiceAsyncTest.kt @@ -36,6 +36,11 @@ internal class SessionServiceAsyncTest { .compaction( SessionCreateParams.Agent.Compaction.builder().async(true).build() ) + .experimental( + SessionCreateParams.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .instructions("instructions") .model("model") .multiAgent( diff --git a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/AgentServiceTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/AgentServiceTest.kt index 99cdb7dd5..e3d5ae00b 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/AgentServiceTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/AgentServiceTest.kt @@ -32,6 +32,9 @@ internal class AgentServiceTest { AgentCreateParams.builder() .model("model") .compaction(AgentCreateParams.Compaction.builder().async(true).build()) + .experimental( + AgentCreateParams.Experimental.builder().timeAwareness(true).build() + ) .instructions("instructions") .metadata( AgentCreateParams.Metadata.builder() @@ -106,6 +109,9 @@ internal class AgentServiceTest { AgentUpdateParams.builder() .agentId("agent_id") .compaction(AgentUpdateParams.Compaction.builder().async(true).build()) + .experimental( + AgentUpdateParams.Experimental.builder().timeAwareness(true).build() + ) .instructions("instructions") .metadata( AgentUpdateParams.Metadata.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/agents/SessionServiceTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/agents/SessionServiceTest.kt index 7245320b6..b58f6ed43 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/agents/SessionServiceTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/agents/SessionServiceTest.kt @@ -36,6 +36,11 @@ internal class SessionServiceTest { .compaction( SessionCreateParams.Agent.Compaction.builder().async(true).build() ) + .experimental( + SessionCreateParams.Agent.Experimental.builder() + .timeAwareness(true) + .build() + ) .instructions("instructions") .model("model") .multiAgent( diff --git a/scripts/castiron/generated-files.json b/scripts/castiron/generated-files.json index 4838681e7..6f6c1a215 100644 --- a/scripts/castiron/generated-files.json +++ b/scripts/castiron/generated-files.json @@ -1523,7 +1523,7 @@ }, "openai-java-core/src/main/kotlin/com/openai/models/beta/agents/Agent.kt": { "mode": "100644", - "sha256": "424a48d4b3e1c86ac53686be61ab72235d21c505e38f471ada09beb9fc1a560c" + "sha256": "b989e3dfe7c9a924c8c7f2676435c3d8ac861f1af2048727df2b4f351d729c21" }, "openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentBrowserAuthenticationCancelParam.kt": { "mode": "100644", @@ -1551,7 +1551,7 @@ }, "openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentCreateParams.kt": { "mode": "100644", - "sha256": "98108bb36f0f5e889d63af7da384ce1f68f94339f2126bcf4ec80abe86b0d923" + "sha256": "8da557d455241f2d552401dbb01579fd3f3c6f0eae24485a28072b6f1f498d73" }, "openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentCreateSubagentCallItem.kt": { "mode": "100644", @@ -1643,7 +1643,7 @@ }, "openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSession.kt": { "mode": "100644", - "sha256": "053c992d0ff89267e4f725b41b8a48c84b4e0fca9fba9950229747e05c089959" + "sha256": "bb3bf228b0872b60533160ed966768ff1bca899f9d5505d8f52ac16275c6e62d" }, "openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionAssistantMessage.kt": { "mode": "100644", @@ -1827,7 +1827,7 @@ }, "openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentUpdateParams.kt": { "mode": "100644", - "sha256": "823d7846281f0293157dbec5d914cc27109dab4b85b2de06ff0377a92dba9c6c" + "sha256": "1d9ba691a30301a341826fe313c72929bca81b4a1a1f6255ba72d02a9d727fb4" }, "openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentWaitForSubagentsCallItem.kt": { "mode": "100644", @@ -2055,7 +2055,7 @@ }, "openai-java-core/src/main/kotlin/com/openai/models/beta/agents/sessions/SessionCreateParams.kt": { "mode": "100644", - "sha256": "fce7d31923359a988e04b5ce1b6ee84ca6f2c589b911d9227034c2644f95f085" + "sha256": "54ef4dd47b18f546f9990554b3858fa0006054f72d56b38c1106bee364009186" }, "openai-java-core/src/main/kotlin/com/openai/models/beta/agents/sessions/SessionDeleteParams.kt": { "mode": "100644", @@ -9951,7 +9951,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentCreateParamsTest.kt": { "mode": "100644", - "sha256": "4baba922ce7e297b437df1afd017303fa415c4391815017e1c0555f150fb0734" + "sha256": "968c410247fe3b7334d6baecf8af955434d74854b40e29acb2761f0c5b37e375" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentCreateSubagentCallItemTest.kt": { "mode": "100644", @@ -9983,7 +9983,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentListPageResponseTest.kt": { "mode": "100644", - "sha256": "5cfd6778fed758997ccdc2bfbbdb11bd54e1f75f06102dd8228e15d221a641b8" + "sha256": "b0c36a8574be52da030c9ff3fee1f536ef43ceb129758196e15ee50ae6cb5296" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentListParamsTest.kt": { "mode": "100644", @@ -10031,7 +10031,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionCreatedEventTest.kt": { "mode": "100644", - "sha256": "43673dadfcfd1d353b8a6805d173049c452f3dfa3cd29f641f6f37ef9df9c727" + "sha256": "241ce8d601fb4225d22ffc27132f783f2310203d80b4621d3a278987b4a24aa9" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionDeletedTest.kt": { "mode": "100644", @@ -10079,19 +10079,19 @@ }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionEventTest.kt": { "mode": "100644", - "sha256": "4ff3baf22cc7dacb456663df1696264a325bed4c631e79d8e4d399d0da4405d5" + "sha256": "c7b4f396868502a8949ae1ca34829546569126a5d49c6e6e0546ad2dee1549e3" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionFailedEventTest.kt": { "mode": "100644", - "sha256": "aa3d5d1652b8d32992564e51fba28dede489e45870a23f9c428a2cd689ea4844" + "sha256": "b2178cb12f6b3a5033dd8db48f27f12dce115d741ceec9a55e739a70eb0d1547" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionIdleEventTest.kt": { "mode": "100644", - "sha256": "54297a0f81dcc7312e1adaa120c8e4ddeed84d85926f91c408fc1413fe0ffbb2" + "sha256": "36285545b9912ced9b47d7ae214ba025cd7c7209a59f6d4e21f6432271cf17ce" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionInProgressEventTest.kt": { "mode": "100644", - "sha256": "1d51a4c491d73fbd608da41b35737338358128e4489f9189732b917eb710c638" + "sha256": "6e161b49befe8cca084b3f01a1d686244ee9d4dbbf20333bf74953ffe17d0b7d" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionInputMessageParamTest.kt": { "mode": "100644", @@ -10115,7 +10115,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionRequiresActionEventTest.kt": { "mode": "100644", - "sha256": "e28be7618868bbb1f59e8ffbfe2da4073fff0104cda7f3137d4c2b6d1e1ab832" + "sha256": "09161baf68e27f1e1f23a39d6a7e705dafc2bfac8d5a7989e6e66949b3c570bf" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionSubagentActiveEventTest.kt": { "mode": "100644", @@ -10131,7 +10131,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionTest.kt": { "mode": "100644", - "sha256": "8853aac1ed42e6fb674510cd6abd4a526ff95961a9daf28203cdb515ecd84bda" + "sha256": "d6175862ce0c92bf9b0a6ae68225846e828d57b817cdfbf2ca3eb6d316e6c68a" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentSessionTurnCancelledEventTest.kt": { "mode": "100644", @@ -10195,7 +10195,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentTest.kt": { "mode": "100644", - "sha256": "23a380915628f8c2133b22a9c6cc1f8f300850d5e15e340132cc530792cadd09" + "sha256": "8c546b900b26a3c38e833f16913e85df4e3b8327b87f03939147383c7a10fd4f" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentTextParamTest.kt": { "mode": "100644", @@ -10215,7 +10215,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentUpdateParamsTest.kt": { "mode": "100644", - "sha256": "bd62a8f2c15f34e39b77213ef6b83e99862e845e53833fa9c7cb8b23c7641972" + "sha256": "c6429e226a49a05f1bee76e04f511dea33cf372584c203b3b24c4911916e9ee6" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/AgentWaitForSubagentsCallItemTest.kt": { "mode": "100644", @@ -10419,7 +10419,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionCreateParamsTest.kt": { "mode": "100644", - "sha256": "cd6e66ad714ea046123deb8d26865f69a3bb21fd3de8c63ea4503a486fd6e2b8" + "sha256": "e386ef9a588098498c7cc3ac95c1f52fe5c0dff5ba3bbdb223a211d0f692cc75" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionDeleteParamsTest.kt": { "mode": "100644", @@ -10427,7 +10427,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionListPageResponseTest.kt": { "mode": "100644", - "sha256": "23980fccea6777ae7b83bdea417a1395b82c7a23d29f4ea285f36aa3da049a59" + "sha256": "4e10ec34b137915c78836cec01f99cdf4a44c26da539d209fd22e05e9ce6e2dd" }, "openai-java-core/src/test/kotlin/com/openai/models/beta/agents/sessions/SessionListParamsTest.kt": { "mode": "100644", @@ -14951,7 +14951,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/services/async/beta/AgentServiceAsyncTest.kt": { "mode": "100644", - "sha256": "fbefe734d272a1f92fb22a0718edbf4f90729547a2d526b02d01f74d99655496" + "sha256": "37178e6532865ff6c2201fb9b4cef2fc618514711770881a28ceeeb1e9fda5dd" }, "openai-java-core/src/test/kotlin/com/openai/services/async/beta/AssistantServiceAsyncPaginationContractTest.kt": { "mode": "100644", @@ -14991,7 +14991,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/services/async/beta/agents/SessionServiceAsyncTest.kt": { "mode": "100644", - "sha256": "5e5e84be2d0ff61acae38bcf66746626a01921987563bb8a07c4f7c094f83219" + "sha256": "f1b2949d2c32e6823826573051123904634cf20ecd1283d6c516b397469ebbfe" }, "openai-java-core/src/test/kotlin/com/openai/services/async/beta/agents/VaultServiceAsyncPaginationContractTest.kt": { "mode": "100644", @@ -15691,7 +15691,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/AgentServiceTest.kt": { "mode": "100644", - "sha256": "1efdbac8c6e1be27fcdbe469ef78e3880195ff8c6da0ffb4500eedfcaee73ab9" + "sha256": "8c0b23b0c66da392d3816308feb54951851cb69836ecaf6878074f9beb4afdc4" }, "openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/AssistantServicePaginationContractTest.kt": { "mode": "100644", @@ -15731,7 +15731,7 @@ }, "openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/agents/SessionServiceTest.kt": { "mode": "100644", - "sha256": "b2bed9250a716bf9954788699957389b2fda16daa568dcd851743093f99b0943" + "sha256": "c3caa6976cea543df65b8553710fd706c51b5740fd09157f708bfc3f3a5af4ad" }, "openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/agents/VaultServicePaginationContractTest.kt": { "mode": "100644",