Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .castiron.stats.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schema_version: 1
generation_id: 401d7482-7c7f-4c92-a59c-86de09aa73bf
openapi_spec_hash: 9df7f85b20baf5d88e09d7c74b43a6e4
openapi_transformed_spec_hash: d5b0444430e15ca702a77f0855c44187
generation_id: 32fd93d9-29d7-4c70-8eba-c9caca0df449
openapi_spec_hash: ac56c14f50f95ac18f62a859b81390d0
openapi_transformed_spec_hash: 7ea9d7bdfdc1eaaf8bed0fca5844cdb3
config_hash: ba891e1481bb52b190c89120be41b261
codegen_sha: 9adae1e563e3d1ca53e867ae165c4013ee30cf35
codegen_hash: c0c76a263af5584c0d757ba67b0858e448ad628792faac5bd830636ebb5112a4
codegen_sha: 4c622a72b140f6757ddab29c7165941bf8a9de0f
codegen_hash: 9d12d1acabd7e245cfee13fbc2bd87ab967d9ef9fee49c1f507d10dc561f9988
13 changes: 12 additions & 1 deletion api_reference/openapi.transformed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34189,7 +34189,7 @@ paths:
post:
operationId: updateAgentSession
summary: Update an agent session
description: Updates session tools, metadata, model, reasoning effort, service tier, or the default prompt cache lifetime. Model settings apply to subsequent turns. Omitted fields are unchanged. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
description: Updates session tools, vaults, metadata, model, reasoning effort, service tier, or the default prompt cache lifetime. Model settings apply to subsequent turns. Omitted fields are unchanged. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
tags:
- Agents
parameters:
Expand Down Expand Up @@ -95539,6 +95539,17 @@ components:
minProperties: 0
maxProperties: 16
description: 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.
vault_ids:
type:
- array
- 'null'
items:
type: string
minLength: 0
maxLength: 1048576
minItems: 0
maxItems: 16384
description: Replaces the session's referenced vaults. Omit to retain them; null or [] clears them.
additionalProperties: false
description: Fields to update on an existing session.
DeletedSessionResource:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull

/**
* Updates session tools, metadata, model, reasoning effort, service tier, or the default prompt
* cache lifetime. Model settings apply to subsequent turns. Omitted fields are unchanged. See
* Updates session tools, vaults, metadata, model, reasoning effort, service tier, or the default
* prompt cache lifetime. Model settings apply to subsequent turns. Omitted fields are unchanged.
* See
* [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
*/
class SessionUpdateParams
Expand Down Expand Up @@ -82,6 +83,14 @@ private constructor(
*/
fun spendControl(): Optional<SpendControl> = body.spendControl()

/**
* Replaces the session's referenced vaults. Omit to retain them; null or [] clears them.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun vaultIds(): Optional<List<String>> = body.vaultIds()

/**
* Returns the raw JSON value of [agent].
*
Expand Down Expand Up @@ -118,6 +127,13 @@ private constructor(
*/
fun _spendControl(): JsonField<SpendControl> = body._spendControl()

/**
* Returns the raw JSON value of [vaultIds].
*
* Unlike [vaultIds], this method doesn't throw if the JSON field has an unexpected type.
*/
fun _vaultIds(): JsonField<List<String>> = body._vaultIds()

fun _additionalBodyProperties(): Map<String, JsonValue> = body._additionalProperties()

/** Additional headers to send with the request. */
Expand Down Expand Up @@ -256,6 +272,30 @@ private constructor(
body.spendControl(spendControl)
}

/**
* Replaces the session's referenced vaults. Omit to retain them; null or [] clears them.
*/
fun vaultIds(vaultIds: List<String>?) = apply { body.vaultIds(vaultIds) }

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

/**
* Sets [Builder.vaultIds] to an arbitrary JSON value.
*
* You should usually call [Builder.vaultIds] with a well-typed `List<String>` value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
fun vaultIds(vaultIds: JsonField<List<String>>) = apply { body.vaultIds(vaultIds) }

/**
* Adds a single [String] to [vaultIds].
*
* @throws IllegalStateException if the field was previously set to a non-list.
*/
fun addVaultId(vaultId: String) = apply { body.addVaultId(vaultId) }

fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply {
body.additionalProperties(additionalBodyProperties)
}
Expand Down Expand Up @@ -408,6 +448,7 @@ private constructor(
private val promptCacheOptions: JsonField<PromptCacheOptions>,
private val review: JsonField<Review>,
private val spendControl: JsonField<SpendControl>,
private val vaultIds: JsonField<List<String>>,
private val additionalProperties: MutableMap<String, JsonValue>,
) {

Expand All @@ -424,7 +465,18 @@ private constructor(
@JsonProperty("spend_control")
@ExcludeMissing
spendControl: JsonField<SpendControl> = JsonMissing.of(),
) : this(agent, metadata, promptCacheOptions, review, spendControl, mutableMapOf())
@JsonProperty("vault_ids")
@ExcludeMissing
vaultIds: JsonField<List<String>> = JsonMissing.of(),
) : this(
agent,
metadata,
promptCacheOptions,
review,
spendControl,
vaultIds,
mutableMapOf(),
)

/**
* Agent settings to update on this session. Omitted fields stay unchanged.
Expand Down Expand Up @@ -469,6 +521,14 @@ private constructor(
*/
fun spendControl(): Optional<SpendControl> = spendControl.getOptional("spend_control")

/**
* Replaces the session's referenced vaults. Omit to retain them; null or [] clears them.
*
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun vaultIds(): Optional<List<String>> = vaultIds.getOptional("vault_ids")

/**
* Returns the raw JSON value of [agent].
*
Expand Down Expand Up @@ -510,6 +570,15 @@ private constructor(
@ExcludeMissing
fun _spendControl(): JsonField<SpendControl> = spendControl

/**
* Returns the raw JSON value of [vaultIds].
*
* Unlike [vaultIds], this method doesn't throw if the JSON field has an unexpected type.
*/
@JsonProperty("vault_ids")
@ExcludeMissing
fun _vaultIds(): JsonField<List<String>> = vaultIds

@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
Expand All @@ -531,6 +600,7 @@ private constructor(
"prompt_cache_options" to this.promptCacheOptions,
"review" to this.review,
"spend_control" to this.spendControl,
"vault_ids" to this.vaultIds,
)

/**
Expand Down Expand Up @@ -561,6 +631,7 @@ private constructor(
private var promptCacheOptions: JsonField<PromptCacheOptions> = JsonMissing.of()
private var review: JsonField<Review> = JsonMissing.of()
private var spendControl: JsonField<SpendControl> = JsonMissing.of()
private var vaultIds: JsonField<MutableList<String>>? = null
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
Expand All @@ -570,6 +641,7 @@ private constructor(
promptCacheOptions = body.promptCacheOptions
review = body.review
spendControl = body.spendControl
vaultIds = body.vaultIds.map { it.toMutableList() }
additionalProperties = body.additionalProperties.toMutableMap()
}

Expand Down Expand Up @@ -664,6 +736,37 @@ private constructor(
this.spendControl = spendControl
}

/**
* Replaces the session's referenced vaults. Omit to retain them; null or [] clears
* them.
*/
fun vaultIds(vaultIds: List<String>?) = vaultIds(JsonField.ofNullable(vaultIds))

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

/**
* Sets [Builder.vaultIds] to an arbitrary JSON value.
*
* You should usually call [Builder.vaultIds] with a well-typed `List<String>` value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
fun vaultIds(vaultIds: JsonField<List<String>>) = apply {
this.vaultIds = vaultIds.map { it.toMutableList() }
}

/**
* Adds a single [String] to [vaultIds].
*
* @throws IllegalStateException if the field was previously set to a non-list.
*/
fun addVaultId(vaultId: String) = apply {
vaultIds =
(vaultIds?.takeUnless { it.isMissing() } ?: JsonField.of(mutableListOf()))
.also { checkKnown("vaultIds", it).add(vaultId) }
}

fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
Expand Down Expand Up @@ -695,6 +798,7 @@ private constructor(
promptCacheOptions,
review,
spendControl,
(vaultIds ?: JsonMissing.of()).map { it.toImmutable() },
additionalProperties.toMutableMap(),
)
}
Expand All @@ -720,6 +824,7 @@ private constructor(
promptCacheOptions().ifPresent { it.validate() }
review().ifPresent { it.validate() }
spendControl().ifPresent { it.validate() }
vaultIds()
validated = true
}

Expand All @@ -743,7 +848,8 @@ private constructor(
(metadata.asKnown().getOrNull()?.validity() ?: 0) +
(promptCacheOptions.asKnown().getOrNull()?.validity() ?: 0) +
(review.asKnown().getOrNull()?.validity() ?: 0) +
(spendControl.asKnown().getOrNull()?.validity() ?: 0)
(spendControl.asKnown().getOrNull()?.validity() ?: 0) +
(vaultIds.asKnown().getOrNull()?.size ?: 0)

override fun equals(other: Any?): Boolean {
if (this === other) {
Expand All @@ -756,6 +862,7 @@ private constructor(
promptCacheOptions == other.promptCacheOptions &&
review == other.review &&
spendControl == other.spendControl &&
vaultIds == other.vaultIds &&
additionalProperties == other.additionalProperties
}

Expand All @@ -766,14 +873,15 @@ private constructor(
promptCacheOptions,
review,
spendControl,
vaultIds,
additionalProperties,
)
}

override fun hashCode(): Int = hashCode

override fun toString() =
"Body{agent=$agent, metadata=$metadata, promptCacheOptions=$promptCacheOptions, review=$review, spendControl=$spendControl, additionalProperties=$additionalProperties}"
"Body{agent=$agent, metadata=$metadata, promptCacheOptions=$promptCacheOptions, review=$review, spendControl=$spendControl, vaultIds=$vaultIds, additionalProperties=$additionalProperties}"
}

/** Agent settings to update on this session. Omitted fields stay unchanged. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ interface SessionServiceAsync {
retrieve(sessionId, SessionRetrieveParams.none(), requestOptions)

/**
* Updates session tools, metadata, model, reasoning effort, service tier, or the default prompt
* cache lifetime. Model settings apply to subsequent turns. Omitted fields are unchanged. See
* Updates session tools, vaults, metadata, model, reasoning effort, service tier, or the
* default prompt cache lifetime. Model settings apply to subsequent turns. Omitted fields are
* unchanged. See
* [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
*/
fun update(sessionId: String): CompletableFuture<AgentSession> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ interface SessionService {
retrieve(sessionId, SessionRetrieveParams.none(), requestOptions)

/**
* Updates session tools, metadata, model, reasoning effort, service tier, or the default prompt
* cache lifetime. Model settings apply to subsequent turns. Omitted fields are unchanged. See
* Updates session tools, vaults, metadata, model, reasoning effort, service tier, or the
* default prompt cache lifetime. Model settings apply to subsequent turns. Omitted fields are
* unchanged. See
* [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
*/
fun update(sessionId: String): AgentSession = update(sessionId, SessionUpdateParams.none())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package com.openai.models.beta.agents.sessions

import com.openai.core.JsonValue
import com.openai.models.beta.agents.AgentToolParam
import kotlin.jvm.optionals.getOrNull
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

Expand Down Expand Up @@ -49,6 +50,7 @@ internal class SessionUpdateParamsTest {
)
.review(SessionUpdateParams.Review.NONE)
.spendControl(SessionUpdateParams.SpendControl.builder().limit(1L).build())
.addVaultId("string")
.build()
}

Expand Down Expand Up @@ -102,6 +104,7 @@ internal class SessionUpdateParamsTest {
)
.review(SessionUpdateParams.Review.NONE)
.spendControl(SessionUpdateParams.SpendControl.builder().limit(1L).build())
.addVaultId("string")
.build()

val body = params._body()
Expand Down Expand Up @@ -146,6 +149,7 @@ internal class SessionUpdateParamsTest {
assertThat(body.review()).contains(SessionUpdateParams.Review.NONE)
assertThat(body.spendControl())
.contains(SessionUpdateParams.SpendControl.builder().limit(1L).build())
assertThat(body.vaultIds().getOrNull()).containsExactly("string")
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ internal class SessionServiceAsyncTest {
)
.review(SessionUpdateParams.Review.NONE)
.spendControl(SessionUpdateParams.SpendControl.builder().limit(1L).build())
.addVaultId("string")
.build()
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ internal class SessionServiceTest {
)
.review(SessionUpdateParams.Review.NONE)
.spendControl(SessionUpdateParams.SpendControl.builder().limit(1L).build())
.addVaultId("string")
.build()
)

Expand Down
Loading
Loading