From bb06497160e4c0649272849fe55387ae606959ba Mon Sep 17 00:00:00 2001 From: dpiet-oai <326640584+dpiet-oai@users.noreply.github.com> Date: Fri, 25 Sep 2026 21:47:19 +0000 Subject: [PATCH] feat(api): add access programs and credential metadata Castiron-Internal-PR: https://github.com/openai/openai-java-internal/pull/154 Castiron-Source-SHA: 732659ebd2b2ac1b82985c50c503e7527d46168c Castiron-Public-Base-SHA: 2bfb7186eac7af18ba080eb3effd417a1ea44844 --- .castiron.stats.yml | 14 +- api_reference/openapi.transformed.yml | 329 ++++++++++++-- .../structured-output-public-api.txt | 4 + .../kotlin/com/openai/models/AllModels.kt | 2 +- .../com/openai/models/ComparisonFilter.kt | 4 +- .../com/openai/models/CompoundFilter.kt | 2 +- .../openai/models/CustomToolInputFormat.kt | 2 +- .../com/openai/models/ResponsesModel.kt | 2 +- .../auditlogs/AuditLogListResponse.kt | 2 +- .../ExternalStorageConfiguration.kt | 2 +- .../ExternalStorageCreateParams.kt | 2 +- .../usage/UsageAudioSpeechesResponse.kt | 2 +- .../usage/UsageAudioTranscriptionsResponse.kt | 2 +- .../UsageCodeInterpreterSessionsResponse.kt | 2 +- .../usage/UsageCompletionsResponse.kt | 2 +- .../organization/usage/UsageCostsResponse.kt | 2 +- .../usage/UsageEmbeddingsResponse.kt | 2 +- .../usage/UsageFileSearchCallsResponse.kt | 2 +- .../organization/usage/UsageImagesResponse.kt | 2 +- .../usage/UsageModerationsResponse.kt | 2 +- .../usage/UsageVectorStoresResponse.kt | 2 +- .../usage/UsageWebSearchCallsResponse.kt | 2 +- .../models/audio/speech/SpeechCreateParams.kt | 57 ++- .../audio/transcriptions/Transcription.kt | 2 +- .../TranscriptionCreateParams.kt | 7 +- .../TranscriptionCreateResponse.kt | 2 +- .../transcriptions/TranscriptionDiarized.kt | 2 +- .../TranscriptionStreamEvent.kt | 2 +- .../translations/TranslationCreateResponse.kt | 2 +- .../com/openai/models/beta/agents/Agent.kt | 6 + .../openai/models/beta/agents/AgentContent.kt | 2 +- .../models/beta/agents/AgentCreateParams.kt | 9 + .../beta/agents/AgentFunctionCallOutput.kt | 2 +- .../agents/AgentFunctionCallOutputParam.kt | 2 +- .../models/beta/agents/AgentOutputItem.kt | 2 +- .../openai/models/beta/agents/AgentSession.kt | 8 +- .../models/beta/agents/AgentSessionEvent.kt | 2 +- .../beta/agents/AgentSessionInputParam.kt | 2 +- .../models/beta/agents/AgentSessionItem.kt | 2 +- .../beta/agents/AgentSessionMessageContent.kt | 2 +- .../openai/models/beta/agents/AgentTool.kt | 2 +- .../models/beta/agents/AgentToolParam.kt | 2 +- .../models/beta/agents/AgentUpdateParams.kt | 9 + .../openai/models/beta/agents/Environment.kt | 2 +- .../models/beta/agents/EnvironmentParam.kt | 2 +- .../beta/agents/HostedEnvironmentFile.kt | 2 +- .../beta/agents/HostedEnvironmentFileParam.kt | 2 +- .../openai/models/beta/agents/HostedSkill.kt | 2 +- .../models/beta/agents/HostedSkillParam.kt | 2 +- .../openai/models/beta/agents/InputContent.kt | 2 +- .../models/beta/agents/InputContentParam.kt | 2 +- .../openai/models/beta/agents/McpTransport.kt | 2 +- .../models/beta/agents/McpTransportParam.kt | 2 +- .../models/beta/agents/PersistedAgentTool.kt | 2 +- .../beta/agents/PersistedAgentToolParam.kt | 2 +- .../beta/agents/PersistedMcpTransport.kt | 2 +- .../beta/agents/PersistedMcpTransportParam.kt | 2 +- .../models/beta/agents/SessionTurnError.kt | 9 + .../openai/models/beta/agents/TextFormat.kt | 2 +- .../models/beta/agents/TextFormatParam.kt | 2 +- .../models/beta/agents/WebSearchAction.kt | 2 +- .../templates/EnvironmentTemplate.kt | 4 +- .../agents/sessions/SessionCreateParams.kt | 11 +- .../agents/sessions/SessionUpdateParams.kt | 9 + .../beta/agents/vaults/VaultStatusFilter.kt | 2 +- .../agents/vaults/credentials/Credential.kt | 163 ++++++- .../vaults/credentials/CredentialAuth.kt | 2 +- .../credentials/CredentialAuthCreateParam.kt | 4 +- .../credentials/CredentialAuthRotateParam.kt | 4 +- .../credentials/CredentialCreateParams.kt | 197 ++++++++- .../credentials/CredentialNetworking.kt | 2 +- .../credentials/CredentialNetworkingParam.kt | 2 +- .../credentials/CredentialUpdateParams.kt | 242 ++++++++-- .../credentials/McpOAuthTokenEndpointAuth.kt | 2 +- .../McpOAuthTokenEndpointAuthCreateParam.kt | 2 +- .../McpOAuthTokenEndpointAuthRotateParam.kt | 2 +- .../beta/assistants/AssistantCreateParams.kt | 2 +- .../beta/assistants/AssistantStreamEvent.kt | 2 +- .../models/beta/assistants/AssistantTool.kt | 2 +- .../beta/assistants/MessageStreamEvent.kt | 2 +- .../beta/assistants/RunStepStreamEvent.kt | 2 +- .../models/beta/assistants/RunStreamEvent.kt | 2 +- .../threads/ChatKitResponseOutputText.kt | 2 +- .../beta/chatkit/threads/ChatKitThread.kt | 2 +- .../chatkit/threads/ChatKitThreadItemList.kt | 2 +- .../threads/ChatKitThreadUserMessageItem.kt | 2 +- .../beta/responses/BetaComputerAction.kt | 2 +- .../beta/responses/BetaContainerAuto.kt | 4 +- .../models/beta/responses/BetaCustomTool.kt | 2 +- .../beta/responses/BetaEasyInputMessage.kt | 2 +- .../beta/responses/BetaFileSearchTool.kt | 14 +- .../beta/responses/BetaFunctionShellTool.kt | 2 +- .../beta/responses/BetaMcpToolCallError.kt | 2 +- .../beta/responses/BetaNamespaceTool.kt | 2 +- .../models/beta/responses/BetaResponse.kt | 369 +++++++++++++++- .../BetaResponseApplyPatchToolCall.kt | 4 +- .../BetaResponseApplyPatchToolCallOutput.kt | 2 +- .../BetaResponseCodeInterpreterToolCall.kt | 2 +- .../beta/responses/BetaResponseContent.kt | 2 +- .../BetaResponseContentPartAddedEvent.kt | 2 +- .../BetaResponseContentPartDoneEvent.kt | 2 +- .../responses/BetaResponseCustomToolCall.kt | 2 +- .../BetaResponseCustomToolCallOutput.kt | 8 +- .../responses/BetaResponseFormatTextConfig.kt | 2 +- .../BetaResponseFunctionCallOutputItem.kt | 2 +- ...aResponseFunctionShellCallOutputContent.kt | 2 +- .../BetaResponseFunctionShellToolCall.kt | 4 +- ...BetaResponseFunctionShellToolCallOutput.kt | 4 +- .../responses/BetaResponseFunctionToolCall.kt | 2 +- .../BetaResponseFunctionToolCallOutputItem.kt | 8 +- .../BetaResponseFunctionWebSearch.kt | 2 +- .../responses/BetaResponseInputContent.kt | 2 +- .../beta/responses/BetaResponseInputItem.kt | 22 +- .../models/beta/responses/BetaResponseItem.kt | 4 +- .../beta/responses/BetaResponseOutputItem.kt | 4 +- .../responses/BetaResponseOutputMessage.kt | 2 +- .../beta/responses/BetaResponseOutputText.kt | 2 +- ...aResponseOutputTextAnnotationAddedEvent.kt | 2 +- ...ResponseShellCallOutputContentDoneEvent.kt | 2 +- .../beta/responses/BetaResponseSteerInput.kt | 10 +- .../BetaResponseSteerInputContent.kt | 2 +- .../BetaResponseSteerRequiredInput.kt | 2 +- .../beta/responses/BetaResponseStreamEvent.kt | 2 +- .../responses/BetaResponsesClientEvent.kt | 390 ++++++++++++++++- .../responses/BetaResponsesServerEvent.kt | 2 +- .../openai/models/beta/responses/BetaTool.kt | 10 +- .../beta/responses/ResponseCompactParams.kt | 2 +- .../beta/responses/ResponseCreateParams.kt | 414 +++++++++++++++++- .../inputtokens/InputTokenCountParams.kt | 6 +- .../threads/AssistantResponseFormatOption.kt | 2 +- .../beta/threads/AssistantToolChoiceOption.kt | 2 +- .../beta/threads/ThreadCreateAndRunParams.kt | 6 +- .../models/beta/threads/ThreadCreateParams.kt | 6 +- .../beta/threads/messages/Annotation.kt | 2 +- .../beta/threads/messages/AnnotationDelta.kt | 2 +- .../models/beta/threads/messages/Message.kt | 2 +- .../beta/threads/messages/MessageContent.kt | 2 +- .../threads/messages/MessageContentDelta.kt | 2 +- .../messages/MessageContentPartParam.kt | 2 +- .../threads/messages/MessageCreateParams.kt | 4 +- .../beta/threads/runs/RunCreateParams.kt | 4 +- .../runs/steps/CodeInterpreterToolCall.kt | 2 +- .../steps/CodeInterpreterToolCallDelta.kt | 2 +- .../models/beta/threads/runs/steps/RunStep.kt | 2 +- .../beta/threads/runs/steps/RunStepDelta.kt | 2 +- .../beta/threads/runs/steps/ToolCall.kt | 2 +- .../beta/threads/runs/steps/ToolCallDelta.kt | 2 +- .../models/chat/completions/ChatCompletion.kt | 4 +- .../ChatCompletionAssistantMessageParam.kt | 4 +- .../completions/ChatCompletionAudioParam.kt | 2 +- .../chat/completions/ChatCompletionChunk.kt | 4 +- .../completions/ChatCompletionContentPart.kt | 2 +- .../completions/ChatCompletionCreateParams.kt | 6 +- .../completions/ChatCompletionCustomTool.kt | 2 +- .../ChatCompletionDeveloperMessageParam.kt | 2 +- .../completions/ChatCompletionMessageParam.kt | 2 +- .../ChatCompletionMessageToolCall.kt | 2 +- .../ChatCompletionPredictionContent.kt | 2 +- .../completions/ChatCompletionStoreMessage.kt | 2 +- .../ChatCompletionSystemMessageParam.kt | 2 +- .../chat/completions/ChatCompletionTool.kt | 2 +- .../ChatCompletionToolChoiceOption.kt | 2 +- .../ChatCompletionToolMessageParam.kt | 2 +- .../ChatCompletionUserMessageParam.kt | 2 +- .../completions/CompletionCreateParams.kt | 4 +- .../containers/ContainerCreateParams.kt | 4 +- .../ContentProvenanceCheck.kt | 2 +- .../openai/models/conversations/Message.kt | 2 +- .../conversations/items/ConversationItem.kt | 2 +- .../embeddings/EmbeddingCreateParams.kt | 2 +- .../openai/models/evals/EvalCreateParams.kt | 8 +- .../openai/models/evals/EvalCreateResponse.kt | 4 +- .../openai/models/evals/EvalListResponse.kt | 4 +- .../models/evals/EvalRetrieveResponse.kt | 4 +- .../openai/models/evals/EvalUpdateResponse.kt | 4 +- .../CreateEvalCompletionsRunDataSource.kt | 10 +- .../runs/CreateEvalJsonlRunDataSource.kt | 2 +- .../models/evals/runs/RunCancelResponse.kt | 10 +- .../models/evals/runs/RunCreateParams.kt | 10 +- .../models/evals/runs/RunCreateResponse.kt | 10 +- .../models/evals/runs/RunListResponse.kt | 10 +- .../models/evals/runs/RunRetrieveResponse.kt | 10 +- .../alpha/graders/GraderRunParams.kt | 2 +- .../alpha/graders/GraderValidateParams.kt | 2 +- .../alpha/graders/GraderValidateResponse.kt | 2 +- .../models/finetuning/jobs/FineTuningJob.kt | 6 +- .../models/finetuning/jobs/JobCreateParams.kt | 6 +- .../finetuning/methods/DpoHyperparameters.kt | 8 +- .../methods/ReinforcementHyperparameters.kt | 12 +- .../finetuning/methods/ReinforcementMethod.kt | 2 +- .../methods/SupervisedHyperparameters.kt | 6 +- .../graders/gradermodels/EvalContentItem.kt | 2 +- .../graders/gradermodels/LabelModelGrader.kt | 2 +- .../graders/gradermodels/MultiGrader.kt | 2 +- .../graders/gradermodels/ScoreModelGrader.kt | 2 +- .../openai/models/images/ImageEditParams.kt | 2 +- .../models/images/ImageEditStreamEvent.kt | 2 +- .../models/images/ImageGenStreamEvent.kt | 2 +- .../com/openai/models/live/AudioFormat.kt | 2 +- .../com/openai/models/live/ClientEvent.kt | 2 +- .../openai/models/live/DataChannelConfig.kt | 4 +- .../com/openai/models/live/InitialItem.kt | 4 +- .../openai/models/live/MediaSessionConfig.kt | 4 +- .../models/live/ResponsesDelegationConfig.kt | 4 +- .../live/ResponsesDelegationUpdateConfig.kt | 4 +- .../com/openai/models/live/ServerEvent.kt | 2 +- .../com/openai/models/live/SessionConfig.kt | 4 +- .../com/openai/models/live/SessionResource.kt | 4 +- .../openai/models/live/SessionUpdateConfig.kt | 2 +- .../models/live/forks/ForkClientEvent.kt | 2 +- .../models/live/forks/ForkServerEvent.kt | 2 +- .../live/sessions/SessionAcceptParams.kt | 4 +- .../moderations/ModerationCreateParams.kt | 2 +- .../moderations/ModerationMultiModalInput.kt | 2 +- .../models/realtime/ConversationItem.kt | 2 +- ...emInputAudioTranscriptionCompletedEvent.kt | 2 +- .../realtime/RealtimeAudioConfigOutput.kt | 2 +- .../models/realtime/RealtimeAudioFormats.kt | 2 +- .../RealtimeAudioInputTurnDetection.kt | 2 +- .../models/realtime/RealtimeClientEvent.kt | 2 +- .../models/realtime/RealtimeMcpToolCall.kt | 2 +- .../models/realtime/RealtimeResponse.kt | 2 +- .../RealtimeResponseCreateAudioOutput.kt | 2 +- .../realtime/RealtimeResponseCreateMcpTool.kt | 4 +- .../realtime/RealtimeResponseCreateParams.kt | 6 +- .../models/realtime/RealtimeServerEvent.kt | 2 +- .../openai/models/realtime/RealtimeSession.kt | 6 +- .../realtime/RealtimeSessionCreateRequest.kt | 2 +- .../realtime/RealtimeToolChoiceConfig.kt | 2 +- .../realtime/RealtimeToolsConfigUnion.kt | 6 +- .../models/realtime/RealtimeTracingConfig.kt | 2 +- ...scriptionSessionAudioInputTurnDetection.kt | 2 +- .../RealtimeTranslationClientEvent.kt | 2 +- .../RealtimeTranslationServerEvent.kt | 2 +- .../models/realtime/RealtimeTruncation.kt | 2 +- .../models/realtime/SessionCreatedEvent.kt | 2 +- .../models/realtime/SessionUpdateEvent.kt | 2 +- .../models/realtime/SessionUpdatedEvent.kt | 2 +- .../clientsecrets/ClientSecretCreateParams.kt | 2 +- .../ClientSecretCreateResponse.kt | 2 +- .../RealtimeSessionCreateResponse.kt | 14 +- .../openai/models/responses/ComputerAction.kt | 2 +- .../openai/models/responses/ContainerAuto.kt | 4 +- .../models/responses/EasyInputMessage.kt | 2 +- .../openai/models/responses/FileSearchTool.kt | 2 +- .../models/responses/FunctionShellTool.kt | 2 +- .../models/responses/McpToolCallError.kt | 2 +- .../openai/models/responses/NamespaceTool.kt | 2 +- .../com/openai/models/responses/Response.kt | 369 +++++++++++++++- .../responses/ResponseApplyPatchToolCall.kt | 4 +- .../ResponseApplyPatchToolCallOutput.kt | 2 +- .../ResponseCodeInterpreterToolCall.kt | 2 +- .../models/responses/ResponseCompactParams.kt | 2 +- .../responses/ResponseComputerToolCall.kt | 2 +- .../models/responses/ResponseContent.kt | 2 +- .../ResponseContentPartAddedEvent.kt | 2 +- .../responses/ResponseContentPartDoneEvent.kt | 2 +- .../models/responses/ResponseCreateParams.kt | 414 +++++++++++++++++- .../responses/ResponseCustomToolCall.kt | 2 +- .../responses/ResponseCustomToolCallOutput.kt | 8 +- .../responses/ResponseFormatTextConfig.kt | 2 +- .../ResponseFunctionCallOutputItem.kt | 2 +- .../ResponseFunctionShellCallOutputContent.kt | 2 +- .../ResponseFunctionShellToolCall.kt | 4 +- .../ResponseFunctionShellToolCallOutput.kt | 4 +- .../responses/ResponseFunctionToolCall.kt | 2 +- .../ResponseFunctionToolCallOutputItem.kt | 8 +- .../responses/ResponseFunctionWebSearch.kt | 2 +- .../models/responses/ResponseInputContent.kt | 2 +- .../models/responses/ResponseInputItem.kt | 18 +- .../openai/models/responses/ResponseItem.kt | 2 +- .../models/responses/ResponseOutputItem.kt | 2 +- .../models/responses/ResponseOutputMessage.kt | 2 +- .../models/responses/ResponseOutputText.kt | 2 +- .../ResponseOutputTextAnnotationAddedEvent.kt | 2 +- ...ResponseShellCallOutputContentDoneEvent.kt | 2 +- .../models/responses/ResponseSteerInput.kt | 10 +- .../responses/ResponseSteerInputContent.kt | 2 +- .../responses/ResponseSteerRequiredInput.kt | 2 +- .../models/responses/ResponseStreamEvent.kt | 2 +- .../models/responses/ResponsesClientEvent.kt | 390 ++++++++++++++++- .../models/responses/ResponsesServerEvent.kt | 2 +- .../models/responses/StructuredResponse.kt | 6 + .../StructuredResponseCreateParams.kt | 10 + .../com/openai/models/responses/Tool.kt | 10 +- .../inputtokens/InputTokenCountParams.kt | 6 +- .../openai/models/skills/SkillCreateParams.kt | 2 +- .../skills/versions/VersionCreateParams.kt | 2 +- .../vectorstores/FileChunkingStrategy.kt | 2 +- .../vectorstores/FileChunkingStrategyParam.kt | 2 +- .../vectorstores/VectorStoreSearchParams.kt | 4 +- .../openai/models/videos/VideoCreateError.kt | 150 ++++++- .../openai/models/videos/VideoCreateParams.kt | 2 +- .../openai/models/videos/VideoEditParams.kt | 2 +- .../openai/models/videos/VideoExtendParams.kt | 2 +- .../models/webhooks/UnwrapWebhookEvent.kt | 2 +- .../async/audio/TranscriptionServiceAsync.kt | 10 +- .../agents/vaults/CredentialServiceAsync.kt | 2 +- .../blocking/audio/TranscriptionService.kt | 10 +- .../beta/agents/vaults/CredentialService.kt | 2 +- ...nmentCredentialVisitorCompatibilityTest.kt | 4 +- .../CredentialAuthRotateParamTest.kt | 8 +- .../vaults/credentials/CredentialAuthTest.kt | 12 +- .../credentials/CredentialCreateParamsTest.kt | 17 + .../CredentialListPageResponseTest.kt | 16 + .../vaults/credentials/CredentialTest.kt | 17 + .../credentials/CredentialUpdateParamsTest.kt | 28 +- .../BetaResponseCompletedEventTest.kt | 15 + .../responses/BetaResponseCreatedEventTest.kt | 15 + .../responses/BetaResponseFailedEventTest.kt | 15 + .../BetaResponseInProgressEventTest.kt | 15 + .../BetaResponseIncompleteEventTest.kt | 15 + .../responses/BetaResponseQueuedEventTest.kt | 15 + .../responses/BetaResponseStreamEventTest.kt | 60 +++ .../models/beta/responses/BetaResponseTest.kt | 43 ++ .../responses/BetaResponsesClientEventTest.kt | 15 + .../responses/BetaResponsesServerEventTest.kt | 60 +++ .../responses/ResponseCreateParamsTest.kt | 21 + .../responses/ResponseCompletedEventTest.kt | 15 + .../responses/ResponseCreateParamsTest.kt | 16 + .../responses/ResponseCreatedEventTest.kt | 15 + .../responses/ResponseFailedEventTest.kt | 15 + .../responses/ResponseInProgressEventTest.kt | 15 + .../responses/ResponseIncompleteEventTest.kt | 15 + .../responses/ResponseQueuedEventTest.kt | 15 + .../responses/ResponseStreamEventTest.kt | 60 +++ .../openai/models/responses/ResponseTest.kt | 43 ++ .../responses/ResponsesClientEventTest.kt | 12 + .../responses/ResponsesServerEventTest.kt | 60 +++ .../StructuredResponseCreateParamsTest.kt | 7 + .../responses/StructuredResponseTest.kt | 2 + .../models/videos/VideoCreateErrorTest.kt | 17 + .../videos/VideoListPageResponseTest.kt | 16 + .../com/openai/models/videos/VideoTest.kt | 16 + .../services/EnvironmentCredentialsTest.kt | 2 +- .../ResponseStreamEventValidationTest.kt | 3 +- .../async/ResponseServiceAsyncTest.kt | 10 + .../async/beta/ResponseServiceAsyncTest.kt | 10 + .../vaults/CredentialServiceAsyncTest.kt | 11 + .../services/blocking/ResponseServiceTest.kt | 10 + .../blocking/beta/ResponseServiceTest.kt | 10 + .../agents/vaults/CredentialServiceTest.kt | 11 + 342 files changed, 4666 insertions(+), 585 deletions(-) diff --git a/.castiron.stats.yml b/.castiron.stats.yml index 8014e7550..5f1d907ad 100644 --- a/.castiron.stats.yml +++ b/.castiron.stats.yml @@ -1,8 +1,8 @@ schema_version: 1 -generation_id: 6efdb731-c7f9-436b-af28-c3de6f5e91d3 -openapi_spec_hash: 28ec9bd417aeb3f776da6088a496b267 -openapi_transformed_spec_hash: 2f7bcd56396c286698443b3c84ad7d07 -config_hash: a7b2953a5cf16992f2efba8b0fcd15ea -codegen_sha: a9875e25fdb8f55cfa938273d32c93435d3b3801 -codegen_hash: c00199a3281cfe28d53f4ec4ccc6de66a2e662597678739c8d7e908d782eba2e -public_codegen_sha: 55f5bff0f41b568a61c53b27f5451b53f59a62a5 +generation_id: 2cb6287b-74fd-4ffe-836e-359c0bf21e19 +openapi_spec_hash: 188e635ec266a07f1ef188d7ed905bde +openapi_transformed_spec_hash: e389b9730464603779059a897ec940f9 +config_hash: 38c35bf82be025557d8a7dc727060f2f +codegen_sha: e023fa823e554e7f0756b6c8099ffa33363b546f +codegen_hash: 6e92ca97386a94172e8c392ad85e944e5e8aabc7e38218892f34db18a4d3fa02 +public_codegen_sha: f1b4c32c2634ddd648fb92f253febc0840dbb5e9 diff --git a/api_reference/openapi.transformed.yml b/api_reference/openapi.transformed.yml index 69cf53450..04586c1ff 100644 --- a/api_reference/openapi.transformed.yml +++ b/api_reference/openapi.transformed.yml @@ -601,19 +601,22 @@ paths: schema: type: string format: binary - audio/mpeg: + text/event-stream: + schema: + $ref: '#/components/schemas/CreateSpeechResponseStreamEvent' + audio/aac: schema: type: string format: binary - audio/aac: + audio/flac: schema: type: string format: binary - audio/opus: + audio/mpeg: schema: type: string format: binary - audio/flac: + audio/opus: schema: type: string format: binary @@ -625,9 +628,6 @@ paths: schema: type: string format: binary - text/event-stream: - schema: - $ref: '#/components/schemas/CreateSpeechResponseStreamEvent' '400': description: Invalid speech request, input, output format, or voice. content: @@ -764,15 +764,17 @@ paths: anyOf: - $ref: '#/components/schemas/CreateTranscriptionResponseJson' - $ref: '#/components/schemas/CreateTranscriptionResponseDiarizedJson' + x-stainless-skip: + - go - $ref: '#/components/schemas/CreateTranscriptionResponseVerboseJson' discriminator: propertyName: task - text/plain: - schema: - type: string text/event-stream: schema: $ref: '#/components/schemas/CreateTranscriptionResponseStreamEvent' + text/plain: + schema: + type: string '400': description: Invalid audio input or request parameters. content: @@ -17358,6 +17360,7 @@ paths: { "id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b", "object": "response", + "access_programs": null, "created_at": 1741476542, "status": "completed", "completed_at": 1741476543, @@ -17507,6 +17510,7 @@ paths: { "id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41", "object": "response", + "access_programs": null, "created_at": 1741476777, "status": "completed", "completed_at": 1741476778, @@ -17634,6 +17638,7 @@ paths: { "id": "resp_686eef60237881a2bd1180bb8b13de430e34c516d176ff86", "object": "response", + "access_programs": null, "created_at": 1752100704, "status": "completed", "completed_at": 1752100705, @@ -17756,6 +17761,7 @@ paths: { "id": "resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c", "object": "response", + "access_programs": null, "created_at": 1741484430, "status": "completed", "completed_at": 1741484431, @@ -17928,6 +17934,7 @@ paths: { "id": "resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7", "object": "response", + "access_programs": null, "created_at": 1741485253, "status": "completed", "completed_at": 1741485254, @@ -18125,10 +18132,10 @@ paths: } response: | event: response.created - data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","access_programs":null,"created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} event: response.in_progress - data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","access_programs":null,"created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} event: response.output_item.added data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}} @@ -18151,7 +18158,7 @@ paths: data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}} event: response.completed - data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}} + data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","access_programs":null,"created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}} - title: Functions request: curl: | @@ -18292,6 +18299,7 @@ paths: { "id": "resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0", "object": "response", + "access_programs": null, "created_at": 1741294021, "status": "completed", "completed_at": 1741294022, @@ -18430,6 +18438,7 @@ paths: { "id": "resp_67ccd7eca01881908ff0b5146584e408072912b2993db808", "object": "response", + "access_programs": null, "created_at": 1741477868, "status": "completed", "completed_at": 1741477869, @@ -18576,6 +18585,7 @@ paths: { "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44", "object": "response", + "access_programs": null, "created_at": 1741386163, "status": "completed", "completed_at": 1741386164, @@ -18740,6 +18750,7 @@ paths: { "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44", "object": "response", + "access_programs": null, "created_at": 1741386163, "status": "cancelled", "background": true, @@ -23541,10 +23552,27 @@ paths: "geography": "US", "status": "validated", "created_at": 1711471500 + }, + { + "object": "organization.external_storage", + "id": "extstorage_gcp123", + "project_id": "proj_gcp123", + "provider": { + "type": "gcp", + "bucket": "customer-gcp-retention", + "workload_identity_project_number": "123456789012", + "workload_identity_pool_id": "customer-pool", + "workload_identity_provider_id": "customer-provider", + "region": "us-central1", + "audience": "proj_gcp123" + }, + "geography": "US", + "status": "validated", + "created_at": 1711471400 } ], "first_id": "extstorage_abc123", - "last_id": "extstorage_azure123", + "last_id": "extstorage_gcp123", "has_more": false } security: @@ -23636,6 +23664,40 @@ paths: "status": "pending", "created_at": 1711471533 } + - title: Google Cloud Storage + request: + curl: | + curl -X POST https://api.openai.com/v1/organization/external_storage \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "project_id": "proj_gcp123", + "provider": { + "type": "gcp", + "bucket": "customer-gcp-retention", + "workload_identity_project_number": "123456789012", + "workload_identity_pool_id": "customer-pool", + "workload_identity_provider_id": "customer-provider" + } + }' + response: | + { + "object": "organization.external_storage", + "id": "extstorage_gcp123", + "project_id": "proj_gcp123", + "provider": { + "type": "gcp", + "bucket": "customer-gcp-retention", + "workload_identity_project_number": "123456789012", + "workload_identity_pool_id": "customer-pool", + "workload_identity_provider_id": "customer-provider", + "region": "us-central1", + "audience": "proj_gcp123" + }, + "geography": "US", + "status": "pending", + "created_at": 1711471400 + } security: - AdminApiKeyAuth: [] /organization/external_storage/{external_storage_id}: @@ -29187,8 +29249,8 @@ paths: $ref: '#/components/schemas/ErrorResponse-2' post: operationId: rotateVaultCredential - summary: Rotate a vault credential - description: Rotates a vault credential's write-only secret and returns only credential metadata. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults). + summary: Update a vault credential + description: Updates credential metadata or rotates its write-only secret. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults). tags: - Vaults parameters: @@ -29215,7 +29277,7 @@ paths: $ref: '#/components/schemas/RotateVaultCredentialParams' responses: '200': - description: The rotated vault credential without secret values. + description: The updated vault credential without secret values. content: application/json: schema: @@ -29609,6 +29671,7 @@ paths: { "id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b", "object": "response", + "access_programs": null, "created_at": 1741476542, "status": "completed", "completed_at": 1741476543, @@ -29758,6 +29821,7 @@ paths: { "id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41", "object": "response", + "access_programs": null, "created_at": 1741476777, "status": "completed", "completed_at": 1741476778, @@ -29885,6 +29949,7 @@ paths: { "id": "resp_686eef60237881a2bd1180bb8b13de430e34c516d176ff86", "object": "response", + "access_programs": null, "created_at": 1752100704, "status": "completed", "completed_at": 1752100705, @@ -30007,6 +30072,7 @@ paths: { "id": "resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c", "object": "response", + "access_programs": null, "created_at": 1741484430, "status": "completed", "completed_at": 1741484431, @@ -30179,6 +30245,7 @@ paths: { "id": "resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7", "object": "response", + "access_programs": null, "created_at": 1741485253, "status": "completed", "completed_at": 1741485254, @@ -30376,10 +30443,10 @@ paths: } response: | event: response.created - data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","access_programs":null,"created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} event: response.in_progress - data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","access_programs":null,"created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} event: response.output_item.added data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}} @@ -30402,7 +30469,7 @@ paths: data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}} event: response.completed - data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}} + data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","access_programs":null,"created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}} - title: Functions request: curl: | @@ -30543,6 +30610,7 @@ paths: { "id": "resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0", "object": "response", + "access_programs": null, "created_at": 1741294021, "status": "completed", "completed_at": 1741294022, @@ -30681,6 +30749,7 @@ paths: { "id": "resp_67ccd7eca01881908ff0b5146584e408072912b2993db808", "object": "response", + "access_programs": null, "created_at": 1741477868, "status": "completed", "completed_at": 1741477869, @@ -30854,6 +30923,7 @@ paths: { "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44", "object": "response", + "access_programs": null, "created_at": 1741386163, "status": "completed", "completed_at": 1741386164, @@ -31044,6 +31114,7 @@ paths: { "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44", "object": "response", + "access_programs": null, "created_at": 1741386163, "status": "cancelled", "background": true, @@ -38697,6 +38768,8 @@ components: - $ref: '#/components/schemas/ResponseProperties' - type: object properties: + access_programs: + $ref: '#/components/schemas/AccessProgramsParam' prompt_cache_options: $ref: '#/components/schemas/ResponsePromptCacheOptionsParam' service_tier: @@ -38924,7 +38997,25 @@ components: maxLength: 4096 voice: description: 'The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the voices are available in the [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).' - $ref: '#/components/schemas/VoiceIdsOrCustomVoice' + title: Voice + anyOf: + - anyOf: + - $ref: '#/components/schemas/VoiceIdsShared' + - type: string + enum: + - fable + - onyx + - nova + - type: object + description: Custom voice reference. + additionalProperties: false + required: + - id + properties: + id: + type: string + description: The custom voice ID, e.g. `voice_1234`. + example: voice_1234 response_format: description: The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. default: mp3 @@ -57269,6 +57360,10 @@ components: - cancelled - queued - incomplete + access_programs: + anyOf: + - $ref: '#/components/schemas/AccessProgramsBody' + - type: 'null' created_at: type: number format: unixtime @@ -57381,6 +57476,7 @@ components: type: integer - type: 'null' required: + - access_programs - id - object - created_at @@ -57740,6 +57836,7 @@ components: "response": { "id": "resp_123", "object": "response", + "access_programs": null, "created_at": 1740855869, "status": "completed", "completed_at": 1740855870, @@ -57987,6 +58084,7 @@ components: "response": { "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", "object": "response", + "access_programs": null, "created_at": 1741487325, "status": "in_progress", "completed_at": null, @@ -58222,6 +58320,7 @@ components: "response": { "id": "resp_123", "object": "response", + "access_programs": null, "created_at": 1740855869, "status": "failed", "completed_at": null, @@ -58760,6 +58859,7 @@ components: "response": { "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", "object": "response", + "access_programs": null, "created_at": 1741487325, "status": "in_progress", "completed_at": null, @@ -58828,6 +58928,7 @@ components: "response": { "id": "resp_123", "object": "response", + "access_programs": null, "created_at": 1740855869, "status": "incomplete", "completed_at": null, @@ -66061,9 +66162,7 @@ components: - type: object title: Web search approximate location description: | - The approximate location of the user. If omitted or null, defaults to the - United States. To avoid this fallback, pass `{"type": "approximate"}` without - location fields. To localize results, provide the relevant location fields. + The approximate location of the user. properties: type: type: string @@ -66161,6 +66260,10 @@ components: - type: 'null' user_location: $ref: '#/components/schemas/WebSearchApproximateLocation' + description: | + The approximate location of the user. If omitted or null, defaults to the + United States. To avoid this fallback, pass `{"type": "approximate"}` without + location fields. To localize results, provide the relevant location fields. search_context_size: type: string enum: @@ -71690,12 +71793,44 @@ components: - account_name - container - region + GcpExternalStorageProviderResponse: + properties: + type: + type: string + enum: + - gcp + default: gcp + x-stainless-const: true + bucket: + type: string + workload_identity_project_number: + type: string + workload_identity_pool_id: + type: string + workload_identity_provider_id: + type: string + region: + type: string + audience: + type: string + type: object + required: + - type + - bucket + - workload_identity_project_number + - workload_identity_pool_id + - workload_identity_provider_id + - region + - audience + x-stainless-skip: + - java provider: discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/AwsExternalStorageProviderResponse' - $ref: '#/components/schemas/AzureExternalStorageProviderResponse' + - $ref: '#/components/schemas/GcpExternalStorageProviderResponse' PublicProjectResidency: type: string enum: @@ -71751,6 +71886,21 @@ components: - type title: Specific shell tool choice description: Forces the model to call the shell tool when a tool call is required. + CyberAccessProgramEnum: + type: string + enum: + - standard + - daybreak_blue + - daybreak_red + AccessProgramsParam: + properties: + cyber: + $ref: '#/components/schemas/CyberAccessProgramEnum' + description: The Cyber access program to use for this request. Supported values are `standard`, `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from the model's Cyber tier and your organization and project access, subject to model-specific eligibility restrictions. By default, models without a Cyber tier use Standard. Blue-tier models use Daybreak Blue when authorized; otherwise they fall back to Standard unless the model requires Daybreak access. Red-tier models use Daybreak Red and require authorization. Requests that require unavailable Daybreak access return 403. An implicit Standard fallback is represented by null in the response's access_programs field, rather than an explicit Standard selection. + additionalProperties: false + type: object + required: [] + description: Domain-specific access programs to use for this request. ResponsePromptCacheOptionsParam: properties: ttl: @@ -71804,6 +71954,14 @@ components: type: object required: - type + AccessProgramsBody: + properties: + cyber: + $ref: '#/components/schemas/CyberAccessProgramEnum' + description: The effective Cyber access program used for this response. + type: object + required: + - cyber PromptCacheOptions: properties: ttl: @@ -72317,6 +72475,7 @@ components: anyOf: - $ref: '#/components/schemas/AwsExternalStorageProviderResponse' - $ref: '#/components/schemas/AzureExternalStorageProviderResponse' + - $ref: '#/components/schemas/GcpExternalStorageProviderResponse' geography: type: string status: @@ -72405,6 +72564,31 @@ components: - resource_group - account_name - container + GcpExternalStorageProviderParams: + properties: + type: + type: string + enum: + - gcp + default: gcp + x-stainless-const: true + bucket: + type: string + workload_identity_project_number: + type: string + workload_identity_pool_id: + type: string + workload_identity_provider_id: + type: string + type: object + required: + - type + - bucket + - workload_identity_project_number + - workload_identity_pool_id + - workload_identity_provider_id + x-stainless-skip: + - java CreateExternalStorageBody: properties: project_id: @@ -72416,6 +72600,7 @@ components: anyOf: - $ref: '#/components/schemas/AwsExternalStorageProviderParams' - $ref: '#/components/schemas/AzureExternalStorageProviderParams' + - $ref: '#/components/schemas/GcpExternalStorageProviderParams' type: object required: - project_id @@ -72812,6 +72997,13 @@ components: message: type: string description: A human-readable description of the error that was returned. + headers: + additionalProperties: + type: string + description: The retry header value. + type: object + description: The Retry-After and Retry-After-Ms headers returned with the original error, if any. + x-oaiTypeLabel: map misalignment: $ref: '#/components/schemas/MisalignmentErrorDetailsResource' type: object @@ -76291,6 +76483,7 @@ components: - rate_limit_exceeded - server_overloaded - cyber_policy + - misalignment_policy_violation - connection_failed - server_error - authentication_error @@ -76309,6 +76502,7 @@ components: - The request exceeds the available rate limit. - The model service is temporarily overloaded. - The request was rejected by a safety policy. + - The request was blocked by the safety systems. - The request could not connect to the model service. - The model service encountered an unexpected error. - The API credentials are invalid or lack the required access. @@ -76612,6 +76806,7 @@ components: - flex - priority - fast + - ultrafast description: The service-tier policy configured for an agent. PersistedAgentToolResourceFunction: type: object @@ -77205,12 +77400,14 @@ components: - flex - priority - fast + - ultrafast x-enumDescriptions: - Selects the service tier automatically. - Uses the default service tier. - Uses the flex service tier. - Uses the priority service tier. - Uses the fast service tier. + - Uses the ultrafast service tier. description: The service tier used for model requests. PersistedAgentToolConfigParamFunction: type: object @@ -81964,6 +82161,16 @@ components: auth: $ref: '#/components/schemas/VaultCredentialAuthResource' description: The authentication method and non-secret configuration of the credential. + metadata: + type: object + additionalProperties: + type: string + minLength: 0 + propertyNames: + type: string + minLength: 0 + minProperties: 0 + description: Application-defined key-value pairs associated with this credential. created_at: type: integer format: int64 @@ -81978,6 +82185,7 @@ components: - vault_id - name - auth + - metadata - created_at - updated_at additionalProperties: false @@ -82306,6 +82514,19 @@ components: auth: $ref: '#/components/schemas/CreateVaultCredentialAuthParam' description: The authentication method and write-only secret values to store. + metadata: + type: object + additionalProperties: + type: string + minLength: 0 + maxLength: 512 + propertyNames: + type: string + minLength: 1 + maxLength: 64 + minProperties: 0 + maxProperties: 16 + description: Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. Defaults to an empty map. required: - auth - name @@ -82485,10 +82706,21 @@ components: auth: $ref: '#/components/schemas/RotateVaultCredentialAuthParam' description: Replacement values for the credential's existing authentication method. - required: - - auth + metadata: + type: object + additionalProperties: + type: string + minLength: 0 + maxLength: 512 + propertyNames: + type: string + minLength: 1 + maxLength: 64 + minProperties: 0 + maxProperties: 16 + description: Replaces all metadata. Omit to preserve it, or pass {} to clear it. Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. additionalProperties: false - description: Secret, expiry, and OAuth refresh scope updates for an existing vault credential. + description: Metadata, secret, expiry, and OAuth refresh scope updates for an existing vault credential. Supply at least one of `auth` or `metadata`. DeletedVaultCredentialResource: type: object properties: @@ -86147,6 +86379,10 @@ components: - type: 'null' user_location: $ref: '#/components/schemas/BetaWebSearchApproximateLocation' + description: | + The approximate location of the user. If omitted or null, defaults to the + United States. To avoid this fallback, pass `{"type": "approximate"}` without + location fields. To localize results, provide the relevant location fields. search_context_size: type: string enum: @@ -86162,9 +86398,7 @@ components: - type: object title: Web search approximate location description: | - The approximate location of the user. If omitted or null, defaults to the - United States. To avoid this fallback, pass `{"type": "approximate"}` without - location fields. To localize results, provide the relevant location fields. + The approximate location of the user. properties: type: type: string @@ -91520,6 +91754,10 @@ components: - cancelled - queued - incomplete + access_programs: + anyOf: + - $ref: '#/components/schemas/BetaAccessProgramsBody' + - type: 'null' created_at: type: number format: unixtime @@ -91632,6 +91870,7 @@ components: type: integer - type: 'null' required: + - access_programs - id - object - created_at @@ -91924,6 +92163,20 @@ components: - empty_image_file - failed_to_download_image - image_file_not_found + BetaAccessProgramsBody: + properties: + cyber: + $ref: '#/components/schemas/BetaCyberAccessProgramEnum' + description: The effective Cyber access program used for this response. + type: object + required: + - cyber + BetaCyberAccessProgramEnum: + type: string + enum: + - standard + - daybreak_blue + - daybreak_red BetaServiceTierResponses: anyOf: - type: string @@ -93507,6 +93760,7 @@ components: "response": { "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", "object": "response", + "access_programs": null, "created_at": 1741487325, "status": "in_progress", "completed_at": null, @@ -94035,6 +94289,7 @@ components: "response": { "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", "object": "response", + "access_programs": null, "created_at": 1741487325, "status": "in_progress", "completed_at": null, @@ -94226,6 +94481,7 @@ components: "response": { "id": "resp_123", "object": "response", + "access_programs": null, "created_at": 1740855869, "status": "completed", "completed_at": 1740855870, @@ -94691,6 +94947,7 @@ components: "response": { "id": "resp_123", "object": "response", + "access_programs": null, "created_at": 1740855869, "status": "incomplete", "completed_at": null, @@ -94758,6 +95015,7 @@ components: "response": { "id": "resp_123", "object": "response", + "access_programs": null, "created_at": 1740855869, "status": "failed", "completed_at": null, @@ -96679,6 +96937,8 @@ components: - $ref: '#/components/schemas/BetaResponseProperties' - type: object properties: + access_programs: + $ref: '#/components/schemas/BetaAccessProgramsParam' prompt_cache_options: $ref: '#/components/schemas/BetaResponsePromptCacheOptionsParam' service_tier: @@ -96903,6 +97163,15 @@ components: required: [] title: Prompt cache options description: Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching) for current details. + BetaAccessProgramsParam: + properties: + cyber: + $ref: '#/components/schemas/BetaCyberAccessProgramEnum' + description: The Cyber access program to use for this request. Supported values are `standard`, `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from the model's Cyber tier and your organization and project access, subject to model-specific eligibility restrictions. By default, models without a Cyber tier use Standard. Blue-tier models use Daybreak Blue when authorized; otherwise they fall back to Standard unless the model requires Daybreak access. Red-tier models use Daybreak Red and require authorization. Requests that require unavailable Daybreak access return 403. An implicit Standard fallback is represented by null in the response's access_programs field, rather than an explicit Standard selection. + additionalProperties: false + type: object + required: [] + description: Domain-specific access programs to use for this request. BetaCreateModelResponseProperties: allOf: - $ref: '#/components/schemas/BetaModelResponseProperties' diff --git a/openai-java-core/src/apiCompatibility/structured-output-public-api.txt b/openai-java-core/src/apiCompatibility/structured-output-public-api.txt index 463e71795..0c0f3d7f0 100644 --- a/openai-java-core/src/apiCompatibility/structured-output-public-api.txt +++ b/openai-java-core/src/apiCompatibility/structured-output-public-api.txt @@ -237,6 +237,7 @@ com.openai.models.chat.completions.StructuredChatCompletionMessage#refusal ()Lja com.openai.models.chat.completions.StructuredChatCompletionMessage#responseType ()Ljava/lang/Class; com.openai.models.chat.completions.StructuredChatCompletionMessage#toolCalls ()Ljava/util/Optional; com.openai.models.chat.completions.StructuredChatCompletionMessage#validate ()Lcom/openai/models/chat/completions/ChatCompletionMessage; +com.openai.models.responses.StructuredResponse#_accessPrograms ()Lcom/openai/core/JsonField; com.openai.models.responses.StructuredResponse#_additionalProperties ()Ljava/util/Map; com.openai.models.responses.StructuredResponse#_background ()Lcom/openai/core/JsonField; com.openai.models.responses.StructuredResponse#_completedAt ()Lcom/openai/core/JsonField; @@ -273,6 +274,7 @@ com.openai.models.responses.StructuredResponse#_topP ()Lcom/openai/core/JsonFiel com.openai.models.responses.StructuredResponse#_truncation ()Lcom/openai/core/JsonField; com.openai.models.responses.StructuredResponse#_usage ()Lcom/openai/core/JsonField; com.openai.models.responses.StructuredResponse#_user ()Lcom/openai/core/JsonField; +com.openai.models.responses.StructuredResponse#accessPrograms ()Ljava/util/Optional; com.openai.models.responses.StructuredResponse#background ()Ljava/util/Optional; com.openai.models.responses.StructuredResponse#completedAt ()Ljava/util/Optional; com.openai.models.responses.StructuredResponse#conversation ()Ljava/util/Optional; @@ -314,6 +316,8 @@ com.openai.models.responses.StructuredResponse#validate ()Lcom/openai/models/res com.openai.models.responses.StructuredResponseCreateParams#builder ()Lcom/openai/models/responses/StructuredResponseCreateParams$Builder; com.openai.models.responses.StructuredResponseCreateParams#rawParams ()Lcom/openai/models/responses/ResponseCreateParams; com.openai.models.responses.StructuredResponseCreateParams#responseType ()Ljava/lang/Class; +com.openai.models.responses.StructuredResponseCreateParams$Builder#accessPrograms (Lcom/openai/core/JsonField;)Lcom/openai/models/responses/StructuredResponseCreateParams$Builder; +com.openai.models.responses.StructuredResponseCreateParams$Builder#accessPrograms (Lcom/openai/models/responses/ResponseCreateParams$AccessPrograms;)Lcom/openai/models/responses/StructuredResponseCreateParams$Builder; com.openai.models.responses.StructuredResponseCreateParams$Builder#addCodeInterpreterTool (Lcom/openai/models/responses/Tool$CodeInterpreter$Container$CodeInterpreterToolAuto;)Lcom/openai/models/responses/StructuredResponseCreateParams$Builder; com.openai.models.responses.StructuredResponseCreateParams$Builder#addCodeInterpreterTool (Lcom/openai/models/responses/Tool$CodeInterpreter$Container;)Lcom/openai/models/responses/StructuredResponseCreateParams$Builder; com.openai.models.responses.StructuredResponseCreateParams$Builder#addCodeInterpreterTool (Ljava/lang/String;)Lcom/openai/models/responses/StructuredResponseCreateParams$Builder; diff --git a/openai-java-core/src/main/kotlin/com/openai/models/AllModels.kt b/openai-java-core/src/main/kotlin/com/openai/models/AllModels.kt index 7f21565b7..d777f8e9c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/AllModels.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/AllModels.kt @@ -200,7 +200,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AllModels: $json") + throw OpenAIInvalidDataException("Unknown AllModels") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ComparisonFilter.kt b/openai-java-core/src/main/kotlin/com/openai/models/ComparisonFilter.kt index f88cc913e..1206a356e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ComparisonFilter.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ComparisonFilter.kt @@ -683,7 +683,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Value: $json") + throw OpenAIInvalidDataException("Unknown Value") } } @@ -902,7 +902,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ComparisonFilterValueItem: $json") + throw OpenAIInvalidDataException("Unknown ComparisonFilterValueItem") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CompoundFilter.kt b/openai-java-core/src/main/kotlin/com/openai/models/CompoundFilter.kt index b31398dba..23e6810e9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CompoundFilter.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CompoundFilter.kt @@ -417,7 +417,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Filter: $json") + throw OpenAIInvalidDataException("Unknown Filter") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CustomToolInputFormat.kt b/openai-java-core/src/main/kotlin/com/openai/models/CustomToolInputFormat.kt index 45cb3db82..80c8c480c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CustomToolInputFormat.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CustomToolInputFormat.kt @@ -202,7 +202,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown CustomToolInputFormat: $json") + throw OpenAIInvalidDataException("Unknown CustomToolInputFormat") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ResponsesModel.kt b/openai-java-core/src/main/kotlin/com/openai/models/ResponsesModel.kt index 3e883d92a..7d1460759 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ResponsesModel.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ResponsesModel.kt @@ -199,7 +199,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponsesModel: $json") + throw OpenAIInvalidDataException("Unknown ResponsesModel") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListResponse.kt index cf5d25fa7..b7af32392 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListResponse.kt @@ -9101,7 +9101,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Provider: $json") + throw OpenAIInvalidDataException("Unknown Provider") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/externalstorage/ExternalStorageConfiguration.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/externalstorage/ExternalStorageConfiguration.kt index 1b0a8095f..2a2814c47 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/externalstorage/ExternalStorageConfiguration.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/externalstorage/ExternalStorageConfiguration.kt @@ -539,7 +539,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Provider: $json") + throw OpenAIInvalidDataException("Unknown Provider") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/externalstorage/ExternalStorageCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/externalstorage/ExternalStorageCreateParams.kt index 5e2317d4f..d6658c7b7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/externalstorage/ExternalStorageCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/externalstorage/ExternalStorageCreateParams.kt @@ -657,7 +657,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Provider: $json") + throw OpenAIInvalidDataException("Unknown Provider") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt index 8eed6d1d6..58c68eaf9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt @@ -1287,7 +1287,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt index efc846308..fc6a803e6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt @@ -1290,7 +1290,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt index a978873c9..69094101e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt @@ -1291,7 +1291,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt index bceae6d4b..da3d7d2e5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt @@ -1287,7 +1287,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt index 82d37ec0e..e321c81e8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt @@ -1287,7 +1287,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt index 4ac36afdc..ca8f0bd51 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt @@ -1287,7 +1287,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt index 187a49808..71cd52596 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt @@ -1287,7 +1287,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt index 42806a422..7f15339f5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt @@ -1287,7 +1287,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt index 45549f2eb..0473d14c3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt @@ -1287,7 +1287,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt index 940c8fe50..0a8689034 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt @@ -1287,7 +1287,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt index 7e7c0bd55..8525c9129 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt @@ -1287,7 +1287,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/audio/speech/SpeechCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/audio/speech/SpeechCreateParams.kt index 26a3cf26b..1710f46f7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/audio/speech/SpeechCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/audio/speech/SpeechCreateParams.kt @@ -980,6 +980,13 @@ private constructor( fun string(): Optional = Optional.ofNullable(string) + /** + * The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, + * `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, + * and `cedar`. You may also provide a custom voice object with an `id`, for example `{ + * "id": "voice_1234" }`. Previews of the voices are available in the + * [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options). + */ fun unionMember1(): Optional = Optional.ofNullable(unionMember1) /** Custom voice reference. */ @@ -993,6 +1000,13 @@ private constructor( fun asString(): String = string.getOrThrow("string") + /** + * The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, + * `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, + * and `cedar`. You may also provide a custom voice object with an `id`, for example `{ + * "id": "voice_1234" }`. Previews of the voices are available in the + * [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options). + */ fun asUnionMember1(): UnionMember1 = unionMember1.getOrThrow("unionMember1") /** Custom voice reference. */ @@ -1124,6 +1138,14 @@ private constructor( @JvmStatic fun ofString(string: String) = Voice(string = string) + /** + * The voice to use when generating the audio. Supported built-in voices are `alloy`, + * `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, + * `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an + * `id`, for example `{ "id": "voice_1234" }`. Previews of the voices are available in + * the + * [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options). + */ @JvmStatic fun ofUnionMember1(unionMember1: UnionMember1) = Voice(unionMember1 = unionMember1) @@ -1136,6 +1158,14 @@ private constructor( fun visitString(string: String): T + /** + * The voice to use when generating the audio. Supported built-in voices are `alloy`, + * `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, + * `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an + * `id`, for example `{ "id": "voice_1234" }`. Previews of the voices are available in + * the + * [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options). + */ fun visitUnionMember1(unionMember1: UnionMember1): T /** Custom voice reference. */ @@ -1152,7 +1182,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Voice: $json") + throw OpenAIInvalidDataException("Unknown Voice") } } @@ -1206,6 +1236,13 @@ private constructor( } } + /** + * The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, + * `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, + * and `cedar`. You may also provide a custom voice object with an `id`, for example `{ + * "id": "voice_1234" }`. Previews of the voices are available in the + * [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options). + */ class UnionMember1 @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -1241,6 +1278,12 @@ private constructor( @JvmField val CEDAR = of("cedar") + @JvmField val FABLE = of("fable") + + @JvmField val ONYX = of("onyx") + + @JvmField val NOVA = of("nova") + @JvmStatic fun of(value: String) = UnionMember1(JsonField.of(value)) } @@ -1256,6 +1299,9 @@ private constructor( VERSE, MARIN, CEDAR, + FABLE, + ONYX, + NOVA, } /** @@ -1278,6 +1324,9 @@ private constructor( VERSE, MARIN, CEDAR, + FABLE, + ONYX, + NOVA, /** * An enum member indicating that [UnionMember1] was instantiated with an unknown * value. @@ -1304,6 +1353,9 @@ private constructor( VERSE -> Value.VERSE MARIN -> Value.MARIN CEDAR -> Value.CEDAR + FABLE -> Value.FABLE + ONYX -> Value.ONYX + NOVA -> Value.NOVA else -> Value._UNKNOWN } @@ -1328,6 +1380,9 @@ private constructor( VERSE -> Known.VERSE MARIN -> Known.MARIN CEDAR -> Known.CEDAR + FABLE -> Known.FABLE + ONYX -> Known.ONYX + NOVA -> Known.NOVA else -> throw OpenAIInvalidDataException("Unknown UnionMember1: $value") } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/Transcription.kt b/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/Transcription.kt index 65067e840..94f81b108 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/Transcription.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/Transcription.kt @@ -752,7 +752,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Usage: $json") + throw OpenAIInvalidDataException("Unknown Usage") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionCreateParams.kt index fe6f27d16..0ca787775 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionCreateParams.kt @@ -37,8 +37,9 @@ import kotlin.jvm.optionals.getOrNull /** * Transcribes audio into the input language. * - * Returns a transcription object in `json`, `diarized_json`, or `verbose_json` format, or a stream - * of transcript events. + * Returns a transcription object in `json`, `diarized_json`, or `verbose_json` format, plain text + * in `text`, `srt`, or `vtt` format, or a stream of transcript events. Supported formats depend on + * the model. */ class TranscriptionCreateParams private constructor( @@ -1844,7 +1845,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ChunkingStrategy: $json") + throw OpenAIInvalidDataException("Unknown ChunkingStrategy") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionCreateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionCreateResponse.kt index 7cc7aa0fb..85c8446a2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionCreateResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionCreateResponse.kt @@ -243,7 +243,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TranscriptionCreateResponse: $json") + throw OpenAIInvalidDataException("Unknown TranscriptionCreateResponse") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionDiarized.kt b/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionDiarized.kt index f63e03e84..2acb90e31 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionDiarized.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionDiarized.kt @@ -527,7 +527,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Usage: $json") + throw OpenAIInvalidDataException("Unknown Usage") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionStreamEvent.kt index 5d0c4004c..6704ce4b7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionStreamEvent.kt @@ -312,7 +312,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TranscriptionStreamEvent: $json") + throw OpenAIInvalidDataException("Unknown TranscriptionStreamEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/audio/translations/TranslationCreateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/audio/translations/TranslationCreateResponse.kt index f0cf1b555..681da7b71 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/audio/translations/TranslationCreateResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/audio/translations/TranslationCreateResponse.kt @@ -182,7 +182,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TranslationCreateResponse: $json") + throw OpenAIInvalidDataException("Unknown TranslationCreateResponse") } } 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 a62b0a60e..49239ad65 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 @@ -825,6 +825,8 @@ private constructor( @JvmField val FAST = of("fast") + @JvmField val ULTRAFAST = of("ultrafast") + @JvmStatic fun of(value: String) = ServiceTier(JsonField.of(value)) } @@ -835,6 +837,7 @@ private constructor( FLEX, PRIORITY, FAST, + ULTRAFAST, } /** @@ -852,6 +855,7 @@ private constructor( FLEX, PRIORITY, FAST, + ULTRAFAST, /** * An enum member indicating that [ServiceTier] was instantiated with an unknown value. */ @@ -872,6 +876,7 @@ private constructor( FLEX -> Value.FLEX PRIORITY -> Value.PRIORITY FAST -> Value.FAST + ULTRAFAST -> Value.ULTRAFAST else -> Value._UNKNOWN } @@ -891,6 +896,7 @@ private constructor( FLEX -> Known.FLEX PRIORITY -> Known.PRIORITY FAST -> Known.FAST + ULTRAFAST -> Known.ULTRAFAST else -> throw OpenAIInvalidDataException("Unknown ServiceTier: $value") } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentContent.kt index fe968e605..325ed4630 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentContent.kt @@ -196,7 +196,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AgentContent: $json") + throw OpenAIInvalidDataException("Unknown AgentContent") } } 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 66fec0744..6b327ecf7 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 @@ -1279,6 +1279,9 @@ private constructor( /** Uses the fast service tier. */ @JvmField val FAST = of("fast") + /** Uses the ultrafast service tier. */ + @JvmField val ULTRAFAST = of("ultrafast") + @JvmStatic fun of(value: String) = ServiceTier(JsonField.of(value)) } @@ -1294,6 +1297,8 @@ private constructor( PRIORITY, /** Uses the fast service tier. */ FAST, + /** Uses the ultrafast service tier. */ + ULTRAFAST, } /** @@ -1316,6 +1321,8 @@ private constructor( PRIORITY, /** Uses the fast service tier. */ FAST, + /** Uses the ultrafast service tier. */ + ULTRAFAST, /** * An enum member indicating that [ServiceTier] was instantiated with an unknown value. */ @@ -1336,6 +1343,7 @@ private constructor( FLEX -> Value.FLEX PRIORITY -> Value.PRIORITY FAST -> Value.FAST + ULTRAFAST -> Value.ULTRAFAST else -> Value._UNKNOWN } @@ -1355,6 +1363,7 @@ private constructor( FLEX -> Known.FLEX PRIORITY -> Known.PRIORITY FAST -> Known.FAST + ULTRAFAST -> Known.ULTRAFAST else -> throw OpenAIInvalidDataException("Unknown ServiceTier: $value") } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentFunctionCallOutput.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentFunctionCallOutput.kt index 344857de4..2ea8dba51 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentFunctionCallOutput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentFunctionCallOutput.kt @@ -182,7 +182,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AgentFunctionCallOutput: $json") + throw OpenAIInvalidDataException("Unknown AgentFunctionCallOutput") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentFunctionCallOutputParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentFunctionCallOutputParam.kt index f52751f34..d7cfd842f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentFunctionCallOutputParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentFunctionCallOutputParam.kt @@ -185,7 +185,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AgentFunctionCallOutputParam: $json") + throw OpenAIInvalidDataException("Unknown AgentFunctionCallOutputParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentOutputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentOutputItem.kt index a13ab2c40..ada329e6d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentOutputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentOutputItem.kt @@ -506,7 +506,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AgentOutputItem: $json") + throw OpenAIInvalidDataException("Unknown AgentOutputItem") } } 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 08f58485c..bd083b522 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 @@ -1236,6 +1236,8 @@ private constructor( @JvmField val FAST = of("fast") + @JvmField val ULTRAFAST = of("ultrafast") + @JvmStatic fun of(value: String) = ServiceTier(JsonField.of(value)) } @@ -1246,6 +1248,7 @@ private constructor( FLEX, PRIORITY, FAST, + ULTRAFAST, } /** @@ -1263,6 +1266,7 @@ private constructor( FLEX, PRIORITY, FAST, + ULTRAFAST, /** * An enum member indicating that [ServiceTier] was instantiated with an unknown * value. @@ -1284,6 +1288,7 @@ private constructor( FLEX -> Value.FLEX PRIORITY -> Value.PRIORITY FAST -> Value.FAST + ULTRAFAST -> Value.ULTRAFAST else -> Value._UNKNOWN } @@ -1303,6 +1308,7 @@ private constructor( FLEX -> Known.FLEX PRIORITY -> Known.PRIORITY FAST -> Known.FAST + ULTRAFAST -> Known.ULTRAFAST else -> throw OpenAIInvalidDataException("Unknown ServiceTier: $value") } @@ -1703,7 +1709,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RequiredAction: $json") + throw OpenAIInvalidDataException("Unknown RequiredAction") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionEvent.kt index f0087011e..4ca7cfc50 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionEvent.kt @@ -1171,7 +1171,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AgentSessionEvent: $json") + throw OpenAIInvalidDataException("Unknown AgentSessionEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionInputParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionInputParam.kt index dfbae3042..955b6bc96 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionInputParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionInputParam.kt @@ -266,7 +266,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AgentSessionInputParam: $json") + throw OpenAIInvalidDataException("Unknown AgentSessionInputParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionItem.kt index 24e757ec0..486f148e3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionItem.kt @@ -571,7 +571,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AgentSessionItem: $json") + throw OpenAIInvalidDataException("Unknown AgentSessionItem") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionMessageContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionMessageContent.kt index a4aa1a291..772cd052e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionMessageContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentSessionMessageContent.kt @@ -226,7 +226,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AgentSessionMessageContent: $json") + throw OpenAIInvalidDataException("Unknown AgentSessionMessageContent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentTool.kt index 761b46abf..499a6c71f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentTool.kt @@ -254,7 +254,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AgentTool: $json") + throw OpenAIInvalidDataException("Unknown AgentTool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentToolParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentToolParam.kt index 67a469ec4..7fe5b1a39 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentToolParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/AgentToolParam.kt @@ -293,7 +293,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AgentToolParam: $json") + throw OpenAIInvalidDataException("Unknown AgentToolParam") } } 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 d57e8ad64..e802022d7 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 @@ -1267,6 +1267,9 @@ private constructor( /** Uses the fast service tier. */ @JvmField val FAST = of("fast") + /** Uses the ultrafast service tier. */ + @JvmField val ULTRAFAST = of("ultrafast") + @JvmStatic fun of(value: String) = ServiceTier(JsonField.of(value)) } @@ -1282,6 +1285,8 @@ private constructor( PRIORITY, /** Uses the fast service tier. */ FAST, + /** Uses the ultrafast service tier. */ + ULTRAFAST, } /** @@ -1304,6 +1309,8 @@ private constructor( PRIORITY, /** Uses the fast service tier. */ FAST, + /** Uses the ultrafast service tier. */ + ULTRAFAST, /** * An enum member indicating that [ServiceTier] was instantiated with an unknown value. */ @@ -1324,6 +1331,7 @@ private constructor( FLEX -> Value.FLEX PRIORITY -> Value.PRIORITY FAST -> Value.FAST + ULTRAFAST -> Value.ULTRAFAST else -> Value._UNKNOWN } @@ -1343,6 +1351,7 @@ private constructor( FLEX -> Known.FLEX PRIORITY -> Known.PRIORITY FAST -> Known.FAST + ULTRAFAST -> Known.ULTRAFAST else -> throw OpenAIInvalidDataException("Unknown ServiceTier: $value") } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/Environment.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/Environment.kt index ac45e104c..10040af69 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/Environment.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/Environment.kt @@ -228,7 +228,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Environment: $json") + throw OpenAIInvalidDataException("Unknown Environment") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/EnvironmentParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/EnvironmentParam.kt index c42bafe7f..065a57d44 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/EnvironmentParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/EnvironmentParam.kt @@ -236,7 +236,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown EnvironmentParam: $json") + throw OpenAIInvalidDataException("Unknown EnvironmentParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedEnvironmentFile.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedEnvironmentFile.kt index 5798713c0..ef90ebfd3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedEnvironmentFile.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedEnvironmentFile.kt @@ -196,7 +196,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown HostedEnvironmentFile: $json") + throw OpenAIInvalidDataException("Unknown HostedEnvironmentFile") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedEnvironmentFileParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedEnvironmentFileParam.kt index eeaaf120b..aec0709c5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedEnvironmentFileParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedEnvironmentFileParam.kt @@ -197,7 +197,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown HostedEnvironmentFileParam: $json") + throw OpenAIInvalidDataException("Unknown HostedEnvironmentFileParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedSkill.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedSkill.kt index f531413dc..dad12e962 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedSkill.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedSkill.kt @@ -198,7 +198,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown HostedSkill: $json") + throw OpenAIInvalidDataException("Unknown HostedSkill") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedSkillParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedSkillParam.kt index 31a963b1c..dfd5e43be 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedSkillParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/HostedSkillParam.kt @@ -200,7 +200,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown HostedSkillParam: $json") + throw OpenAIInvalidDataException("Unknown HostedSkillParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/InputContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/InputContent.kt index 77ba28b6f..050e51f7e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/InputContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/InputContent.kt @@ -195,7 +195,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InputContent: $json") + throw OpenAIInvalidDataException("Unknown InputContent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/InputContentParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/InputContentParam.kt index e0cd7d3e0..6d336d415 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/InputContentParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/InputContentParam.kt @@ -198,7 +198,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InputContentParam: $json") + throw OpenAIInvalidDataException("Unknown InputContentParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/McpTransport.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/McpTransport.kt index 66239356a..abe9c53cf 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/McpTransport.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/McpTransport.kt @@ -195,7 +195,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown McpTransport: $json") + throw OpenAIInvalidDataException("Unknown McpTransport") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/McpTransportParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/McpTransportParam.kt index f6eaae35f..da724f7fa 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/McpTransportParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/McpTransportParam.kt @@ -197,7 +197,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown McpTransportParam: $json") + throw OpenAIInvalidDataException("Unknown McpTransportParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedAgentTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedAgentTool.kt index a08748ee4..dd09319ef 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedAgentTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedAgentTool.kt @@ -294,7 +294,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown PersistedAgentTool: $json") + throw OpenAIInvalidDataException("Unknown PersistedAgentTool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedAgentToolParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedAgentToolParam.kt index 9eef9b483..5c12de261 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedAgentToolParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedAgentToolParam.kt @@ -295,7 +295,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown PersistedAgentToolParam: $json") + throw OpenAIInvalidDataException("Unknown PersistedAgentToolParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedMcpTransport.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedMcpTransport.kt index ccfe669fa..fba9d5fe2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedMcpTransport.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedMcpTransport.kt @@ -197,7 +197,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown PersistedMcpTransport: $json") + throw OpenAIInvalidDataException("Unknown PersistedMcpTransport") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedMcpTransportParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedMcpTransportParam.kt index 1e0ceb63e..f257a242d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedMcpTransportParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/PersistedMcpTransportParam.kt @@ -197,7 +197,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown PersistedMcpTransportParam: $json") + throw OpenAIInvalidDataException("Unknown PersistedMcpTransportParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/SessionTurnError.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/SessionTurnError.kt index e4c647940..83a7989c6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/SessionTurnError.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/SessionTurnError.kt @@ -237,6 +237,9 @@ private constructor( /** The request was rejected by a safety policy. */ @JvmField val CYBER_POLICY = of("cyber_policy") + /** The request was blocked by the safety systems. */ + @JvmField val MISALIGNMENT_POLICY_VIOLATION = of("misalignment_policy_violation") + /** The request could not connect to the model service. */ @JvmField val CONNECTION_FAILED = of("connection_failed") @@ -286,6 +289,8 @@ private constructor( SERVER_OVERLOADED, /** The request was rejected by a safety policy. */ CYBER_POLICY, + /** The request was blocked by the safety systems. */ + MISALIGNMENT_POLICY_VIOLATION, /** The request could not connect to the model service. */ CONNECTION_FAILED, /** The model service encountered an unexpected error. */ @@ -332,6 +337,8 @@ private constructor( SERVER_OVERLOADED, /** The request was rejected by a safety policy. */ CYBER_POLICY, + /** The request was blocked by the safety systems. */ + MISALIGNMENT_POLICY_VIOLATION, /** The request could not connect to the model service. */ CONNECTION_FAILED, /** The model service encountered an unexpected error. */ @@ -372,6 +379,7 @@ private constructor( RATE_LIMIT_EXCEEDED -> Value.RATE_LIMIT_EXCEEDED SERVER_OVERLOADED -> Value.SERVER_OVERLOADED CYBER_POLICY -> Value.CYBER_POLICY + MISALIGNMENT_POLICY_VIOLATION -> Value.MISALIGNMENT_POLICY_VIOLATION CONNECTION_FAILED -> Value.CONNECTION_FAILED SERVER_ERROR -> Value.SERVER_ERROR AUTHENTICATION_ERROR -> Value.AUTHENTICATION_ERROR @@ -403,6 +411,7 @@ private constructor( RATE_LIMIT_EXCEEDED -> Known.RATE_LIMIT_EXCEEDED SERVER_OVERLOADED -> Known.SERVER_OVERLOADED CYBER_POLICY -> Known.CYBER_POLICY + MISALIGNMENT_POLICY_VIOLATION -> Known.MISALIGNMENT_POLICY_VIOLATION CONNECTION_FAILED -> Known.CONNECTION_FAILED SERVER_ERROR -> Known.SERVER_ERROR AUTHENTICATION_ERROR -> Known.AUTHENTICATION_ERROR diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/TextFormat.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/TextFormat.kt index c28e30303..34c797158 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/TextFormat.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/TextFormat.kt @@ -197,7 +197,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TextFormat: $json") + throw OpenAIInvalidDataException("Unknown TextFormat") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/TextFormatParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/TextFormatParam.kt index 29dcd8769..688906882 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/TextFormatParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/TextFormatParam.kt @@ -202,7 +202,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TextFormatParam: $json") + throw OpenAIInvalidDataException("Unknown TextFormatParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/WebSearchAction.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/WebSearchAction.kt index 9b7854fdd..a24c5a8a6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/WebSearchAction.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/WebSearchAction.kt @@ -253,7 +253,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown WebSearchAction: $json") + throw OpenAIInvalidDataException("Unknown WebSearchAction") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/environments/templates/EnvironmentTemplate.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/environments/templates/EnvironmentTemplate.kt index 63830d317..38f0e8087 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/environments/templates/EnvironmentTemplate.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/environments/templates/EnvironmentTemplate.kt @@ -799,7 +799,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown File: $json") + throw OpenAIInvalidDataException("Unknown File") } } @@ -2205,7 +2205,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Skill: $json") + throw OpenAIInvalidDataException("Unknown Skill") } } 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 c1e1e43ec..99887c5c6 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 @@ -1407,6 +1407,9 @@ private constructor( /** Uses the fast service tier. */ @JvmField val FAST = of("fast") + /** Uses the ultrafast service tier. */ + @JvmField val ULTRAFAST = of("ultrafast") + @JvmStatic fun of(value: String) = ServiceTier(JsonField.of(value)) } @@ -1422,6 +1425,8 @@ private constructor( PRIORITY, /** Uses the fast service tier. */ FAST, + /** Uses the ultrafast service tier. */ + ULTRAFAST, } /** @@ -1444,6 +1449,8 @@ private constructor( PRIORITY, /** Uses the fast service tier. */ FAST, + /** Uses the ultrafast service tier. */ + ULTRAFAST, /** * An enum member indicating that [ServiceTier] was instantiated with an unknown * value. @@ -1465,6 +1472,7 @@ private constructor( FLEX -> Value.FLEX PRIORITY -> Value.PRIORITY FAST -> Value.FAST + ULTRAFAST -> Value.ULTRAFAST else -> Value._UNKNOWN } @@ -1484,6 +1492,7 @@ private constructor( FLEX -> Known.FLEX PRIORITY -> Known.PRIORITY FAST -> Known.FAST + ULTRAFAST -> Known.ULTRAFAST else -> throw OpenAIInvalidDataException("Unknown ServiceTier: $value") } @@ -1767,7 +1776,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/sessions/SessionUpdateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/sessions/SessionUpdateParams.kt index e66b2bf37..0ce8a1bdd 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/sessions/SessionUpdateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/sessions/SessionUpdateParams.kt @@ -1063,6 +1063,9 @@ private constructor( /** Uses the fast service tier. */ @JvmField val FAST = of("fast") + /** Uses the ultrafast service tier. */ + @JvmField val ULTRAFAST = of("ultrafast") + @JvmStatic fun of(value: String) = ServiceTier(JsonField.of(value)) } @@ -1078,6 +1081,8 @@ private constructor( PRIORITY, /** Uses the fast service tier. */ FAST, + /** Uses the ultrafast service tier. */ + ULTRAFAST, } /** @@ -1100,6 +1105,8 @@ private constructor( PRIORITY, /** Uses the fast service tier. */ FAST, + /** Uses the ultrafast service tier. */ + ULTRAFAST, /** * An enum member indicating that [ServiceTier] was instantiated with an unknown * value. @@ -1121,6 +1128,7 @@ private constructor( FLEX -> Value.FLEX PRIORITY -> Value.PRIORITY FAST -> Value.FAST + ULTRAFAST -> Value.ULTRAFAST else -> Value._UNKNOWN } @@ -1140,6 +1148,7 @@ private constructor( FLEX -> Known.FLEX PRIORITY -> Known.PRIORITY FAST -> Known.FAST + ULTRAFAST -> Known.ULTRAFAST else -> throw OpenAIInvalidDataException("Unknown ServiceTier: $value") } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/VaultStatusFilter.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/VaultStatusFilter.kt index 1acfb1231..0ba0fa5e3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/VaultStatusFilter.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/VaultStatusFilter.kt @@ -189,7 +189,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown VaultStatusFilter: $json") + throw OpenAIInvalidDataException("Unknown VaultStatusFilter") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/Credential.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/Credential.kt index f39fde556..b3dd9b597 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/Credential.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/Credential.kt @@ -11,6 +11,7 @@ import com.openai.core.JsonField import com.openai.core.JsonMissing import com.openai.core.JsonValue import com.openai.core.checkRequired +import com.openai.core.toImmutable import com.openai.errors.OpenAIInvalidDataException import java.util.Collections import java.util.Objects @@ -23,6 +24,7 @@ private constructor( private val id: JsonField, private val auth: JsonField, private val createdAt: JsonField, + private val metadata: JsonField, private val name: JsonField, private val object_: JsonValue, private val updatedAt: JsonField, @@ -35,11 +37,12 @@ private constructor( @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), @JsonProperty("auth") @ExcludeMissing auth: JsonField = JsonMissing.of(), @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), + @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("object") @ExcludeMissing object_: JsonValue = JsonMissing.of(), @JsonProperty("updated_at") @ExcludeMissing updatedAt: JsonField = JsonMissing.of(), @JsonProperty("vault_id") @ExcludeMissing vaultId: JsonField = JsonMissing.of(), - ) : this(id, auth, createdAt, name, object_, updatedAt, vaultId, mutableMapOf()) + ) : this(id, auth, createdAt, metadata, name, object_, updatedAt, vaultId, mutableMapOf()) /** * The ID of the credential. @@ -65,6 +68,14 @@ private constructor( */ fun createdAt(): Long = createdAt.getRequired("created_at") + /** + * Application-defined key-value pairs associated with this credential. + * + * @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 metadata(): Metadata = metadata.getRequired("metadata") + /** * The human-readable name of the credential. * @@ -123,6 +134,13 @@ private constructor( */ @JsonProperty("created_at") @ExcludeMissing fun _createdAt(): JsonField = createdAt + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata + /** * Returns the raw JSON value of [name]. * @@ -166,6 +184,7 @@ private constructor( * .id() * .auth() * .createdAt() + * .metadata() * .name() * .updatedAt() * .vaultId() @@ -180,6 +199,7 @@ private constructor( private var id: JsonField? = null private var auth: JsonField? = null private var createdAt: JsonField? = null + private var metadata: JsonField? = null private var name: JsonField? = null private var object_: JsonValue = JsonValue.from("vault.credential") private var updatedAt: JsonField? = null @@ -191,6 +211,7 @@ private constructor( id = credential.id auth = credential.auth createdAt = credential.createdAt + metadata = credential.metadata name = credential.name object_ = credential.object_ updatedAt = credential.updatedAt @@ -257,6 +278,18 @@ private constructor( */ fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + /** Application-defined key-value pairs associated with this credential. */ + fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [Metadata] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + /** The human-readable name of the credential. */ fun name(name: String) = name(JsonField.of(name)) @@ -333,6 +366,7 @@ private constructor( * .id() * .auth() * .createdAt() + * .metadata() * .name() * .updatedAt() * .vaultId() @@ -345,6 +379,7 @@ private constructor( checkRequired("id", id), checkRequired("auth", auth), checkRequired("createdAt", createdAt), + checkRequired("metadata", metadata), checkRequired("name", name), object_, checkRequired("updatedAt", updatedAt), @@ -371,6 +406,7 @@ private constructor( id() auth().validate() createdAt() + metadata().validate() name() _object_().let { if (it != JsonValue.from("vault.credential")) { @@ -400,11 +436,121 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (auth.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (name.asKnown().isPresent) 1 else 0) + object_.let { if (it == JsonValue.from("vault.credential")) 1 else 0 } + (if (updatedAt.asKnown().isPresent) 1 else 0) + (if (vaultId.asKnown().isPresent) 1 else 0) + /** Application-defined key-value pairs associated with this credential. */ + class Metadata + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Metadata]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metadata: Metadata) = apply { + additionalProperties = metadata.additionalProperties.toMutableMap() + } + + 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 [Metadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + } + + 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(): Metadata = apply { + if (validated) { + return@apply + } + + 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 = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Metadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -414,6 +560,7 @@ private constructor( id == other.id && auth == other.auth && createdAt == other.createdAt && + metadata == other.metadata && name == other.name && object_ == other.object_ && updatedAt == other.updatedAt && @@ -422,11 +569,21 @@ private constructor( } private val hashCode: Int by lazy { - Objects.hash(id, auth, createdAt, name, object_, updatedAt, vaultId, additionalProperties) + Objects.hash( + id, + auth, + createdAt, + metadata, + name, + object_, + updatedAt, + vaultId, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "Credential{id=$id, auth=$auth, createdAt=$createdAt, name=$name, object_=$object_, updatedAt=$updatedAt, vaultId=$vaultId, additionalProperties=$additionalProperties}" + "Credential{id=$id, auth=$auth, createdAt=$createdAt, metadata=$metadata, name=$name, object_=$object_, updatedAt=$updatedAt, vaultId=$vaultId, additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuth.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuth.kt index 553e4cad0..fe770e72a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuth.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuth.kt @@ -261,7 +261,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown CredentialAuth: ${redactSecretValue(json)}") + throw OpenAIInvalidDataException("Unknown CredentialAuth") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthCreateParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthCreateParam.kt index 6eefb7e77..9ad24b0a6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthCreateParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthCreateParam.kt @@ -264,9 +264,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException( - "Unknown CredentialAuthCreateParam: ${redactSecretValue(json)}" - ) + throw OpenAIInvalidDataException("Unknown CredentialAuthCreateParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParam.kt index 160e8a390..2a70ced7b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParam.kt @@ -255,9 +255,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException( - "Unknown CredentialAuthRotateParam: ${redactSecretValue(json)}" - ) + throw OpenAIInvalidDataException("Unknown CredentialAuthRotateParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialCreateParams.kt index ccaa972d8..e21814715 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialCreateParams.kt @@ -14,6 +14,7 @@ import com.openai.core.Params import com.openai.core.checkRequired import com.openai.core.http.Headers import com.openai.core.http.QueryParams +import com.openai.core.toImmutable import com.openai.errors.OpenAIInvalidDataException import java.util.Collections import java.util.Objects @@ -50,6 +51,15 @@ private constructor( */ fun name(): String = body.name() + /** + * Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. Defaults + * to an empty map. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metadata(): Optional = body.metadata() + /** * Returns the raw JSON value of [auth]. * @@ -64,6 +74,13 @@ private constructor( */ fun _name(): JsonField = body._name() + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _metadata(): JsonField = body._metadata() + fun _additionalBodyProperties(): Map = body._additionalProperties() /** Additional headers to send with the request. */ @@ -116,6 +133,7 @@ private constructor( * Otherwise, it's more convenient to use the top-level setters instead: * - [auth] * - [name] + * - [metadata] */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -162,6 +180,21 @@ private constructor( */ fun name(name: JsonField) = apply { body.name(name) } + /** + * Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. + * Defaults to an empty map. + */ + fun metadata(metadata: Metadata) = apply { body.metadata(metadata) } + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [Metadata] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun metadata(metadata: JsonField) = apply { body.metadata(metadata) } + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) } @@ -319,6 +352,7 @@ private constructor( private constructor( private val auth: JsonField, private val name: JsonField, + private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -328,7 +362,10 @@ private constructor( @ExcludeMissing auth: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), - ) : this(auth, name, mutableMapOf()) + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + ) : this(auth, name, metadata, mutableMapOf()) /** * The authentication method and write-only secret values to store. @@ -346,6 +383,15 @@ private constructor( */ fun name(): String = name.getRequired("name") + /** + * Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. + * Defaults to an empty map. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metadata(): Optional = metadata.getOptional("metadata") + /** * Returns the raw JSON value of [auth]. * @@ -362,6 +408,13 @@ private constructor( */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -393,12 +446,14 @@ private constructor( private var auth: JsonField? = null private var name: JsonField? = null + private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { auth = body.auth name = body.name + metadata = body.metadata additionalProperties = body.additionalProperties.toMutableMap() } @@ -447,6 +502,21 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } + /** + * Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. + * Defaults to an empty map. + */ + fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [Metadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -483,6 +553,7 @@ private constructor( Body( checkRequired("auth", auth), checkRequired("name", name), + metadata, additionalProperties.toMutableMap(), ) } @@ -505,6 +576,7 @@ private constructor( auth().validate() name() + metadata().ifPresent { it.validate() } validated = true } @@ -524,7 +596,9 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (auth.asKnown().getOrNull()?.validity() ?: 0) + (if (name.asKnown().isPresent) 1 else 0) + (auth.asKnown().getOrNull()?.validity() ?: 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -534,15 +608,130 @@ private constructor( return other is Body && auth == other.auth && name == other.name && + metadata == other.metadata && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(auth, name, additionalProperties) } + private val hashCode: Int by lazy { + Objects.hash(auth, name, metadata, additionalProperties) + } override fun hashCode(): Int = hashCode override fun toString() = - "Body{auth=$auth, name=$name, additionalProperties=$additionalProperties}" + "Body{auth=$auth, name=$name, metadata=$metadata, additionalProperties=$additionalProperties}" + } + + /** + * Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. Defaults + * to an empty map. + */ + class Metadata + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Metadata]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metadata: Metadata) = apply { + additionalProperties = metadata.additionalProperties.toMutableMap() + } + + 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 [Metadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + } + + 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(): Metadata = apply { + if (validated) { + return@apply + } + + 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 = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Metadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialNetworking.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialNetworking.kt index cf4aec94f..9a82ada95 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialNetworking.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialNetworking.kt @@ -239,7 +239,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown CredentialNetworking: $json") + throw OpenAIInvalidDataException("Unknown CredentialNetworking") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialNetworkingParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialNetworkingParam.kt index ec578c0ce..e8bcd7c6e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialNetworkingParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialNetworkingParam.kt @@ -241,7 +241,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown CredentialNetworkingParam: $json") + throw OpenAIInvalidDataException("Unknown CredentialNetworkingParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialUpdateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialUpdateParams.kt index 660e75acd..5a2f1c2e3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialUpdateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialUpdateParams.kt @@ -14,6 +14,7 @@ import com.openai.core.Params import com.openai.core.checkRequired import com.openai.core.http.Headers import com.openai.core.http.QueryParams +import com.openai.core.toImmutable import com.openai.errors.OpenAIInvalidDataException import java.util.Collections import java.util.Objects @@ -21,7 +22,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** - * Rotates a vault credential's write-only secret and returns only credential metadata. See + * Updates credential metadata or rotates its write-only secret. See * [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults). */ class CredentialUpdateParams @@ -40,10 +41,19 @@ private constructor( /** * Replacement values for the credential's existing authentication method. * - * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun auth(): CredentialAuthRotateParam = body.auth() + fun auth(): Optional = body.auth() + + /** + * Replaces all metadata. Omit to preserve it, or pass {} to clear it. Up to 16 string key-value + * pairs, with keys up to 64 and values up to 512 characters. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metadata(): Optional = body.metadata() /** * Returns the raw JSON value of [auth]. @@ -52,6 +62,13 @@ private constructor( */ fun _auth(): JsonField = body._auth() + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _metadata(): JsonField = body._metadata() + fun _additionalBodyProperties(): Map = body._additionalProperties() /** Additional headers to send with the request. */ @@ -70,7 +87,6 @@ private constructor( * The following fields are required: * ```java * .vaultId() - * .auth() * ``` */ @JvmStatic fun builder() = Builder() @@ -107,6 +123,7 @@ 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: * - [auth] + * - [metadata] */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -162,6 +179,21 @@ private constructor( body.environmentVariableAuth(secretValue) } + /** + * Replaces all metadata. Omit to preserve it, or pass {} to clear it. Up to 16 string + * key-value pairs, with keys up to 64 and values up to 512 characters. + */ + fun metadata(metadata: Metadata) = apply { body.metadata(metadata) } + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [Metadata] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun metadata(metadata: JsonField) = apply { body.metadata(metadata) } + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) } @@ -287,7 +319,6 @@ private constructor( * The following fields are required: * ```java * .vaultId() - * .auth() * ``` * * @throws IllegalStateException if any required field is unset. @@ -315,11 +346,15 @@ private constructor( override fun _queryParams(): QueryParams = additionalQueryParams - /** Secret, expiry, and OAuth refresh scope updates for an existing vault credential. */ + /** + * Metadata, secret, expiry, and OAuth refresh scope updates for an existing vault credential. + * Supply at least one of `auth` or `metadata`. + */ class Body @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val auth: JsonField, + private val metadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -327,16 +362,28 @@ private constructor( private constructor( @JsonProperty("auth") @ExcludeMissing - auth: JsonField = JsonMissing.of() - ) : this(auth, mutableMapOf()) + auth: JsonField = JsonMissing.of(), + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + ) : this(auth, metadata, mutableMapOf()) /** * Replacement values for the credential's existing authentication method. * - * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun auth(): Optional = auth.getOptional("auth") + + /** + * Replaces all metadata. Omit to preserve it, or pass {} to clear it. Up to 16 string + * key-value pairs, with keys up to 64 and values up to 512 characters. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun auth(): CredentialAuthRotateParam = auth.getRequired("auth") + fun metadata(): Optional = metadata.getOptional("metadata") /** * Returns the raw JSON value of [auth]. @@ -347,6 +394,13 @@ private constructor( @ExcludeMissing fun _auth(): JsonField = auth + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -361,26 +415,21 @@ private constructor( companion object { - /** - * Returns a mutable builder for constructing an instance of [Body]. - * - * The following fields are required: - * ```java - * .auth() - * ``` - */ + /** Returns a mutable builder for constructing an instance of [Body]. */ @JvmStatic fun builder() = Builder() } /** A builder for [Body]. */ class Builder internal constructor() { - private var auth: JsonField? = null + private var auth: JsonField = JsonMissing.of() + private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { auth = body.auth + metadata = body.metadata additionalProperties = body.additionalProperties.toMutableMap() } @@ -440,6 +489,21 @@ private constructor( .build() ) + /** + * Replaces all metadata. Omit to preserve it, or pass {} to clear it. Up to 16 string + * key-value pairs, with keys up to 64 and values up to 512 characters. + */ + fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [Metadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -463,16 +527,8 @@ private constructor( * Returns an immutable instance of [Body]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .auth() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ - fun build(): Body = - Body(checkRequired("auth", auth), additionalProperties.toMutableMap()) + fun build(): Body = Body(auth, metadata, additionalProperties.toMutableMap()) } private var validated: Boolean = false @@ -491,7 +547,8 @@ private constructor( return@apply } - auth().validate() + auth().ifPresent { it.validate() } + metadata().ifPresent { it.validate() } validated = true } @@ -509,7 +566,10 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = (auth.asKnown().getOrNull()?.validity() ?: 0) + @JvmSynthetic + internal fun validity(): Int = + (auth.asKnown().getOrNull()?.validity() ?: 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -518,14 +578,128 @@ private constructor( return other is Body && auth == other.auth && + metadata == other.metadata && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(auth, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(auth, metadata, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{auth=$auth, metadata=$metadata, additionalProperties=$additionalProperties}" + } + + /** + * Replaces all metadata. Omit to preserve it, or pass {} to clear it. Up to 16 string key-value + * pairs, with keys up to 64 and values up to 512 characters. + */ + class Metadata + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Metadata]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metadata: Metadata) = apply { + additionalProperties = metadata.additionalProperties.toMutableMap() + } + + 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 [Metadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + } + + 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(): Metadata = apply { + if (validated) { + return@apply + } + + 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 = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Metadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } override fun hashCode(): Int = hashCode - override fun toString() = "Body{auth=$auth, additionalProperties=$additionalProperties}" + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuth.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuth.kt index ce4c4cfc0..49871aeb1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuth.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuth.kt @@ -246,7 +246,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown McpOAuthTokenEndpointAuth: $json") + throw OpenAIInvalidDataException("Unknown McpOAuthTokenEndpointAuth") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuthCreateParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuthCreateParam.kt index e4d2b692d..3d51071e7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuthCreateParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuthCreateParam.kt @@ -236,7 +236,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown McpOAuthTokenEndpointAuthCreateParam: $json") + throw OpenAIInvalidDataException("Unknown McpOAuthTokenEndpointAuthCreateParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuthRotateParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuthRotateParam.kt index c54cc971c..d2762aad2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuthRotateParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/McpOAuthTokenEndpointAuthRotateParam.kt @@ -204,7 +204,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown McpOAuthTokenEndpointAuthRotateParam: $json") + throw OpenAIInvalidDataException("Unknown McpOAuthTokenEndpointAuthRotateParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantCreateParams.kt index 6bdf4f02d..9315aca48 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantCreateParams.kt @@ -2778,7 +2778,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ChunkingStrategy: $json") + throw OpenAIInvalidDataException("Unknown ChunkingStrategy") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantStreamEvent.kt index e59ab2e93..106632f2a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantStreamEvent.kt @@ -1227,7 +1227,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AssistantStreamEvent: $json") + throw OpenAIInvalidDataException("Unknown AssistantStreamEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantTool.kt index 40137a0db..2182a61b6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantTool.kt @@ -201,7 +201,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AssistantTool: $json") + throw OpenAIInvalidDataException("Unknown AssistantTool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/MessageStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/MessageStreamEvent.kt index b5ec76094..6a7bb0075 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/MessageStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/MessageStreamEvent.kt @@ -383,7 +383,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown MessageStreamEvent: $json") + throw OpenAIInvalidDataException("Unknown MessageStreamEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/RunStepStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/RunStepStreamEvent.kt index f5438c687..efcf7ab87 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/RunStepStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/RunStepStreamEvent.kt @@ -467,7 +467,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RunStepStreamEvent: $json") + throw OpenAIInvalidDataException("Unknown RunStepStreamEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/RunStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/RunStreamEvent.kt index a7114ecb3..f2e956735 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/RunStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/RunStreamEvent.kt @@ -555,7 +555,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RunStreamEvent: $json") + throw OpenAIInvalidDataException("Unknown RunStreamEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitResponseOutputText.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitResponseOutputText.kt index 004b6fc0c..3c14bdcad 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitResponseOutputText.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitResponseOutputText.kt @@ -468,7 +468,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Annotation: $json") + throw OpenAIInvalidDataException("Unknown Annotation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThread.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThread.kt index ef5c0a3dc..5583130c9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThread.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThread.kt @@ -597,7 +597,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Status: $json") + throw OpenAIInvalidDataException("Unknown Status") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThreadItemList.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThreadItemList.kt index c8038b2fa..fbb7a3247 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThreadItemList.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThreadItemList.kt @@ -679,7 +679,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Data: $json") + throw OpenAIInvalidDataException("Unknown Data") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThreadUserMessageItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThreadUserMessageItem.kt index 130a7b803..6361ba8bd 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThreadUserMessageItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/chatkit/threads/ChatKitThreadUserMessageItem.kt @@ -689,7 +689,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaComputerAction.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaComputerAction.kt index 787668c90..eee1da49a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaComputerAction.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaComputerAction.kt @@ -386,7 +386,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaComputerAction: $json") + throw OpenAIInvalidDataException("Unknown BetaComputerAction") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaContainerAuto.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaContainerAuto.kt index f4151a44d..8aff6ca48 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaContainerAuto.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaContainerAuto.kt @@ -709,7 +709,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown NetworkPolicy: $json") + throw OpenAIInvalidDataException("Unknown NetworkPolicy") } } @@ -918,7 +918,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Skill: $json") + throw OpenAIInvalidDataException("Unknown Skill") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaCustomTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaCustomTool.kt index 3e9dc2781..3b747a219 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaCustomTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaCustomTool.kt @@ -741,7 +741,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Format: $json") + throw OpenAIInvalidDataException("Unknown Format") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaEasyInputMessage.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaEasyInputMessage.kt index 7fcbb1c98..7bb0fd691 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaEasyInputMessage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaEasyInputMessage.kt @@ -511,7 +511,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaFileSearchTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaFileSearchTool.kt index 566cea6ad..1d8a3ef3e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaFileSearchTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaFileSearchTool.kt @@ -559,7 +559,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Filters: $json") + throw OpenAIInvalidDataException("Unknown Filters") } } @@ -1288,7 +1288,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Value: $json") + throw OpenAIInvalidDataException("Unknown Value") } } @@ -1517,9 +1517,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException( - "Unknown ComparisonFilterValueItem: $json" - ) + throw OpenAIInvalidDataException("Unknown ComparisonFilterValueItem") } } @@ -2011,7 +2009,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Filter: $json") + throw OpenAIInvalidDataException("Unknown Filter") } } @@ -2769,7 +2767,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Value: $json") + throw OpenAIInvalidDataException("Unknown Value") } } @@ -3012,7 +3010,7 @@ private constructor( */ fun unknown(json: JsonValue?): T { throw OpenAIInvalidDataException( - "Unknown ComparisonFilterValueItem: $json" + "Unknown ComparisonFilterValueItem" ) } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaFunctionShellTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaFunctionShellTool.kt index a9bfa3952..cec35bab0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaFunctionShellTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaFunctionShellTool.kt @@ -625,7 +625,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Environment: $json") + throw OpenAIInvalidDataException("Unknown Environment") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaMcpToolCallError.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaMcpToolCallError.kt index b2b84bf94..7483599cf 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaMcpToolCallError.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaMcpToolCallError.kt @@ -215,7 +215,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaMcpToolCallError: $json") + throw OpenAIInvalidDataException("Unknown BetaMcpToolCallError") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaNamespaceTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaNamespaceTool.kt index 44a794187..6550f94f2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaNamespaceTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaNamespaceTool.kt @@ -504,7 +504,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponse.kt index bebd13aef..3e04aeccc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponse.kt @@ -19,6 +19,7 @@ import com.openai.core.Enum import com.openai.core.ExcludeMissing import com.openai.core.JsonField import com.openai.core.JsonMissing +import com.openai.core.JsonNull import com.openai.core.JsonValue import com.openai.core.allMaxBy import com.openai.core.checkKnown @@ -35,6 +36,7 @@ class BetaResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val id: JsonField, + private val accessPrograms: JsonField, private val createdAt: JsonField, private val error: JsonField, private val incompleteDetails: JsonField, @@ -75,6 +77,9 @@ private constructor( @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("access_programs") + @ExcludeMissing + accessPrograms: JsonField = JsonMissing.of(), @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), @JsonProperty("error") @ExcludeMissing @@ -165,6 +170,7 @@ private constructor( @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), ) : this( id, + accessPrograms, createdAt, error, incompleteDetails, @@ -210,6 +216,12 @@ private constructor( */ fun id(): String = id.getRequired("id") + /** + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accessPrograms(): Optional = accessPrograms.getOptional("access_programs") + /** * Unix timestamp (in seconds) of when this Response was created. * @@ -604,6 +616,15 @@ private constructor( */ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + /** + * Returns the raw JSON value of [accessPrograms]. + * + * Unlike [accessPrograms], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("access_programs") + @ExcludeMissing + fun _accessPrograms(): JsonField = accessPrograms + /** * Returns the raw JSON value of [createdAt]. * @@ -923,6 +944,7 @@ private constructor( class Builder internal constructor() { private var id: JsonField? = null + private var accessPrograms: JsonField? = JsonNull.of() private var createdAt: JsonField? = null private var error: JsonField? = null private var incompleteDetails: JsonField? = null @@ -962,6 +984,7 @@ private constructor( @JvmSynthetic internal fun from(betaResponse: BetaResponse) = apply { id = betaResponse.id + accessPrograms = betaResponse.accessPrograms createdAt = betaResponse.createdAt error = betaResponse.error incompleteDetails = betaResponse.incompleteDetails @@ -1010,6 +1033,24 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } + fun accessPrograms(accessPrograms: AccessPrograms?) = + accessPrograms(JsonField.ofNullable(accessPrograms)) + + /** Alias for calling [Builder.accessPrograms] with `accessPrograms.orElse(null)`. */ + fun accessPrograms(accessPrograms: Optional) = + accessPrograms(accessPrograms.getOrNull()) + + /** + * Sets [Builder.accessPrograms] to an arbitrary JSON value. + * + * You should usually call [Builder.accessPrograms] with a well-typed [AccessPrograms] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accessPrograms(accessPrograms: JsonField) = apply { + this.accessPrograms = accessPrograms + } + /** Unix timestamp (in seconds) of when this Response was created. */ fun createdAt(createdAt: Double) = createdAt(JsonField.of(createdAt)) @@ -2228,6 +2269,7 @@ private constructor( fun build(): BetaResponse = BetaResponse( checkRequired("id", id), + checkRequired("accessPrograms", accessPrograms), checkRequired("createdAt", createdAt), checkRequired("error", error), checkRequired("incompleteDetails", incompleteDetails), @@ -2282,6 +2324,7 @@ private constructor( } id() + accessPrograms().ifPresent { it.validate() } createdAt() error().ifPresent { it.validate() } incompleteDetails().ifPresent { it.validate() } @@ -2339,6 +2382,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (id.asKnown().isPresent) 1 else 0) + + (accessPrograms.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (error.asKnown().getOrNull()?.validity() ?: 0) + (incompleteDetails.asKnown().getOrNull()?.validity() ?: 0) + @@ -2374,6 +2418,317 @@ private constructor( (usage.asKnown().getOrNull()?.validity() ?: 0) + (if (user.asKnown().isPresent) 1 else 0) + class AccessPrograms + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cyber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("cyber") @ExcludeMissing cyber: JsonField = JsonMissing.of() + ) : this(cyber, mutableMapOf()) + + /** + * The effective Cyber access program used for this response. + * + * @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 cyber(): Cyber = cyber.getRequired("cyber") + + /** + * Returns the raw JSON value of [cyber]. + * + * Unlike [cyber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("cyber") @ExcludeMissing fun _cyber(): JsonField = cyber + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AccessPrograms]. + * + * The following fields are required: + * ```java + * .cyber() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccessPrograms]. */ + class Builder internal constructor() { + + private var cyber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(accessPrograms: AccessPrograms) = apply { + cyber = accessPrograms.cyber + additionalProperties = accessPrograms.additionalProperties.toMutableMap() + } + + /** The effective Cyber access program used for this response. */ + fun cyber(cyber: Cyber) = cyber(JsonField.of(cyber)) + + /** + * Sets [Builder.cyber] to an arbitrary JSON value. + * + * You should usually call [Builder.cyber] with a well-typed [Cyber] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun cyber(cyber: JsonField) = apply { this.cyber = cyber } + + 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 [AccessPrograms]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .cyber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AccessPrograms = + AccessPrograms(checkRequired("cyber", cyber), 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(): AccessPrograms = apply { + if (validated) { + return@apply + } + + cyber().validate() + 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 = (cyber.asKnown().getOrNull()?.validity() ?: 0) + + /** The effective Cyber access program used for this response. */ + class Cyber @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val STANDARD = of("standard") + + @JvmField val DAYBREAK_BLUE = of("daybreak_blue") + + @JvmField val DAYBREAK_RED = of("daybreak_red") + + @JvmStatic fun of(value: String) = Cyber(JsonField.of(value)) + } + + /** An enum containing [Cyber]'s known values. */ + enum class Known { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + } + + /** + * An enum containing [Cyber]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cyber] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + /** + * An enum member indicating that [Cyber] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + STANDARD -> Value.STANDARD + DAYBREAK_BLUE -> Value.DAYBREAK_BLUE + DAYBREAK_RED -> Value.DAYBREAK_RED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OpenAIInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + STANDARD -> Known.STANDARD + DAYBREAK_BLUE -> Known.DAYBREAK_BLUE + DAYBREAK_RED -> Known.DAYBREAK_RED + else -> throw OpenAIInvalidDataException("Unknown Cyber: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OpenAIInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + OpenAIInvalidDataException("Value is not a String") + } + + 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(): Cyber = apply { + if (validated) { + return@apply + } + + known() + 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 (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Cyber && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccessPrograms && + cyber == other.cyber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(cyber, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AccessPrograms{cyber=$cyber, additionalProperties=$additionalProperties}" + } + /** Details about why the response is incomplete. */ class IncompleteDetails @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2873,7 +3228,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Instructions: $json") + throw OpenAIInvalidDataException("Unknown Instructions") } } @@ -4325,7 +4680,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } @@ -4974,7 +5329,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } @@ -6258,7 +6613,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } @@ -7637,7 +7992,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown PromptCacheDiagnostics: $json") + throw OpenAIInvalidDataException("Unknown PromptCacheDiagnostics") } } @@ -10398,6 +10753,7 @@ private constructor( return other is BetaResponse && id == other.id && + accessPrograms == other.accessPrograms && createdAt == other.createdAt && error == other.error && incompleteDetails == other.incompleteDetails && @@ -10438,6 +10794,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( id, + accessPrograms, createdAt, error, incompleteDetails, @@ -10479,5 +10836,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BetaResponse{id=$id, createdAt=$createdAt, error=$error, incompleteDetails=$incompleteDetails, instructions=$instructions, metadata=$metadata, model=$model, object_=$object_, output=$output, parallelToolCalls=$parallelToolCalls, temperature=$temperature, toolChoice=$toolChoice, tools=$tools, topP=$topP, background=$background, completedAt=$completedAt, conversation=$conversation, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, moderation=$moderation, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheDiagnostics=$promptCacheDiagnostics, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, status=$status, text=$text, topLogprobs=$topLogprobs, truncation=$truncation, usage=$usage, user=$user, additionalProperties=$additionalProperties}" + "BetaResponse{id=$id, accessPrograms=$accessPrograms, createdAt=$createdAt, error=$error, incompleteDetails=$incompleteDetails, instructions=$instructions, metadata=$metadata, model=$model, object_=$object_, output=$output, parallelToolCalls=$parallelToolCalls, temperature=$temperature, toolChoice=$toolChoice, tools=$tools, topP=$topP, background=$background, completedAt=$completedAt, conversation=$conversation, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, moderation=$moderation, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheDiagnostics=$promptCacheDiagnostics, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, status=$status, text=$text, topLogprobs=$topLogprobs, truncation=$truncation, usage=$usage, user=$user, additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCall.kt index cae9fe436..1d1580529 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCall.kt @@ -668,7 +668,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Operation: $json") + throw OpenAIInvalidDataException("Unknown Operation") } } @@ -1912,7 +1912,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCallOutput.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCallOutput.kt index a9fb94c98..d365c0456 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCallOutput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCallOutput.kt @@ -919,7 +919,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterToolCall.kt index 73ca7359e..b31ff60a5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterToolCall.kt @@ -627,7 +627,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContent.kt index 320539984..69a51854a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContent.kt @@ -322,7 +322,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponseContent: $json") + throw OpenAIInvalidDataException("Unknown BetaResponseContent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContentPartAddedEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContentPartAddedEvent.kt index 920df3039..8eeee749c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContentPartAddedEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContentPartAddedEvent.kt @@ -636,7 +636,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Part: $json") + throw OpenAIInvalidDataException("Unknown Part") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContentPartDoneEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContentPartDoneEvent.kt index b4818751e..5865d706d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContentPartDoneEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContentPartDoneEvent.kt @@ -636,7 +636,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Part: $json") + throw OpenAIInvalidDataException("Unknown Part") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCall.kt index ce01a4eeb..0e9068feb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCall.kt @@ -808,7 +808,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallOutput.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallOutput.kt index 5fbcc3ef8..d4ec634cb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallOutput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallOutput.kt @@ -564,7 +564,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } @@ -838,9 +838,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException( - "Unknown BetaFunctionAndCustomToolCallOutput: $json" - ) + throw OpenAIInvalidDataException("Unknown BetaFunctionAndCustomToolCallOutput") } } @@ -1248,7 +1246,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFormatTextConfig.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFormatTextConfig.kt index b1e72e2d9..190cb5008 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFormatTextConfig.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFormatTextConfig.kt @@ -276,7 +276,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponseFormatTextConfig: $json") + throw OpenAIInvalidDataException("Unknown BetaResponseFormatTextConfig") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionCallOutputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionCallOutputItem.kt index 89c79cee5..9e85bc82d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionCallOutputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionCallOutputItem.kt @@ -233,7 +233,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponseFunctionCallOutputItem: $json") + throw OpenAIInvalidDataException("Unknown BetaResponseFunctionCallOutputItem") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellCallOutputContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellCallOutputContent.kt index 2d7a7dc0e..51092746e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellCallOutputContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellCallOutputContent.kt @@ -446,7 +446,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Outcome: $json") + throw OpenAIInvalidDataException("Unknown Outcome") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCall.kt index 8d9ae4a30..7c7a5c00b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCall.kt @@ -997,7 +997,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Environment: $json") + throw OpenAIInvalidDataException("Unknown Environment") } } @@ -1520,7 +1520,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCallOutput.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCallOutput.kt index 4cef555ba..fd1b96ab2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCallOutput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCallOutput.kt @@ -1000,7 +1000,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Outcome: $json") + throw OpenAIInvalidDataException("Unknown Outcome") } } @@ -1764,7 +1764,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCall.kt index 04e84a6ab..be0e21908 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCall.kt @@ -863,7 +863,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItem.kt index 679050849..fbd6224e0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItem.kt @@ -717,7 +717,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } @@ -991,9 +991,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException( - "Unknown BetaFunctionAndCustomToolCallOutput: $json" - ) + throw OpenAIInvalidDataException("Unknown BetaFunctionAndCustomToolCallOutput") } } @@ -1545,7 +1543,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionWebSearch.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionWebSearch.kt index e8bb140e0..f0df5bbfe 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionWebSearch.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionWebSearch.kt @@ -538,7 +538,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Action: $json") + throw OpenAIInvalidDataException("Unknown Action") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputContent.kt index 907bdd658..02b900273 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputContent.kt @@ -231,7 +231,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponseInputContent: $json") + throw OpenAIInvalidDataException("Unknown BetaResponseInputContent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt index 7e280d183..2bd811fb2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt @@ -1335,7 +1335,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponseInputItem: $json") + throw OpenAIInvalidDataException("Unknown BetaResponseInputItem") } } @@ -4350,7 +4350,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } @@ -4762,7 +4762,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } @@ -5835,7 +5835,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } @@ -8016,7 +8016,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Annotation: $json") + throw OpenAIInvalidDataException("Unknown Annotation") } } @@ -15570,7 +15570,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } @@ -16011,7 +16011,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Environment: $json") + throw OpenAIInvalidDataException("Unknown Environment") } } @@ -17069,7 +17069,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } @@ -18139,7 +18139,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Operation: $json") + throw OpenAIInvalidDataException("Unknown Operation") } } @@ -19422,7 +19422,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } @@ -20606,7 +20606,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseItem.kt index fb5681838..0b7ab9263 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseItem.kt @@ -1217,7 +1217,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponseItem: $json") + throw OpenAIInvalidDataException("Unknown BetaResponseItem") } } @@ -2397,7 +2397,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputItem.kt index 4f8444f8f..0c5ffe90b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputItem.kt @@ -1128,7 +1128,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponseOutputItem: $json") + throw OpenAIInvalidDataException("Unknown BetaResponseOutputItem") } } @@ -2270,7 +2270,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputMessage.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputMessage.kt index b1afc665a..ec6fddf40 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputMessage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputMessage.kt @@ -618,7 +618,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputText.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputText.kt index 10981edae..926026f0d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputText.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputText.kt @@ -570,7 +570,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Annotation: $json") + throw OpenAIInvalidDataException("Unknown Annotation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputTextAnnotationAddedEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputTextAnnotationAddedEvent.kt index f082ff287..c96f8a620 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputTextAnnotationAddedEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputTextAnnotationAddedEvent.kt @@ -723,7 +723,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Annotation: $json") + throw OpenAIInvalidDataException("Unknown Annotation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseShellCallOutputContentDoneEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseShellCallOutputContentDoneEvent.kt index 0693984ed..a70258456 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseShellCallOutputContentDoneEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseShellCallOutputContentDoneEvent.kt @@ -893,7 +893,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Outcome: $json") + throw OpenAIInvalidDataException("Unknown Outcome") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerInput.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerInput.kt index cd231ec2e..de2c77efc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerInput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerInput.kt @@ -220,7 +220,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponseSteerInput: $json") + throw OpenAIInvalidDataException("Unknown BetaResponseSteerInput") } } @@ -446,7 +446,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseSteerInputItem: $json") + throw OpenAIInvalidDataException("Unknown ResponseSteerInputItem") } } @@ -1042,7 +1042,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } @@ -2038,7 +2038,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } @@ -2456,7 +2456,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerInputContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerInputContent.kt index 8c8cd23f9..10ab59f44 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerInputContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerInputContent.kt @@ -233,7 +233,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponseSteerInputContent: $json") + throw OpenAIInvalidDataException("Unknown BetaResponseSteerInputContent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerRequiredInput.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerRequiredInput.kt index fa772ce4a..85c88e3ff 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerRequiredInput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseSteerRequiredInput.kt @@ -439,7 +439,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponseSteerRequiredInput: $json") + throw OpenAIInvalidDataException("Unknown BetaResponseSteerRequiredInput") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseStreamEvent.kt index 8b9193bf1..e39a9a079 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseStreamEvent.kt @@ -2532,7 +2532,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponseStreamEvent: $json") + throw OpenAIInvalidDataException("Unknown BetaResponseStreamEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesClientEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesClientEvent.kt index c0c407997..5c81ff270 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesClientEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesClientEvent.kt @@ -390,7 +390,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponsesClientEvent: $json") + throw OpenAIInvalidDataException("Unknown BetaResponsesClientEvent") } } @@ -455,6 +455,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val type: JsonValue, + private val accessPrograms: JsonField, private val background: JsonField, private val contextManagement: JsonField>, private val conversation: JsonField, @@ -494,6 +495,9 @@ private constructor( @JsonCreator private constructor( @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(), + @JsonProperty("access_programs") + @ExcludeMissing + accessPrograms: JsonField = JsonMissing.of(), @JsonProperty("background") @ExcludeMissing background: JsonField = JsonMissing.of(), @@ -583,6 +587,7 @@ private constructor( @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), ) : this( type, + accessPrograms, background, contextManagement, conversation, @@ -632,6 +637,15 @@ private constructor( */ @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type + /** + * Domain-specific access programs to use for this request. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accessPrograms(): Optional = + accessPrograms.getOptional("access_programs") + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -1041,6 +1055,16 @@ private constructor( */ @Deprecated("deprecated") fun user(): Optional = user.getOptional("user") + /** + * Returns the raw JSON value of [accessPrograms]. + * + * Unlike [accessPrograms], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("access_programs") + @ExcludeMissing + fun _accessPrograms(): JsonField = accessPrograms + /** * Returns the raw JSON value of [background]. * @@ -1357,6 +1381,7 @@ private constructor( class Builder internal constructor() { private var type: JsonValue = JsonValue.from("response.create") + private var accessPrograms: JsonField = JsonMissing.of() private var background: JsonField = JsonMissing.of() private var contextManagement: JsonField>? = null private var conversation: JsonField = JsonMissing.of() @@ -1395,6 +1420,7 @@ private constructor( @JvmSynthetic internal fun from(responseCreate: ResponseCreate) = apply { type = responseCreate.type + accessPrograms = responseCreate.accessPrograms background = responseCreate.background contextManagement = responseCreate.contextManagement.map { it.toMutableList() } conversation = responseCreate.conversation @@ -1445,6 +1471,21 @@ private constructor( */ fun type(type: JsonValue) = apply { this.type = type } + /** Domain-specific access programs to use for this request. */ + fun accessPrograms(accessPrograms: AccessPrograms) = + accessPrograms(JsonField.of(accessPrograms)) + + /** + * Sets [Builder.accessPrograms] to an arbitrary JSON value. + * + * You should usually call [Builder.accessPrograms] with a well-typed [AccessPrograms] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun accessPrograms(accessPrograms: JsonField) = apply { + this.accessPrograms = accessPrograms + } + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -2539,6 +2580,7 @@ private constructor( fun build(): ResponseCreate = ResponseCreate( type, + accessPrograms, background, (contextManagement ?: JsonMissing.of()).map { it.toImmutable() }, conversation, @@ -2597,6 +2639,7 @@ private constructor( throw OpenAIInvalidDataException("'type' is invalid, received $it") } } + accessPrograms().ifPresent { it.validate() } background() contextManagement().ifPresent { it.forEach { it.validate() } } conversation().ifPresent { it.validate() } @@ -2650,6 +2693,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = type.let { if (it == JsonValue.from("response.create")) 1 else 0 } + + (accessPrograms.asKnown().getOrNull()?.validity() ?: 0) + (if (background.asKnown().isPresent) 1 else 0) + (contextManagement.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (conversation.asKnown().getOrNull()?.validity() ?: 0) + @@ -2684,6 +2728,340 @@ private constructor( (truncation.asKnown().getOrNull()?.validity() ?: 0) + (if (user.asKnown().isPresent) 1 else 0) + /** Domain-specific access programs to use for this request. */ + class AccessPrograms + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cyber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("cyber") @ExcludeMissing cyber: JsonField = JsonMissing.of() + ) : this(cyber, mutableMapOf()) + + /** + * The Cyber access program to use for this request. Supported values are `standard`, + * `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from + * the model's Cyber tier and your organization and project access, subject to + * model-specific eligibility restrictions. By default, models without a Cyber tier use + * Standard. Blue-tier models use Daybreak Blue when authorized; otherwise they fall + * back to Standard unless the model requires Daybreak access. Red-tier models use + * Daybreak Red and require authorization. Requests that require unavailable Daybreak + * access return 403. An implicit Standard fallback is represented by null in the + * response's access_programs field, rather than an explicit Standard selection. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun cyber(): Optional = cyber.getOptional("cyber") + + /** + * Returns the raw JSON value of [cyber]. + * + * Unlike [cyber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("cyber") @ExcludeMissing fun _cyber(): JsonField = cyber + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [AccessPrograms]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccessPrograms]. */ + class Builder internal constructor() { + + private var cyber: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(accessPrograms: AccessPrograms) = apply { + cyber = accessPrograms.cyber + additionalProperties = accessPrograms.additionalProperties.toMutableMap() + } + + /** + * The Cyber access program to use for this request. Supported values are + * `standard`, `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the + * program from the model's Cyber tier and your organization and project access, + * subject to model-specific eligibility restrictions. By default, models without a + * Cyber tier use Standard. Blue-tier models use Daybreak Blue when authorized; + * otherwise they fall back to Standard unless the model requires Daybreak access. + * Red-tier models use Daybreak Red and require authorization. Requests that require + * unavailable Daybreak access return 403. An implicit Standard fallback is + * represented by null in the response's access_programs field, rather than an + * explicit Standard selection. + */ + fun cyber(cyber: Cyber) = cyber(JsonField.of(cyber)) + + /** + * Sets [Builder.cyber] to an arbitrary JSON value. + * + * You should usually call [Builder.cyber] with a well-typed [Cyber] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun cyber(cyber: JsonField) = apply { this.cyber = cyber } + + 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 [AccessPrograms]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): AccessPrograms = + AccessPrograms(cyber, 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(): AccessPrograms = apply { + if (validated) { + return@apply + } + + cyber().ifPresent { it.validate() } + 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 = (cyber.asKnown().getOrNull()?.validity() ?: 0) + + /** + * The Cyber access program to use for this request. Supported values are `standard`, + * `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from + * the model's Cyber tier and your organization and project access, subject to + * model-specific eligibility restrictions. By default, models without a Cyber tier use + * Standard. Blue-tier models use Daybreak Blue when authorized; otherwise they fall + * back to Standard unless the model requires Daybreak access. Red-tier models use + * Daybreak Red and require authorization. Requests that require unavailable Daybreak + * access return 403. An implicit Standard fallback is represented by null in the + * response's access_programs field, rather than an explicit Standard selection. + */ + class Cyber @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val STANDARD = of("standard") + + @JvmField val DAYBREAK_BLUE = of("daybreak_blue") + + @JvmField val DAYBREAK_RED = of("daybreak_red") + + @JvmStatic fun of(value: String) = Cyber(JsonField.of(value)) + } + + /** An enum containing [Cyber]'s known values. */ + enum class Known { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + } + + /** + * An enum containing [Cyber]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cyber] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + /** + * An enum member indicating that [Cyber] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + STANDARD -> Value.STANDARD + DAYBREAK_BLUE -> Value.DAYBREAK_BLUE + DAYBREAK_RED -> Value.DAYBREAK_RED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OpenAIInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + STANDARD -> Known.STANDARD + DAYBREAK_BLUE -> Known.DAYBREAK_BLUE + DAYBREAK_RED -> Known.DAYBREAK_RED + else -> throw OpenAIInvalidDataException("Unknown Cyber: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OpenAIInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + OpenAIInvalidDataException("Value is not a String") + } + + 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(): Cyber = apply { + if (validated) { + return@apply + } + + known() + 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 (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Cyber && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccessPrograms && + cyber == other.cyber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(cyber, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AccessPrograms{cyber=$cyber, additionalProperties=$additionalProperties}" + } + class ContextManagement @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -3109,7 +3487,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Conversation: $json") + throw OpenAIInvalidDataException("Unknown Conversation") } } @@ -3361,7 +3739,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } @@ -8483,7 +8861,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } @@ -8733,6 +9111,7 @@ private constructor( return other is ResponseCreate && type == other.type && + accessPrograms == other.accessPrograms && background == other.background && contextManagement == other.contextManagement && conversation == other.conversation && @@ -8772,6 +9151,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( type, + accessPrograms, background, contextManagement, conversation, @@ -8812,6 +9192,6 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ResponseCreate{type=$type, background=$background, contextManagement=$contextManagement, conversation=$conversation, include=$include, input=$input, instructions=$instructions, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, metadata=$metadata, model=$model, moderation=$moderation, multiAgent=$multiAgent, parallelToolCalls=$parallelToolCalls, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, store=$store, stream=$stream, streamId=$streamId, streamOptions=$streamOptions, temperature=$temperature, text=$text, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, truncation=$truncation, user=$user, additionalProperties=$additionalProperties}" + "ResponseCreate{type=$type, accessPrograms=$accessPrograms, background=$background, contextManagement=$contextManagement, conversation=$conversation, include=$include, input=$input, instructions=$instructions, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, metadata=$metadata, model=$model, moderation=$moderation, multiAgent=$multiAgent, parallelToolCalls=$parallelToolCalls, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, store=$store, stream=$stream, streamId=$streamId, streamOptions=$streamOptions, temperature=$temperature, text=$text, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, truncation=$truncation, user=$user, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesServerEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesServerEvent.kt index cdfb41212..85e00c506 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesServerEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesServerEvent.kt @@ -3131,7 +3131,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaResponsesServerEvent: $json") + throw OpenAIInvalidDataException("Unknown BetaResponsesServerEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaTool.kt index 75482f472..8cfdcc6d2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaTool.kt @@ -696,7 +696,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BetaTool: $json") + throw OpenAIInvalidDataException("Unknown BetaTool") } } @@ -1869,7 +1869,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AllowedTools: $json") + throw OpenAIInvalidDataException("Unknown AllowedTools") } } @@ -2687,7 +2687,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RequireApproval: $json") + throw OpenAIInvalidDataException("Unknown RequireApproval") } } @@ -4084,7 +4084,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Container: $json") + throw OpenAIInvalidDataException("Unknown Container") } } @@ -4800,7 +4800,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown NetworkPolicy: $json") + throw OpenAIInvalidDataException("Unknown NetworkPolicy") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseCompactParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseCompactParams.kt index f4438d853..f095adbcb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseCompactParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseCompactParams.kt @@ -2212,7 +2212,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseCreateParams.kt index 1bc53399c..2b614533a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseCreateParams.kt @@ -55,6 +55,14 @@ private constructor( fun betas(): Optional> = Optional.ofNullable(betas) + /** + * Domain-specific access programs to use for this request. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accessPrograms(): Optional = body.accessPrograms() + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -429,6 +437,13 @@ private constructor( */ @Deprecated("deprecated") fun user(): Optional = body.user() + /** + * Returns the raw JSON value of [accessPrograms]. + * + * Unlike [accessPrograms], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _accessPrograms(): JsonField = body._accessPrograms() + /** * Returns the raw JSON value of [background]. * @@ -704,15 +719,31 @@ 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: + * - [accessPrograms] * - [background] * - [contextManagement] * - [conversation] * - [include] - * - [input] * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } + /** Domain-specific access programs to use for this request. */ + fun accessPrograms(accessPrograms: AccessPrograms) = apply { + body.accessPrograms(accessPrograms) + } + + /** + * Sets [Builder.accessPrograms] to an arbitrary JSON value. + * + * You should usually call [Builder.accessPrograms] with a well-typed [AccessPrograms] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accessPrograms(accessPrograms: JsonField) = apply { + body.accessPrograms(accessPrograms) + } + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -1833,6 +1864,7 @@ private constructor( class Body @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val accessPrograms: JsonField, private val background: JsonField, private val contextManagement: JsonField>, private val conversation: JsonField, @@ -1869,6 +1901,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("access_programs") + @ExcludeMissing + accessPrograms: JsonField = JsonMissing.of(), @JsonProperty("background") @ExcludeMissing background: JsonField = JsonMissing.of(), @@ -1953,6 +1988,7 @@ private constructor( truncation: JsonField = JsonMissing.of(), @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), ) : this( + accessPrograms, background, contextManagement, conversation, @@ -1987,6 +2023,15 @@ private constructor( mutableMapOf(), ) + /** + * Domain-specific access programs to use for this request. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accessPrograms(): Optional = + accessPrograms.getOptional("access_programs") + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -2371,6 +2416,16 @@ private constructor( */ @Deprecated("deprecated") fun user(): Optional = user.getOptional("user") + /** + * Returns the raw JSON value of [accessPrograms]. + * + * Unlike [accessPrograms], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("access_programs") + @ExcludeMissing + fun _accessPrograms(): JsonField = accessPrograms + /** * Returns the raw JSON value of [background]. * @@ -2672,6 +2727,7 @@ private constructor( /** A builder for [Body]. */ class Builder internal constructor() { + private var accessPrograms: JsonField = JsonMissing.of() private var background: JsonField = JsonMissing.of() private var contextManagement: JsonField>? = null private var conversation: JsonField = JsonMissing.of() @@ -2707,6 +2763,7 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { + accessPrograms = body.accessPrograms background = body.background contextManagement = body.contextManagement.map { it.toMutableList() } conversation = body.conversation @@ -2741,6 +2798,21 @@ private constructor( additionalProperties = body.additionalProperties.toMutableMap() } + /** Domain-specific access programs to use for this request. */ + fun accessPrograms(accessPrograms: AccessPrograms) = + accessPrograms(JsonField.of(accessPrograms)) + + /** + * Sets [Builder.accessPrograms] to an arbitrary JSON value. + * + * You should usually call [Builder.accessPrograms] with a well-typed [AccessPrograms] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun accessPrograms(accessPrograms: JsonField) = apply { + this.accessPrograms = accessPrograms + } + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -3787,6 +3859,7 @@ private constructor( */ fun build(): Body = Body( + accessPrograms, background, (contextManagement ?: JsonMissing.of()).map { it.toImmutable() }, conversation, @@ -3838,6 +3911,7 @@ private constructor( return@apply } + accessPrograms().ifPresent { it.validate() } background() contextManagement().ifPresent { it.forEach { it.validate() } } conversation().ifPresent { it.validate() } @@ -3888,7 +3962,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (background.asKnown().isPresent) 1 else 0) + + (accessPrograms.asKnown().getOrNull()?.validity() ?: 0) + + (if (background.asKnown().isPresent) 1 else 0) + (contextManagement.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (conversation.asKnown().getOrNull()?.validity() ?: 0) + (include.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + @@ -3926,6 +4001,7 @@ private constructor( } return other is Body && + accessPrograms == other.accessPrograms && background == other.background && contextManagement == other.contextManagement && conversation == other.conversation && @@ -3962,6 +4038,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + accessPrograms, background, contextManagement, conversation, @@ -4000,7 +4077,332 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{background=$background, contextManagement=$contextManagement, conversation=$conversation, include=$include, input=$input, instructions=$instructions, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, metadata=$metadata, model=$model, moderation=$moderation, multiAgent=$multiAgent, parallelToolCalls=$parallelToolCalls, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, store=$store, streamOptions=$streamOptions, temperature=$temperature, text=$text, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, truncation=$truncation, user=$user, additionalProperties=$additionalProperties}" + "Body{accessPrograms=$accessPrograms, background=$background, contextManagement=$contextManagement, conversation=$conversation, include=$include, input=$input, instructions=$instructions, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, metadata=$metadata, model=$model, moderation=$moderation, multiAgent=$multiAgent, parallelToolCalls=$parallelToolCalls, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, store=$store, streamOptions=$streamOptions, temperature=$temperature, text=$text, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, truncation=$truncation, user=$user, additionalProperties=$additionalProperties}" + } + + /** Domain-specific access programs to use for this request. */ + class AccessPrograms + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cyber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("cyber") @ExcludeMissing cyber: JsonField = JsonMissing.of() + ) : this(cyber, mutableMapOf()) + + /** + * The Cyber access program to use for this request. Supported values are `standard`, + * `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from the + * model's Cyber tier and your organization and project access, subject to model-specific + * eligibility restrictions. By default, models without a Cyber tier use Standard. Blue-tier + * models use Daybreak Blue when authorized; otherwise they fall back to Standard unless the + * model requires Daybreak access. Red-tier models use Daybreak Red and require + * authorization. Requests that require unavailable Daybreak access return 403. An implicit + * Standard fallback is represented by null in the response's access_programs field, rather + * than an explicit Standard selection. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun cyber(): Optional = cyber.getOptional("cyber") + + /** + * Returns the raw JSON value of [cyber]. + * + * Unlike [cyber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("cyber") @ExcludeMissing fun _cyber(): JsonField = cyber + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [AccessPrograms]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccessPrograms]. */ + class Builder internal constructor() { + + private var cyber: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(accessPrograms: AccessPrograms) = apply { + cyber = accessPrograms.cyber + additionalProperties = accessPrograms.additionalProperties.toMutableMap() + } + + /** + * The Cyber access program to use for this request. Supported values are `standard`, + * `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from + * the model's Cyber tier and your organization and project access, subject to + * model-specific eligibility restrictions. By default, models without a Cyber tier use + * Standard. Blue-tier models use Daybreak Blue when authorized; otherwise they fall + * back to Standard unless the model requires Daybreak access. Red-tier models use + * Daybreak Red and require authorization. Requests that require unavailable Daybreak + * access return 403. An implicit Standard fallback is represented by null in the + * response's access_programs field, rather than an explicit Standard selection. + */ + fun cyber(cyber: Cyber) = cyber(JsonField.of(cyber)) + + /** + * Sets [Builder.cyber] to an arbitrary JSON value. + * + * You should usually call [Builder.cyber] with a well-typed [Cyber] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun cyber(cyber: JsonField) = apply { this.cyber = cyber } + + 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 [AccessPrograms]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): AccessPrograms = AccessPrograms(cyber, 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(): AccessPrograms = apply { + if (validated) { + return@apply + } + + cyber().ifPresent { it.validate() } + 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 = (cyber.asKnown().getOrNull()?.validity() ?: 0) + + /** + * The Cyber access program to use for this request. Supported values are `standard`, + * `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from the + * model's Cyber tier and your organization and project access, subject to model-specific + * eligibility restrictions. By default, models without a Cyber tier use Standard. Blue-tier + * models use Daybreak Blue when authorized; otherwise they fall back to Standard unless the + * model requires Daybreak access. Red-tier models use Daybreak Red and require + * authorization. Requests that require unavailable Daybreak access return 403. An implicit + * Standard fallback is represented by null in the response's access_programs field, rather + * than an explicit Standard selection. + */ + class Cyber @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val STANDARD = of("standard") + + @JvmField val DAYBREAK_BLUE = of("daybreak_blue") + + @JvmField val DAYBREAK_RED = of("daybreak_red") + + @JvmStatic fun of(value: String) = Cyber(JsonField.of(value)) + } + + /** An enum containing [Cyber]'s known values. */ + enum class Known { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + } + + /** + * An enum containing [Cyber]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cyber] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + /** + * An enum member indicating that [Cyber] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + STANDARD -> Value.STANDARD + DAYBREAK_BLUE -> Value.DAYBREAK_BLUE + DAYBREAK_RED -> Value.DAYBREAK_RED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OpenAIInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + STANDARD -> Known.STANDARD + DAYBREAK_BLUE -> Known.DAYBREAK_BLUE + DAYBREAK_RED -> Known.DAYBREAK_RED + else -> throw OpenAIInvalidDataException("Unknown Cyber: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OpenAIInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + OpenAIInvalidDataException("Value is not a String") + } + + 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(): Cyber = apply { + if (validated) { + return@apply + } + + known() + 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 (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Cyber && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccessPrograms && + cyber == other.cyber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(cyber, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AccessPrograms{cyber=$cyber, additionalProperties=$additionalProperties}" } class ContextManagement @@ -4419,7 +4821,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Conversation: $json") + throw OpenAIInvalidDataException("Unknown Conversation") } } @@ -4654,7 +5056,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } @@ -9650,7 +10052,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/inputtokens/InputTokenCountParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/inputtokens/InputTokenCountParams.kt index 7cf5cd2c6..d37b70c15 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/inputtokens/InputTokenCountParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/inputtokens/InputTokenCountParams.kt @@ -2097,7 +2097,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Conversation: $json") + throw OpenAIInvalidDataException("Unknown Conversation") } } @@ -2331,7 +2331,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } @@ -4598,7 +4598,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/AssistantResponseFormatOption.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/AssistantResponseFormatOption.kt index f71bcf1af..b493acb79 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/AssistantResponseFormatOption.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/AssistantResponseFormatOption.kt @@ -317,7 +317,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AssistantResponseFormatOption: $json") + throw OpenAIInvalidDataException("Unknown AssistantResponseFormatOption") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/AssistantToolChoiceOption.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/AssistantToolChoiceOption.kt index 2ae32efe0..dbc38d8a6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/AssistantToolChoiceOption.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/AssistantToolChoiceOption.kt @@ -224,7 +224,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AssistantToolChoiceOption: $json") + throw OpenAIInvalidDataException("Unknown AssistantToolChoiceOption") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/ThreadCreateAndRunParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/ThreadCreateAndRunParams.kt index 5cc341bf4..2f674c522 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/ThreadCreateAndRunParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/ThreadCreateAndRunParams.kt @@ -2964,7 +2964,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } @@ -3557,7 +3557,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } @@ -5002,7 +5002,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ChunkingStrategy: $json") + throw OpenAIInvalidDataException("Unknown ChunkingStrategy") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/ThreadCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/ThreadCreateParams.kt index f5d84a00b..815bd02f4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/ThreadCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/ThreadCreateParams.kt @@ -1153,7 +1153,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } @@ -1737,7 +1737,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } @@ -3147,7 +3147,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ChunkingStrategy: $json") + throw OpenAIInvalidDataException("Unknown ChunkingStrategy") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/Annotation.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/Annotation.kt index e20c1e5ba..5a58508f0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/Annotation.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/Annotation.kt @@ -219,7 +219,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Annotation: $json") + throw OpenAIInvalidDataException("Unknown Annotation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/AnnotationDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/AnnotationDelta.kt index fa0502c6f..97787eaec 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/AnnotationDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/AnnotationDelta.kt @@ -224,7 +224,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AnnotationDelta: $json") + throw OpenAIInvalidDataException("Unknown AnnotationDelta") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/Message.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/Message.kt index 796b0c245..3d183eacb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/Message.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/Message.kt @@ -1238,7 +1238,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContent.kt index 9c09fa831..0f4f6a58f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContent.kt @@ -252,7 +252,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown MessageContent: $json") + throw OpenAIInvalidDataException("Unknown MessageContent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContentDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContentDelta.kt index e155ccc26..70dfc0a89 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContentDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContentDelta.kt @@ -254,7 +254,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown MessageContentDelta: $json") + throw OpenAIInvalidDataException("Unknown MessageContentDelta") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContentPartParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContentPartParam.kt index b066d4537..3f64463af 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContentPartParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageContentPartParam.kt @@ -231,7 +231,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown MessageContentPartParam: $json") + throw OpenAIInvalidDataException("Unknown MessageContentPartParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageCreateParams.kt index 9c6734a14..e4bacddd8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/messages/MessageCreateParams.kt @@ -942,7 +942,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } @@ -1507,7 +1507,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/RunCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/RunCreateParams.kt index 3b693ae94..c93fe0727 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/RunCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/RunCreateParams.kt @@ -2786,7 +2786,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } @@ -3370,7 +3370,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/CodeInterpreterToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/CodeInterpreterToolCall.kt index 1ca8ab2be..a1f465d15 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/CodeInterpreterToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/CodeInterpreterToolCall.kt @@ -667,7 +667,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/CodeInterpreterToolCallDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/CodeInterpreterToolCallDelta.kt index 7297d6051..ad3b78d10 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/CodeInterpreterToolCallDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/CodeInterpreterToolCallDelta.kt @@ -684,7 +684,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/RunStep.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/RunStep.kt index 99147529c..4114d6d5f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/RunStep.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/RunStep.kt @@ -1665,7 +1665,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown StepDetails: $json") + throw OpenAIInvalidDataException("Unknown StepDetails") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/RunStepDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/RunStepDelta.kt index 220c1df8f..719f899b6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/RunStepDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/RunStepDelta.kt @@ -353,7 +353,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown StepDetails: $json") + throw OpenAIInvalidDataException("Unknown StepDetails") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/ToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/ToolCall.kt index 6355b089a..1c48ef589 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/ToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/ToolCall.kt @@ -204,7 +204,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolCall: $json") + throw OpenAIInvalidDataException("Unknown ToolCall") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/ToolCallDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/ToolCallDelta.kt index 5a11bbe93..64f4fd9da 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/ToolCallDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/steps/ToolCallDelta.kt @@ -211,7 +211,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolCallDelta: $json") + throw OpenAIInvalidDataException("Unknown ToolCallDelta") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletion.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletion.kt index 724a1dfec..3ddbab05a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletion.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletion.kt @@ -1852,7 +1852,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } @@ -3426,7 +3426,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionAssistantMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionAssistantMessageParam.kt index da1f70f47..69159e561 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionAssistantMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionAssistantMessageParam.kt @@ -825,7 +825,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } @@ -1069,7 +1069,7 @@ private constructor( */ fun unknown(json: JsonValue?): T { throw OpenAIInvalidDataException( - "Unknown ChatCompletionRequestAssistantMessageContentPart: $json" + "Unknown ChatCompletionRequestAssistantMessageContentPart" ) } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionAudioParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionAudioParam.kt index 45f84e8c5..c9fed0e2a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionAudioParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionAudioParam.kt @@ -586,7 +586,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Voice: $json") + throw OpenAIInvalidDataException("Unknown Voice") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionChunk.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionChunk.kt index 771b96246..ce6987d3e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionChunk.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionChunk.kt @@ -3102,7 +3102,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } @@ -4676,7 +4676,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionContentPart.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionContentPart.kt index 9221ca246..1501c08bb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionContentPart.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionContentPart.kt @@ -269,7 +269,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ChatCompletionContentPart: $json") + throw OpenAIInvalidDataException("Unknown ChatCompletionContentPart") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCreateParams.kt index b1a414cf0..644c77ffb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCreateParams.kt @@ -4977,7 +4977,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown FunctionCall: $json") + throw OpenAIInvalidDataException("Unknown FunctionCall") } } @@ -7744,7 +7744,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseFormat: $json") + throw OpenAIInvalidDataException("Unknown ResponseFormat") } } @@ -8132,7 +8132,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Stop: $json") + throw OpenAIInvalidDataException("Unknown Stop") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCustomTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCustomTool.kt index 8a2d8eed3..ee6a72510 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCustomTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCustomTool.kt @@ -638,7 +638,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Format: $json") + throw OpenAIInvalidDataException("Unknown Format") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionDeveloperMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionDeveloperMessageParam.kt index 94655b410..f16fbcc3a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionDeveloperMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionDeveloperMessageParam.kt @@ -461,7 +461,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionMessageParam.kt index 5eb4519e8..8cc71f375 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionMessageParam.kt @@ -324,7 +324,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ChatCompletionMessageParam: $json") + throw OpenAIInvalidDataException("Unknown ChatCompletionMessageParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionMessageToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionMessageToolCall.kt index 9379b46ba..a790c73b6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionMessageToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionMessageToolCall.kt @@ -194,7 +194,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ChatCompletionMessageToolCall: $json") + throw OpenAIInvalidDataException("Unknown ChatCompletionMessageToolCall") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionPredictionContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionPredictionContent.kt index 727204cfa..98d49d823 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionPredictionContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionPredictionContent.kt @@ -446,7 +446,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionStoreMessage.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionStoreMessage.kt index b163a5eb4..10cfbf72b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionStoreMessage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionStoreMessage.kt @@ -823,7 +823,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ContentPart: $json") + throw OpenAIInvalidDataException("Unknown ContentPart") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionSystemMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionSystemMessageParam.kt index 48acc0e14..d06103f98 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionSystemMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionSystemMessageParam.kt @@ -460,7 +460,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionTool.kt index 8980eb9af..a3c51f797 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionTool.kt @@ -190,7 +190,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ChatCompletionTool: $json") + throw OpenAIInvalidDataException("Unknown ChatCompletionTool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionToolChoiceOption.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionToolChoiceOption.kt index 778c00bf9..15637d79f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionToolChoiceOption.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionToolChoiceOption.kt @@ -311,7 +311,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ChatCompletionToolChoiceOption: $json") + throw OpenAIInvalidDataException("Unknown ChatCompletionToolChoiceOption") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionToolMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionToolMessageParam.kt index 9529aaef7..8948e4fb4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionToolMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionToolMessageParam.kt @@ -465,7 +465,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionUserMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionUserMessageParam.kt index 12d4d7039..b3c155410 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionUserMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionUserMessageParam.kt @@ -458,7 +458,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/completions/CompletionCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/completions/CompletionCreateParams.kt index 654e320a7..7547c4e55 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/completions/CompletionCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/completions/CompletionCreateParams.kt @@ -2512,7 +2512,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Prompt: $json") + throw OpenAIInvalidDataException("Unknown Prompt") } } @@ -2853,7 +2853,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Stop: $json") + throw OpenAIInvalidDataException("Unknown Stop") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/containers/ContainerCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/containers/ContainerCreateParams.kt index e7ac1cbc6..8676186e5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/containers/ContainerCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/containers/ContainerCreateParams.kt @@ -1567,7 +1567,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown NetworkPolicy: $json") + throw OpenAIInvalidDataException("Unknown NetworkPolicy") } } @@ -1775,7 +1775,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Skill: $json") + throw OpenAIInvalidDataException("Unknown Skill") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/contentprovenancechecks/ContentProvenanceCheck.kt b/openai-java-core/src/main/kotlin/com/openai/models/contentprovenancechecks/ContentProvenanceCheck.kt index b936180fe..c2cb60c92 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/contentprovenancechecks/ContentProvenanceCheck.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/contentprovenancechecks/ContentProvenanceCheck.kt @@ -561,7 +561,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Result: $json") + throw OpenAIInvalidDataException("Unknown Result") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/conversations/Message.kt b/openai-java-core/src/main/kotlin/com/openai/models/conversations/Message.kt index e6ebe8e25..d64fdd9e2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/conversations/Message.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/conversations/Message.kt @@ -877,7 +877,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/conversations/items/ConversationItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/conversations/items/ConversationItem.kt index 8239a777f..dbe94c0a0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/conversations/items/ConversationItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/conversations/items/ConversationItem.kt @@ -1121,7 +1121,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ConversationItem: $json") + throw OpenAIInvalidDataException("Unknown ConversationItem") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/embeddings/EmbeddingCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/embeddings/EmbeddingCreateParams.kt index 1a04e7908..e5f5e0ec8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/embeddings/EmbeddingCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/embeddings/EmbeddingCreateParams.kt @@ -1052,7 +1052,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalCreateParams.kt index 6c9c8e037..0a3c40503 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalCreateParams.kt @@ -1098,7 +1098,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown DataSourceConfig: $json") + throw OpenAIInvalidDataException("Unknown DataSourceConfig") } } @@ -2457,7 +2457,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TestingCriterion: $json") + throw OpenAIInvalidDataException("Unknown TestingCriterion") } } @@ -3138,7 +3138,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } @@ -4031,7 +4031,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalCreateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalCreateResponse.kt index c0b7c4c9f..3b9732fb5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalCreateResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalCreateResponse.kt @@ -800,7 +800,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown DataSourceConfig: $json") + throw OpenAIInvalidDataException("Unknown DataSourceConfig") } } @@ -1802,7 +1802,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TestingCriterion: $json") + throw OpenAIInvalidDataException("Unknown TestingCriterion") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalListResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalListResponse.kt index ef467a5b5..e38deeba4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalListResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalListResponse.kt @@ -800,7 +800,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown DataSourceConfig: $json") + throw OpenAIInvalidDataException("Unknown DataSourceConfig") } } @@ -1802,7 +1802,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TestingCriterion: $json") + throw OpenAIInvalidDataException("Unknown TestingCriterion") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalRetrieveResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalRetrieveResponse.kt index ad50a2459..0aafdf890 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalRetrieveResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalRetrieveResponse.kt @@ -800,7 +800,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown DataSourceConfig: $json") + throw OpenAIInvalidDataException("Unknown DataSourceConfig") } } @@ -1802,7 +1802,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TestingCriterion: $json") + throw OpenAIInvalidDataException("Unknown TestingCriterion") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalUpdateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalUpdateResponse.kt index 323b88117..b40cbe4c8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalUpdateResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/EvalUpdateResponse.kt @@ -800,7 +800,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown DataSourceConfig: $json") + throw OpenAIInvalidDataException("Unknown DataSourceConfig") } } @@ -1802,7 +1802,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TestingCriterion: $json") + throw OpenAIInvalidDataException("Unknown TestingCriterion") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/CreateEvalCompletionsRunDataSource.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/CreateEvalCompletionsRunDataSource.kt index 43bd040b5..3215489ad 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/CreateEvalCompletionsRunDataSource.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/CreateEvalCompletionsRunDataSource.kt @@ -601,7 +601,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Source: $json") + throw OpenAIInvalidDataException("Unknown Source") } } @@ -2379,7 +2379,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InputMessages: $json") + throw OpenAIInvalidDataException("Unknown InputMessages") } } @@ -2885,7 +2885,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InnerTemplate: $json") + throw OpenAIInvalidDataException("Unknown InnerTemplate") } } @@ -3554,7 +3554,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } @@ -5424,7 +5424,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseFormat: $json") + throw OpenAIInvalidDataException("Unknown ResponseFormat") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/CreateEvalJsonlRunDataSource.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/CreateEvalJsonlRunDataSource.kt index f6bd6af13..8c1d34b36 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/CreateEvalJsonlRunDataSource.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/CreateEvalJsonlRunDataSource.kt @@ -404,7 +404,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Source: $json") + throw OpenAIInvalidDataException("Unknown Source") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCancelResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCancelResponse.kt index c9d1a6579..786648e4e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCancelResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCancelResponse.kt @@ -1156,7 +1156,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown DataSource: $json") + throw OpenAIInvalidDataException("Unknown DataSource") } } @@ -1791,7 +1791,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Source: $json") + throw OpenAIInvalidDataException("Unknown Source") } } @@ -3679,7 +3679,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InputMessages: $json") + throw OpenAIInvalidDataException("Unknown InputMessages") } } @@ -4165,7 +4165,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InnerTemplate: $json") + throw OpenAIInvalidDataException("Unknown InnerTemplate") } } @@ -5104,7 +5104,7 @@ private constructor( * implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateParams.kt index 717c717d3..95c2a965c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateParams.kt @@ -913,7 +913,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown DataSource: $json") + throw OpenAIInvalidDataException("Unknown DataSource") } } @@ -1554,7 +1554,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Source: $json") + throw OpenAIInvalidDataException("Unknown Source") } } @@ -3575,7 +3575,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InputMessages: $json") + throw OpenAIInvalidDataException("Unknown InputMessages") } } @@ -4061,7 +4061,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InnerTemplate: $json") + throw OpenAIInvalidDataException("Unknown InnerTemplate") } } @@ -5000,7 +5000,7 @@ private constructor( * implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateResponse.kt index 7b591a9be..ed15a0a44 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateResponse.kt @@ -1156,7 +1156,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown DataSource: $json") + throw OpenAIInvalidDataException("Unknown DataSource") } } @@ -1791,7 +1791,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Source: $json") + throw OpenAIInvalidDataException("Unknown Source") } } @@ -3679,7 +3679,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InputMessages: $json") + throw OpenAIInvalidDataException("Unknown InputMessages") } } @@ -4165,7 +4165,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InnerTemplate: $json") + throw OpenAIInvalidDataException("Unknown InnerTemplate") } } @@ -5104,7 +5104,7 @@ private constructor( * implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunListResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunListResponse.kt index f6fd7ad74..d259bf959 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunListResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunListResponse.kt @@ -1156,7 +1156,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown DataSource: $json") + throw OpenAIInvalidDataException("Unknown DataSource") } } @@ -1791,7 +1791,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Source: $json") + throw OpenAIInvalidDataException("Unknown Source") } } @@ -3679,7 +3679,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InputMessages: $json") + throw OpenAIInvalidDataException("Unknown InputMessages") } } @@ -4165,7 +4165,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InnerTemplate: $json") + throw OpenAIInvalidDataException("Unknown InnerTemplate") } } @@ -5104,7 +5104,7 @@ private constructor( * implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunRetrieveResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunRetrieveResponse.kt index 7cb2a48f9..1560dc4bb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunRetrieveResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunRetrieveResponse.kt @@ -1156,7 +1156,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown DataSource: $json") + throw OpenAIInvalidDataException("Unknown DataSource") } } @@ -1791,7 +1791,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Source: $json") + throw OpenAIInvalidDataException("Unknown Source") } } @@ -3679,7 +3679,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InputMessages: $json") + throw OpenAIInvalidDataException("Unknown InputMessages") } } @@ -4165,7 +4165,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InnerTemplate: $json") + throw OpenAIInvalidDataException("Unknown InnerTemplate") } } @@ -5104,7 +5104,7 @@ private constructor( * implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderRunParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderRunParams.kt index a1b252957..87b30b180 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderRunParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderRunParams.kt @@ -860,7 +860,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Grader: $json") + throw OpenAIInvalidDataException("Unknown Grader") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderValidateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderValidateParams.kt index a669bb4b0..3b797b980 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderValidateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderValidateParams.kt @@ -725,7 +725,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Grader: $json") + throw OpenAIInvalidDataException("Unknown Grader") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderValidateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderValidateResponse.kt index e92285e67..a68c2eacb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderValidateResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/alpha/graders/GraderValidateResponse.kt @@ -449,7 +449,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Grader: $json") + throw OpenAIInvalidDataException("Unknown Grader") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/jobs/FineTuningJob.kt b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/jobs/FineTuningJob.kt index 1ef9d8831..ea82cc62c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/jobs/FineTuningJob.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/jobs/FineTuningJob.kt @@ -1734,7 +1734,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BatchSize: $json") + throw OpenAIInvalidDataException("Unknown BatchSize") } } @@ -1959,7 +1959,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown LearningRateMultiplier: $json") + throw OpenAIInvalidDataException("Unknown LearningRateMultiplier") } } @@ -2184,7 +2184,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown NEpochs: $json") + throw OpenAIInvalidDataException("Unknown NEpochs") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/jobs/JobCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/jobs/JobCreateParams.kt index 61d518283..4bff1b14d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/jobs/JobCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/jobs/JobCreateParams.kt @@ -1870,7 +1870,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BatchSize: $json") + throw OpenAIInvalidDataException("Unknown BatchSize") } } @@ -2095,7 +2095,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown LearningRateMultiplier: $json") + throw OpenAIInvalidDataException("Unknown LearningRateMultiplier") } } @@ -2320,7 +2320,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown NEpochs: $json") + throw OpenAIInvalidDataException("Unknown NEpochs") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/DpoHyperparameters.kt b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/DpoHyperparameters.kt index 08c68d9a3..ce27a9ccc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/DpoHyperparameters.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/DpoHyperparameters.kt @@ -487,7 +487,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BatchSize: $json") + throw OpenAIInvalidDataException("Unknown BatchSize") } } @@ -702,7 +702,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Beta: $json") + throw OpenAIInvalidDataException("Unknown Beta") } } @@ -921,7 +921,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown LearningRateMultiplier: $json") + throw OpenAIInvalidDataException("Unknown LearningRateMultiplier") } } @@ -1141,7 +1141,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown NEpochs: $json") + throw OpenAIInvalidDataException("Unknown NEpochs") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/ReinforcementHyperparameters.kt b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/ReinforcementHyperparameters.kt index 842894309..8464ccee1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/ReinforcementHyperparameters.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/ReinforcementHyperparameters.kt @@ -640,7 +640,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BatchSize: $json") + throw OpenAIInvalidDataException("Unknown BatchSize") } } @@ -856,7 +856,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ComputeMultiplier: $json") + throw OpenAIInvalidDataException("Unknown ComputeMultiplier") } } @@ -1073,7 +1073,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown EvalInterval: $json") + throw OpenAIInvalidDataException("Unknown EvalInterval") } } @@ -1289,7 +1289,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown EvalSamples: $json") + throw OpenAIInvalidDataException("Unknown EvalSamples") } } @@ -1508,7 +1508,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown LearningRateMultiplier: $json") + throw OpenAIInvalidDataException("Unknown LearningRateMultiplier") } } @@ -1728,7 +1728,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown NEpochs: $json") + throw OpenAIInvalidDataException("Unknown NEpochs") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/ReinforcementMethod.kt b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/ReinforcementMethod.kt index 7354f64a8..30fb74927 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/ReinforcementMethod.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/ReinforcementMethod.kt @@ -512,7 +512,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Grader: $json") + throw OpenAIInvalidDataException("Unknown Grader") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/SupervisedHyperparameters.kt b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/SupervisedHyperparameters.kt index 2bc764bb9..b8d99c75f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/SupervisedHyperparameters.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/finetuning/methods/SupervisedHyperparameters.kt @@ -446,7 +446,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown BatchSize: $json") + throw OpenAIInvalidDataException("Unknown BatchSize") } } @@ -665,7 +665,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown LearningRateMultiplier: $json") + throw OpenAIInvalidDataException("Unknown LearningRateMultiplier") } } @@ -885,7 +885,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown NEpochs: $json") + throw OpenAIInvalidDataException("Unknown NEpochs") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/EvalContentItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/EvalContentItem.kt index f17350e67..acb0995ea 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/EvalContentItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/EvalContentItem.kt @@ -279,7 +279,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown EvalContentItem: $json") + throw OpenAIInvalidDataException("Unknown EvalContentItem") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/LabelModelGrader.kt b/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/LabelModelGrader.kt index e18b81f7b..431109073 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/LabelModelGrader.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/LabelModelGrader.kt @@ -976,7 +976,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/MultiGrader.kt b/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/MultiGrader.kt index 860a29ef9..e3fa2f227 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/MultiGrader.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/MultiGrader.kt @@ -619,7 +619,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Graders: $json") + throw OpenAIInvalidDataException("Unknown Graders") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/ScoreModelGrader.kt b/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/ScoreModelGrader.kt index e17e70e51..96f9de545 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/ScoreModelGrader.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/graders/gradermodels/ScoreModelGrader.kt @@ -969,7 +969,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/images/ImageEditParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/images/ImageEditParams.kt index b4ec914c6..5966085c6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/images/ImageEditParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/images/ImageEditParams.kt @@ -1971,7 +1971,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Image: $json") + throw OpenAIInvalidDataException("Unknown Image") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/images/ImageEditStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/images/ImageEditStreamEvent.kt index 342be3fa9..f760bc3fa 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/images/ImageEditStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/images/ImageEditStreamEvent.kt @@ -199,7 +199,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ImageEditStreamEvent: $json") + throw OpenAIInvalidDataException("Unknown ImageEditStreamEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/images/ImageGenStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/images/ImageGenStreamEvent.kt index 171cb65d0..52d10749f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/images/ImageGenStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/images/ImageGenStreamEvent.kt @@ -209,7 +209,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ImageGenStreamEvent: $json") + throw OpenAIInvalidDataException("Unknown ImageGenStreamEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/AudioFormat.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/AudioFormat.kt index af74c6bae..e5753e52a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/AudioFormat.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/AudioFormat.kt @@ -223,7 +223,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AudioFormat: $json") + throw OpenAIInvalidDataException("Unknown AudioFormat") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/ClientEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/ClientEvent.kt index cffd310d7..47d9fd199 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/ClientEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/ClientEvent.kt @@ -630,7 +630,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ClientEvent: $json") + throw OpenAIInvalidDataException("Unknown ClientEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/DataChannelConfig.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/DataChannelConfig.kt index 7f17bdbf6..0563fc47f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/DataChannelConfig.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/DataChannelConfig.kt @@ -421,7 +421,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AllowedClientEvents: $json") + throw OpenAIInvalidDataException("Unknown AllowedClientEvents") } } @@ -652,7 +652,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AllowedServerEvents: $json") + throw OpenAIInvalidDataException("Unknown AllowedServerEvents") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/InitialItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/InitialItem.kt index cd249f2a9..2d7cff5a1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/InitialItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/InitialItem.kt @@ -224,7 +224,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InitialItem: $json") + throw OpenAIInvalidDataException("Unknown InitialItem") } } @@ -2758,7 +2758,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/MediaSessionConfig.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/MediaSessionConfig.kt index be26cf378..d034ed69d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/MediaSessionConfig.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/MediaSessionConfig.kt @@ -1145,7 +1145,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Voice: $json") + throw OpenAIInvalidDataException("Unknown Voice") } } @@ -1421,7 +1421,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Delegation: $json") + throw OpenAIInvalidDataException("Unknown Delegation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/ResponsesDelegationConfig.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/ResponsesDelegationConfig.kt index b97608f2f..dc313abcc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/ResponsesDelegationConfig.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/ResponsesDelegationConfig.kt @@ -1801,7 +1801,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } @@ -2663,7 +2663,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/ResponsesDelegationUpdateConfig.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/ResponsesDelegationUpdateConfig.kt index 7b325b9f5..ea14fa926 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/ResponsesDelegationUpdateConfig.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/ResponsesDelegationUpdateConfig.kt @@ -1797,7 +1797,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } @@ -2659,7 +2659,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/ServerEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/ServerEvent.kt index 948b1a3e9..5ef61a96d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/ServerEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/ServerEvent.kt @@ -1119,7 +1119,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ServerEvent: $json") + throw OpenAIInvalidDataException("Unknown ServerEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/SessionConfig.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/SessionConfig.kt index fa1fb5177..b410e5ad2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/SessionConfig.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/SessionConfig.kt @@ -1222,7 +1222,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Voice: $json") + throw OpenAIInvalidDataException("Unknown Voice") } } @@ -1499,7 +1499,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Delegation: $json") + throw OpenAIInvalidDataException("Unknown Delegation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/SessionResource.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/SessionResource.kt index 83633ced0..ccba4ae7f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/SessionResource.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/SessionResource.kt @@ -1344,7 +1344,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Voice: $json") + throw OpenAIInvalidDataException("Unknown Voice") } } @@ -1621,7 +1621,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Delegation: $json") + throw OpenAIInvalidDataException("Unknown Delegation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/SessionUpdateConfig.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/SessionUpdateConfig.kt index f980d8b88..5f04a97f8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/SessionUpdateConfig.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/SessionUpdateConfig.kt @@ -374,7 +374,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Delegation: $json") + throw OpenAIInvalidDataException("Unknown Delegation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/forks/ForkClientEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/forks/ForkClientEvent.kt index e28c54941..876be594e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/forks/ForkClientEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/forks/ForkClientEvent.kt @@ -641,7 +641,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ForkClientEvent: $json") + throw OpenAIInvalidDataException("Unknown ForkClientEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/forks/ForkServerEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/forks/ForkServerEvent.kt index 36bb03c70..8f2b38f44 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/forks/ForkServerEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/forks/ForkServerEvent.kt @@ -1159,7 +1159,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ForkServerEvent: $json") + throw OpenAIInvalidDataException("Unknown ForkServerEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/live/sessions/SessionAcceptParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/live/sessions/SessionAcceptParams.kt index 3d8391161..d735b5600 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/live/sessions/SessionAcceptParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/live/sessions/SessionAcceptParams.kt @@ -1577,7 +1577,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Voice: $json") + throw OpenAIInvalidDataException("Unknown Voice") } } @@ -1857,7 +1857,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Delegation: $json") + throw OpenAIInvalidDataException("Unknown Delegation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/moderations/ModerationCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/moderations/ModerationCreateParams.kt index fc5b6cf02..ed070eb38 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/moderations/ModerationCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/moderations/ModerationCreateParams.kt @@ -763,7 +763,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/moderations/ModerationMultiModalInput.kt b/openai-java-core/src/main/kotlin/com/openai/models/moderations/ModerationMultiModalInput.kt index 8ae227afa..345d5e0df 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/moderations/ModerationMultiModalInput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/moderations/ModerationMultiModalInput.kt @@ -190,7 +190,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ModerationMultiModalInput: $json") + throw OpenAIInvalidDataException("Unknown ModerationMultiModalInput") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/ConversationItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/ConversationItem.kt index f3a9f2083..88cbdd1fb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/ConversationItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/ConversationItem.kt @@ -495,7 +495,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ConversationItem: $json") + throw OpenAIInvalidDataException("Unknown ConversationItem") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/ConversationItemInputAudioTranscriptionCompletedEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/ConversationItemInputAudioTranscriptionCompletedEvent.kt index 6a00df185..0cce4d1b5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/ConversationItemInputAudioTranscriptionCompletedEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/ConversationItemInputAudioTranscriptionCompletedEvent.kt @@ -729,7 +729,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Usage: $json") + throw OpenAIInvalidDataException("Unknown Usage") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioConfigOutput.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioConfigOutput.kt index 16d399bb8..a4d3aa62d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioConfigOutput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioConfigOutput.kt @@ -464,7 +464,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Voice: $json") + throw OpenAIInvalidDataException("Unknown Voice") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioFormats.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioFormats.kt index b90791150..75f42b415 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioFormats.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioFormats.kt @@ -223,7 +223,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RealtimeAudioFormats: $json") + throw OpenAIInvalidDataException("Unknown RealtimeAudioFormats") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioInputTurnDetection.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioInputTurnDetection.kt index 2dd4262d5..c10605b70 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioInputTurnDetection.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeAudioInputTurnDetection.kt @@ -240,7 +240,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RealtimeAudioInputTurnDetection: $json") + throw OpenAIInvalidDataException("Unknown RealtimeAudioInputTurnDetection") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeClientEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeClientEvent.kt index 999fe1bbf..99ae6da23 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeClientEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeClientEvent.kt @@ -902,7 +902,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RealtimeClientEvent: $json") + throw OpenAIInvalidDataException("Unknown RealtimeClientEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeMcpToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeMcpToolCall.kt index 7fecdc293..c9dae44c6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeMcpToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeMcpToolCall.kt @@ -663,7 +663,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Error: $json") + throw OpenAIInvalidDataException("Unknown Error") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponse.kt index fe5b3ab95..6d6f96e30 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponse.kt @@ -1476,7 +1476,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown MaxOutputTokens: $json") + throw OpenAIInvalidDataException("Unknown MaxOutputTokens") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateAudioOutput.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateAudioOutput.kt index f173971c8..d8aafadf9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateAudioOutput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateAudioOutput.kt @@ -559,7 +559,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Voice: $json") + throw OpenAIInvalidDataException("Unknown Voice") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpTool.kt index aae84dd1a..da5ce1c32 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateMcpTool.kt @@ -1039,7 +1039,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AllowedTools: $json") + throw OpenAIInvalidDataException("Unknown AllowedTools") } } @@ -1842,7 +1842,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RequireApproval: $json") + throw OpenAIInvalidDataException("Unknown RequireApproval") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateParams.kt index ff4c6f7c5..58bf6f93d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeResponseCreateParams.kt @@ -1183,7 +1183,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown MaxOutputTokens: $json") + throw OpenAIInvalidDataException("Unknown MaxOutputTokens") } } @@ -1727,7 +1727,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } @@ -1983,7 +1983,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeServerEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeServerEvent.kt index 1ceb795a9..24e750138 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeServerEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeServerEvent.kt @@ -2542,7 +2542,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RealtimeServerEvent: $json") + throw OpenAIInvalidDataException("Unknown RealtimeServerEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeSession.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeSession.kt index 1cc504eec..4f92ff4b1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeSession.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeSession.kt @@ -1749,7 +1749,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown MaxResponseOutputTokens: $json") + throw OpenAIInvalidDataException("Unknown MaxResponseOutputTokens") } } @@ -2622,7 +2622,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tracing: $json") + throw OpenAIInvalidDataException("Unknown Tracing") } } @@ -3126,7 +3126,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TurnDetection: $json") + throw OpenAIInvalidDataException("Unknown TurnDetection") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeSessionCreateRequest.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeSessionCreateRequest.kt index 6db2d2e93..0b24b0b48 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeSessionCreateRequest.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeSessionCreateRequest.kt @@ -1213,7 +1213,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown MaxOutputTokens: $json") + throw OpenAIInvalidDataException("Unknown MaxOutputTokens") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolChoiceConfig.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolChoiceConfig.kt index bb993be10..ac00e3607 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolChoiceConfig.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolChoiceConfig.kt @@ -265,7 +265,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RealtimeToolChoiceConfig: $json") + throw OpenAIInvalidDataException("Unknown RealtimeToolChoiceConfig") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnion.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnion.kt index 60ae870d1..6fca8acb6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnion.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeToolsConfigUnion.kt @@ -214,7 +214,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RealtimeToolsConfigUnion: $json") + throw OpenAIInvalidDataException("Unknown RealtimeToolsConfigUnion") } } @@ -1294,7 +1294,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AllowedTools: $json") + throw OpenAIInvalidDataException("Unknown AllowedTools") } } @@ -2112,7 +2112,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RequireApproval: $json") + throw OpenAIInvalidDataException("Unknown RequireApproval") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTracingConfig.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTracingConfig.kt index 099d1708f..5861747f1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTracingConfig.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTracingConfig.kt @@ -218,7 +218,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RealtimeTracingConfig: $json") + throw OpenAIInvalidDataException("Unknown RealtimeTracingConfig") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranscriptionSessionAudioInputTurnDetection.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranscriptionSessionAudioInputTurnDetection.kt index b63d0cc1b..bd6483089 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranscriptionSessionAudioInputTurnDetection.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranscriptionSessionAudioInputTurnDetection.kt @@ -247,7 +247,7 @@ private constructor( */ fun unknown(json: JsonValue?): T { throw OpenAIInvalidDataException( - "Unknown RealtimeTranscriptionSessionAudioInputTurnDetection: $json" + "Unknown RealtimeTranscriptionSessionAudioInputTurnDetection" ) } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranslationClientEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranslationClientEvent.kt index 4e49974ff..af516c39b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranslationClientEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranslationClientEvent.kt @@ -329,7 +329,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RealtimeTranslationClientEvent: $json") + throw OpenAIInvalidDataException("Unknown RealtimeTranslationClientEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranslationServerEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranslationServerEvent.kt index eb0e52545..4b9c72166 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranslationServerEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTranslationServerEvent.kt @@ -493,7 +493,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RealtimeTranslationServerEvent: $json") + throw OpenAIInvalidDataException("Unknown RealtimeTranslationServerEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTruncation.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTruncation.kt index e75c29c74..583bdafad 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTruncation.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/RealtimeTruncation.kt @@ -247,7 +247,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RealtimeTruncation: $json") + throw OpenAIInvalidDataException("Unknown RealtimeTruncation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionCreatedEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionCreatedEvent.kt index 2969722a5..af253ce87 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionCreatedEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionCreatedEvent.kt @@ -488,7 +488,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Session: $json") + throw OpenAIInvalidDataException("Unknown Session") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionUpdateEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionUpdateEvent.kt index c62ab9716..4b7101c2e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionUpdateEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionUpdateEvent.kt @@ -501,7 +501,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Session: $json") + throw OpenAIInvalidDataException("Unknown Session") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionUpdatedEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionUpdatedEvent.kt index 0c9855f85..1501676ce 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionUpdatedEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/SessionUpdatedEvent.kt @@ -485,7 +485,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Session: $json") + throw OpenAIInvalidDataException("Unknown Session") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/ClientSecretCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/ClientSecretCreateParams.kt index 206dbb843..cfb6bf817 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/ClientSecretCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/ClientSecretCreateParams.kt @@ -1054,7 +1054,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Session: $json") + throw OpenAIInvalidDataException("Unknown Session") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/ClientSecretCreateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/ClientSecretCreateResponse.kt index 9b635117a..0f8396d7c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/ClientSecretCreateResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/ClientSecretCreateResponse.kt @@ -446,7 +446,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Session: $json") + throw OpenAIInvalidDataException("Unknown Session") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/RealtimeSessionCreateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/RealtimeSessionCreateResponse.kt index 9fe665e29..7a4bed88d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/RealtimeSessionCreateResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/realtime/clientsecrets/RealtimeSessionCreateResponse.kt @@ -1853,7 +1853,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown TurnDetection: $json") + throw OpenAIInvalidDataException("Unknown TurnDetection") } } @@ -3750,7 +3750,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown MaxOutputTokens: $json") + throw OpenAIInvalidDataException("Unknown MaxOutputTokens") } } @@ -4422,7 +4422,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } @@ -4663,7 +4663,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } @@ -5776,7 +5776,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AllowedTools: $json") + throw OpenAIInvalidDataException("Unknown AllowedTools") } } @@ -6608,7 +6608,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RequireApproval: $json") + throw OpenAIInvalidDataException("Unknown RequireApproval") } } @@ -7759,7 +7759,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tracing: $json") + throw OpenAIInvalidDataException("Unknown Tracing") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ComputerAction.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ComputerAction.kt index 0901cd540..cc462bb53 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ComputerAction.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ComputerAction.kt @@ -385,7 +385,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ComputerAction: $json") + throw OpenAIInvalidDataException("Unknown ComputerAction") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ContainerAuto.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ContainerAuto.kt index 2b8ac8a74..50cc83be8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ContainerAuto.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ContainerAuto.kt @@ -708,7 +708,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown NetworkPolicy: $json") + throw OpenAIInvalidDataException("Unknown NetworkPolicy") } } @@ -916,7 +916,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Skill: $json") + throw OpenAIInvalidDataException("Unknown Skill") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/EasyInputMessage.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/EasyInputMessage.kt index 85cda3a97..7f71b2750 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/EasyInputMessage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/EasyInputMessage.kt @@ -504,7 +504,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/FileSearchTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/FileSearchTool.kt index 8341aa6eb..9f17d49c8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/FileSearchTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/FileSearchTool.kt @@ -561,7 +561,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Filters: $json") + throw OpenAIInvalidDataException("Unknown Filters") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/FunctionShellTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/FunctionShellTool.kt index 6e21599d8..c660d0e4e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/FunctionShellTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/FunctionShellTool.kt @@ -622,7 +622,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Environment: $json") + throw OpenAIInvalidDataException("Unknown Environment") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/McpToolCallError.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/McpToolCallError.kt index 43f6fe220..e7d5d3193 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/McpToolCallError.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/McpToolCallError.kt @@ -212,7 +212,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown McpToolCallError: $json") + throw OpenAIInvalidDataException("Unknown McpToolCallError") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/NamespaceTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/NamespaceTool.kt index 92e9a845f..4f887cfe1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/NamespaceTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/NamespaceTool.kt @@ -504,7 +504,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/Response.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/Response.kt index a1a1a3f3b..d5f19ab90 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/Response.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/Response.kt @@ -19,6 +19,7 @@ import com.openai.core.Enum import com.openai.core.ExcludeMissing import com.openai.core.JsonField import com.openai.core.JsonMissing +import com.openai.core.JsonNull import com.openai.core.JsonValue import com.openai.core.allMaxBy import com.openai.core.checkKnown @@ -38,6 +39,7 @@ class Response @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val id: JsonField, + private val accessPrograms: JsonField, private val createdAt: JsonField, private val error: JsonField, private val incompleteDetails: JsonField, @@ -78,6 +80,9 @@ private constructor( @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("access_programs") + @ExcludeMissing + accessPrograms: JsonField = JsonMissing.of(), @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), @JsonProperty("error") @ExcludeMissing error: JsonField = JsonMissing.of(), @JsonProperty("incomplete_details") @@ -164,6 +169,7 @@ private constructor( @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), ) : this( id, + accessPrograms, createdAt, error, incompleteDetails, @@ -209,6 +215,12 @@ private constructor( */ fun id(): String = id.getRequired("id") + /** + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accessPrograms(): Optional = accessPrograms.getOptional("access_programs") + /** * Unix timestamp (in seconds) of when this Response was created. * @@ -603,6 +615,15 @@ private constructor( */ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + /** + * Returns the raw JSON value of [accessPrograms]. + * + * Unlike [accessPrograms], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("access_programs") + @ExcludeMissing + fun _accessPrograms(): JsonField = accessPrograms + /** * Returns the raw JSON value of [createdAt]. * @@ -922,6 +943,7 @@ private constructor( class Builder internal constructor() { private var id: JsonField? = null + private var accessPrograms: JsonField? = JsonNull.of() private var createdAt: JsonField? = null private var error: JsonField? = null private var incompleteDetails: JsonField? = null @@ -961,6 +983,7 @@ private constructor( @JvmSynthetic internal fun from(response: Response) = apply { id = response.id + accessPrograms = response.accessPrograms createdAt = response.createdAt error = response.error incompleteDetails = response.incompleteDetails @@ -1009,6 +1032,24 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } + fun accessPrograms(accessPrograms: AccessPrograms?) = + accessPrograms(JsonField.ofNullable(accessPrograms)) + + /** Alias for calling [Builder.accessPrograms] with `accessPrograms.orElse(null)`. */ + fun accessPrograms(accessPrograms: Optional) = + accessPrograms(accessPrograms.getOrNull()) + + /** + * Sets [Builder.accessPrograms] to an arbitrary JSON value. + * + * You should usually call [Builder.accessPrograms] with a well-typed [AccessPrograms] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accessPrograms(accessPrograms: JsonField) = apply { + this.accessPrograms = accessPrograms + } + /** Unix timestamp (in seconds) of when this Response was created. */ fun createdAt(createdAt: Double) = createdAt(JsonField.of(createdAt)) @@ -2164,6 +2205,7 @@ private constructor( fun build(): Response = Response( checkRequired("id", id), + checkRequired("accessPrograms", accessPrograms), checkRequired("createdAt", createdAt), checkRequired("error", error), checkRequired("incompleteDetails", incompleteDetails), @@ -2218,6 +2260,7 @@ private constructor( } id() + accessPrograms().ifPresent { it.validate() } createdAt() error().ifPresent { it.validate() } incompleteDetails().ifPresent { it.validate() } @@ -2275,6 +2318,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (id.asKnown().isPresent) 1 else 0) + + (accessPrograms.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (error.asKnown().getOrNull()?.validity() ?: 0) + (incompleteDetails.asKnown().getOrNull()?.validity() ?: 0) + @@ -2310,6 +2354,317 @@ private constructor( (usage.asKnown().getOrNull()?.validity() ?: 0) + (if (user.asKnown().isPresent) 1 else 0) + class AccessPrograms + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cyber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("cyber") @ExcludeMissing cyber: JsonField = JsonMissing.of() + ) : this(cyber, mutableMapOf()) + + /** + * The effective Cyber access program used for this response. + * + * @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 cyber(): Cyber = cyber.getRequired("cyber") + + /** + * Returns the raw JSON value of [cyber]. + * + * Unlike [cyber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("cyber") @ExcludeMissing fun _cyber(): JsonField = cyber + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AccessPrograms]. + * + * The following fields are required: + * ```java + * .cyber() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccessPrograms]. */ + class Builder internal constructor() { + + private var cyber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(accessPrograms: AccessPrograms) = apply { + cyber = accessPrograms.cyber + additionalProperties = accessPrograms.additionalProperties.toMutableMap() + } + + /** The effective Cyber access program used for this response. */ + fun cyber(cyber: Cyber) = cyber(JsonField.of(cyber)) + + /** + * Sets [Builder.cyber] to an arbitrary JSON value. + * + * You should usually call [Builder.cyber] with a well-typed [Cyber] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun cyber(cyber: JsonField) = apply { this.cyber = cyber } + + 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 [AccessPrograms]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .cyber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AccessPrograms = + AccessPrograms(checkRequired("cyber", cyber), 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(): AccessPrograms = apply { + if (validated) { + return@apply + } + + cyber().validate() + 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 = (cyber.asKnown().getOrNull()?.validity() ?: 0) + + /** The effective Cyber access program used for this response. */ + class Cyber @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val STANDARD = of("standard") + + @JvmField val DAYBREAK_BLUE = of("daybreak_blue") + + @JvmField val DAYBREAK_RED = of("daybreak_red") + + @JvmStatic fun of(value: String) = Cyber(JsonField.of(value)) + } + + /** An enum containing [Cyber]'s known values. */ + enum class Known { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + } + + /** + * An enum containing [Cyber]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cyber] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + /** + * An enum member indicating that [Cyber] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + STANDARD -> Value.STANDARD + DAYBREAK_BLUE -> Value.DAYBREAK_BLUE + DAYBREAK_RED -> Value.DAYBREAK_RED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OpenAIInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + STANDARD -> Known.STANDARD + DAYBREAK_BLUE -> Known.DAYBREAK_BLUE + DAYBREAK_RED -> Known.DAYBREAK_RED + else -> throw OpenAIInvalidDataException("Unknown Cyber: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OpenAIInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + OpenAIInvalidDataException("Value is not a String") + } + + 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(): Cyber = apply { + if (validated) { + return@apply + } + + known() + 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 (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Cyber && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccessPrograms && + cyber == other.cyber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(cyber, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AccessPrograms{cyber=$cyber, additionalProperties=$additionalProperties}" + } + /** Details about why the response is incomplete. */ class IncompleteDetails @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2807,7 +3162,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Instructions: $json") + throw OpenAIInvalidDataException("Unknown Instructions") } } @@ -3410,7 +3765,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } @@ -4051,7 +4406,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } @@ -5335,7 +5690,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } @@ -6714,7 +7069,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown PromptCacheDiagnostics: $json") + throw OpenAIInvalidDataException("Unknown PromptCacheDiagnostics") } } @@ -8307,6 +8662,7 @@ private constructor( return other is Response && id == other.id && + accessPrograms == other.accessPrograms && createdAt == other.createdAt && error == other.error && incompleteDetails == other.incompleteDetails && @@ -8347,6 +8703,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( id, + accessPrograms, createdAt, error, incompleteDetails, @@ -8388,5 +8745,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Response{id=$id, createdAt=$createdAt, error=$error, incompleteDetails=$incompleteDetails, instructions=$instructions, metadata=$metadata, model=$model, object_=$object_, output=$output, parallelToolCalls=$parallelToolCalls, temperature=$temperature, toolChoice=$toolChoice, tools=$tools, topP=$topP, background=$background, completedAt=$completedAt, conversation=$conversation, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, moderation=$moderation, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheDiagnostics=$promptCacheDiagnostics, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, status=$status, text=$text, topLogprobs=$topLogprobs, truncation=$truncation, usage=$usage, user=$user, additionalProperties=$additionalProperties}" + "Response{id=$id, accessPrograms=$accessPrograms, createdAt=$createdAt, error=$error, incompleteDetails=$incompleteDetails, instructions=$instructions, metadata=$metadata, model=$model, object_=$object_, output=$output, parallelToolCalls=$parallelToolCalls, temperature=$temperature, toolChoice=$toolChoice, tools=$tools, topP=$topP, background=$background, completedAt=$completedAt, conversation=$conversation, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, moderation=$moderation, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheDiagnostics=$promptCacheDiagnostics, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, status=$status, text=$text, topLogprobs=$topLogprobs, truncation=$truncation, usage=$usage, user=$user, additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseApplyPatchToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseApplyPatchToolCall.kt index a57946d26..0b27c9166 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseApplyPatchToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseApplyPatchToolCall.kt @@ -633,7 +633,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Operation: $json") + throw OpenAIInvalidDataException("Unknown Operation") } } @@ -1709,7 +1709,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseApplyPatchToolCallOutput.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseApplyPatchToolCallOutput.kt index 0353fcd66..a738e49b7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseApplyPatchToolCallOutput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseApplyPatchToolCallOutput.kt @@ -717,7 +717,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCodeInterpreterToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCodeInterpreterToolCall.kt index 73644f716..6258d32c7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCodeInterpreterToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCodeInterpreterToolCall.kt @@ -590,7 +590,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCompactParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCompactParams.kt index 8cf56c193..0bb09d305 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCompactParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCompactParams.kt @@ -2180,7 +2180,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseComputerToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseComputerToolCall.kt index 2a91fb216..4c28f99ec 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseComputerToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseComputerToolCall.kt @@ -1435,7 +1435,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Action: $json") + throw OpenAIInvalidDataException("Unknown Action") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContent.kt index 7a56fae67..8c5103d40 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContent.kt @@ -316,7 +316,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseContent: $json") + throw OpenAIInvalidDataException("Unknown ResponseContent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContentPartAddedEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContentPartAddedEvent.kt index 10229e839..57521e12e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContentPartAddedEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContentPartAddedEvent.kt @@ -597,7 +597,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Part: $json") + throw OpenAIInvalidDataException("Unknown Part") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContentPartDoneEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContentPartDoneEvent.kt index f9579fe9f..60c101bd3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContentPartDoneEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseContentPartDoneEvent.kt @@ -596,7 +596,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Part: $json") + throw OpenAIInvalidDataException("Unknown Part") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCreateParams.kt index f4593a4fa..2bbf12922 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCreateParams.kt @@ -57,6 +57,14 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { + /** + * Domain-specific access programs to use for this request. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accessPrograms(): Optional = body.accessPrograms() + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -423,6 +431,13 @@ private constructor( */ @Deprecated("deprecated") fun user(): Optional = body.user() + /** + * Returns the raw JSON value of [accessPrograms]. + * + * Unlike [accessPrograms], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _accessPrograms(): JsonField = body._accessPrograms() + /** * Returns the raw JSON value of [background]. * @@ -677,15 +692,31 @@ 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: + * - [accessPrograms] * - [background] * - [contextManagement] * - [conversation] * - [include] - * - [input] * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } + /** Domain-specific access programs to use for this request. */ + fun accessPrograms(accessPrograms: AccessPrograms) = apply { + body.accessPrograms(accessPrograms) + } + + /** + * Sets [Builder.accessPrograms] to an arbitrary JSON value. + * + * You should usually call [Builder.accessPrograms] with a well-typed [AccessPrograms] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accessPrograms(accessPrograms: JsonField) = apply { + body.accessPrograms(accessPrograms) + } + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -1797,6 +1828,7 @@ private constructor( class Body @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val accessPrograms: JsonField, private val background: JsonField, private val contextManagement: JsonField>, private val conversation: JsonField, @@ -1832,6 +1864,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("access_programs") + @ExcludeMissing + accessPrograms: JsonField = JsonMissing.of(), @JsonProperty("background") @ExcludeMissing background: JsonField = JsonMissing.of(), @@ -1913,6 +1948,7 @@ private constructor( truncation: JsonField = JsonMissing.of(), @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), ) : this( + accessPrograms, background, contextManagement, conversation, @@ -1946,6 +1982,15 @@ private constructor( mutableMapOf(), ) + /** + * Domain-specific access programs to use for this request. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accessPrograms(): Optional = + accessPrograms.getOptional("access_programs") + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -2322,6 +2367,16 @@ private constructor( */ @Deprecated("deprecated") fun user(): Optional = user.getOptional("user") + /** + * Returns the raw JSON value of [accessPrograms]. + * + * Unlike [accessPrograms], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("access_programs") + @ExcludeMissing + fun _accessPrograms(): JsonField = accessPrograms + /** * Returns the raw JSON value of [background]. * @@ -2612,6 +2667,7 @@ private constructor( /** A builder for [Body]. */ class Builder internal constructor() { + private var accessPrograms: JsonField = JsonMissing.of() private var background: JsonField = JsonMissing.of() private var contextManagement: JsonField>? = null private var conversation: JsonField = JsonMissing.of() @@ -2646,6 +2702,7 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { + accessPrograms = body.accessPrograms background = body.background contextManagement = body.contextManagement.map { it.toMutableList() } conversation = body.conversation @@ -2679,6 +2736,21 @@ private constructor( additionalProperties = body.additionalProperties.toMutableMap() } + /** Domain-specific access programs to use for this request. */ + fun accessPrograms(accessPrograms: AccessPrograms) = + accessPrograms(JsonField.of(accessPrograms)) + + /** + * Sets [Builder.accessPrograms] to an arbitrary JSON value. + * + * You should usually call [Builder.accessPrograms] with a well-typed [AccessPrograms] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun accessPrograms(accessPrograms: JsonField) = apply { + this.accessPrograms = accessPrograms + } + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -3672,6 +3744,7 @@ private constructor( */ fun build(): Body = Body( + accessPrograms, background, (contextManagement ?: JsonMissing.of()).map { it.toImmutable() }, conversation, @@ -3722,6 +3795,7 @@ private constructor( return@apply } + accessPrograms().ifPresent { it.validate() } background() contextManagement().ifPresent { it.forEach { it.validate() } } conversation().ifPresent { it.validate() } @@ -3771,7 +3845,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (background.asKnown().isPresent) 1 else 0) + + (accessPrograms.asKnown().getOrNull()?.validity() ?: 0) + + (if (background.asKnown().isPresent) 1 else 0) + (contextManagement.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (conversation.asKnown().getOrNull()?.validity() ?: 0) + (include.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + @@ -3808,6 +3883,7 @@ private constructor( } return other is Body && + accessPrograms == other.accessPrograms && background == other.background && contextManagement == other.contextManagement && conversation == other.conversation && @@ -3843,6 +3919,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + accessPrograms, background, contextManagement, conversation, @@ -3880,7 +3957,332 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{background=$background, contextManagement=$contextManagement, conversation=$conversation, include=$include, input=$input, instructions=$instructions, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, metadata=$metadata, model=$model, moderation=$moderation, parallelToolCalls=$parallelToolCalls, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, store=$store, streamOptions=$streamOptions, temperature=$temperature, text=$text, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, truncation=$truncation, user=$user, additionalProperties=$additionalProperties}" + "Body{accessPrograms=$accessPrograms, background=$background, contextManagement=$contextManagement, conversation=$conversation, include=$include, input=$input, instructions=$instructions, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, metadata=$metadata, model=$model, moderation=$moderation, parallelToolCalls=$parallelToolCalls, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, store=$store, streamOptions=$streamOptions, temperature=$temperature, text=$text, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, truncation=$truncation, user=$user, additionalProperties=$additionalProperties}" + } + + /** Domain-specific access programs to use for this request. */ + class AccessPrograms + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cyber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("cyber") @ExcludeMissing cyber: JsonField = JsonMissing.of() + ) : this(cyber, mutableMapOf()) + + /** + * The Cyber access program to use for this request. Supported values are `standard`, + * `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from the + * model's Cyber tier and your organization and project access, subject to model-specific + * eligibility restrictions. By default, models without a Cyber tier use Standard. Blue-tier + * models use Daybreak Blue when authorized; otherwise they fall back to Standard unless the + * model requires Daybreak access. Red-tier models use Daybreak Red and require + * authorization. Requests that require unavailable Daybreak access return 403. An implicit + * Standard fallback is represented by null in the response's access_programs field, rather + * than an explicit Standard selection. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun cyber(): Optional = cyber.getOptional("cyber") + + /** + * Returns the raw JSON value of [cyber]. + * + * Unlike [cyber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("cyber") @ExcludeMissing fun _cyber(): JsonField = cyber + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [AccessPrograms]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccessPrograms]. */ + class Builder internal constructor() { + + private var cyber: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(accessPrograms: AccessPrograms) = apply { + cyber = accessPrograms.cyber + additionalProperties = accessPrograms.additionalProperties.toMutableMap() + } + + /** + * The Cyber access program to use for this request. Supported values are `standard`, + * `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from + * the model's Cyber tier and your organization and project access, subject to + * model-specific eligibility restrictions. By default, models without a Cyber tier use + * Standard. Blue-tier models use Daybreak Blue when authorized; otherwise they fall + * back to Standard unless the model requires Daybreak access. Red-tier models use + * Daybreak Red and require authorization. Requests that require unavailable Daybreak + * access return 403. An implicit Standard fallback is represented by null in the + * response's access_programs field, rather than an explicit Standard selection. + */ + fun cyber(cyber: Cyber) = cyber(JsonField.of(cyber)) + + /** + * Sets [Builder.cyber] to an arbitrary JSON value. + * + * You should usually call [Builder.cyber] with a well-typed [Cyber] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun cyber(cyber: JsonField) = apply { this.cyber = cyber } + + 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 [AccessPrograms]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): AccessPrograms = AccessPrograms(cyber, 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(): AccessPrograms = apply { + if (validated) { + return@apply + } + + cyber().ifPresent { it.validate() } + 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 = (cyber.asKnown().getOrNull()?.validity() ?: 0) + + /** + * The Cyber access program to use for this request. Supported values are `standard`, + * `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from the + * model's Cyber tier and your organization and project access, subject to model-specific + * eligibility restrictions. By default, models without a Cyber tier use Standard. Blue-tier + * models use Daybreak Blue when authorized; otherwise they fall back to Standard unless the + * model requires Daybreak access. Red-tier models use Daybreak Red and require + * authorization. Requests that require unavailable Daybreak access return 403. An implicit + * Standard fallback is represented by null in the response's access_programs field, rather + * than an explicit Standard selection. + */ + class Cyber @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val STANDARD = of("standard") + + @JvmField val DAYBREAK_BLUE = of("daybreak_blue") + + @JvmField val DAYBREAK_RED = of("daybreak_red") + + @JvmStatic fun of(value: String) = Cyber(JsonField.of(value)) + } + + /** An enum containing [Cyber]'s known values. */ + enum class Known { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + } + + /** + * An enum containing [Cyber]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cyber] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + /** + * An enum member indicating that [Cyber] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + STANDARD -> Value.STANDARD + DAYBREAK_BLUE -> Value.DAYBREAK_BLUE + DAYBREAK_RED -> Value.DAYBREAK_RED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OpenAIInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + STANDARD -> Known.STANDARD + DAYBREAK_BLUE -> Known.DAYBREAK_BLUE + DAYBREAK_RED -> Known.DAYBREAK_RED + else -> throw OpenAIInvalidDataException("Unknown Cyber: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OpenAIInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + OpenAIInvalidDataException("Value is not a String") + } + + 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(): Cyber = apply { + if (validated) { + return@apply + } + + known() + 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 (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Cyber && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccessPrograms && + cyber == other.cyber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(cyber, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AccessPrograms{cyber=$cyber, additionalProperties=$additionalProperties}" } class ContextManagement @@ -4298,7 +4700,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Conversation: $json") + throw OpenAIInvalidDataException("Unknown Conversation") } } @@ -4531,7 +4933,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } @@ -7281,7 +7683,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCustomToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCustomToolCall.kt index 2fe46cf5c..ee2f2a258 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCustomToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCustomToolCall.kt @@ -604,7 +604,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCustomToolCallOutput.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCustomToolCallOutput.kt index e410765dc..9afc21038 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCustomToolCallOutput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCustomToolCallOutput.kt @@ -525,7 +525,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } @@ -797,9 +797,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException( - "Unknown FunctionAndCustomToolCallOutput: $json" - ) + throw OpenAIInvalidDataException("Unknown FunctionAndCustomToolCallOutput") } } @@ -1025,7 +1023,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFormatTextConfig.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFormatTextConfig.kt index 457a271a6..b22b486e0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFormatTextConfig.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFormatTextConfig.kt @@ -261,7 +261,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseFormatTextConfig: $json") + throw OpenAIInvalidDataException("Unknown ResponseFormatTextConfig") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionCallOutputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionCallOutputItem.kt index c9ad7f882..ef6a728d7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionCallOutputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionCallOutputItem.kt @@ -233,7 +233,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseFunctionCallOutputItem: $json") + throw OpenAIInvalidDataException("Unknown ResponseFunctionCallOutputItem") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellCallOutputContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellCallOutputContent.kt index 8fb8df204..d58f69a94 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellCallOutputContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellCallOutputContent.kt @@ -446,7 +446,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Outcome: $json") + throw OpenAIInvalidDataException("Unknown Outcome") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellToolCall.kt index d74d5b688..6706c3036 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellToolCall.kt @@ -950,7 +950,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Environment: $json") + throw OpenAIInvalidDataException("Unknown Environment") } } @@ -1302,7 +1302,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellToolCallOutput.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellToolCallOutput.kt index 53391acea..f14a36dc2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellToolCallOutput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionShellToolCallOutput.kt @@ -956,7 +956,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Outcome: $json") + throw OpenAIInvalidDataException("Unknown Outcome") } } @@ -1552,7 +1552,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCall.kt index bc10a19cb..bdbea5e9d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCall.kt @@ -663,7 +663,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItem.kt index 0335bd590..1a2b88919 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCallOutputItem.kt @@ -668,7 +668,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } @@ -940,9 +940,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException( - "Unknown FunctionAndCustomToolCallOutput: $json" - ) + throw OpenAIInvalidDataException("Unknown FunctionAndCustomToolCallOutput") } } @@ -1312,7 +1310,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionWebSearch.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionWebSearch.kt index 1837ad375..c416212d5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionWebSearch.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionWebSearch.kt @@ -501,7 +501,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Action: $json") + throw OpenAIInvalidDataException("Unknown Action") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputContent.kt index a0ac3cbf4..7ab74e177 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputContent.kt @@ -228,7 +228,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseInputContent: $json") + throw OpenAIInvalidDataException("Unknown ResponseInputContent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputItem.kt index d6da6cd1b..da7064f54 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputItem.kt @@ -1256,7 +1256,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseInputItem: $json") + throw OpenAIInvalidDataException("Unknown ResponseInputItem") } } @@ -3760,7 +3760,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } @@ -3992,7 +3992,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } @@ -9319,7 +9319,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } @@ -9760,7 +9760,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Environment: $json") + throw OpenAIInvalidDataException("Unknown Environment") } } @@ -10596,7 +10596,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } @@ -11627,7 +11627,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Operation: $json") + throw OpenAIInvalidDataException("Unknown Operation") } } @@ -12730,7 +12730,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } @@ -13696,7 +13696,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseItem.kt index 9242d1c10..7c9187d86 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseItem.kt @@ -1119,7 +1119,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseItem: $json") + throw OpenAIInvalidDataException("Unknown ResponseItem") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputItem.kt index 122e779cc..3e6ad8e9d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputItem.kt @@ -1044,7 +1044,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseOutputItem: $json") + throw OpenAIInvalidDataException("Unknown ResponseOutputItem") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputMessage.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputMessage.kt index 489419fa7..e666e88ef 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputMessage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputMessage.kt @@ -580,7 +580,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputText.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputText.kt index 020b611ff..52a48bb4f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputText.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputText.kt @@ -570,7 +570,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Annotation: $json") + throw OpenAIInvalidDataException("Unknown Annotation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputTextAnnotationAddedEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputTextAnnotationAddedEvent.kt index 89084a448..7c61dde5e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputTextAnnotationAddedEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseOutputTextAnnotationAddedEvent.kt @@ -684,7 +684,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Annotation: $json") + throw OpenAIInvalidDataException("Unknown Annotation") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseShellCallOutputContentDoneEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseShellCallOutputContentDoneEvent.kt index e69bf1c6d..93009f1bb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseShellCallOutputContentDoneEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseShellCallOutputContentDoneEvent.kt @@ -860,7 +860,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Outcome: $json") + throw OpenAIInvalidDataException("Unknown Outcome") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerInput.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerInput.kt index 3438c5bec..51d6ac660 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerInput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerInput.kt @@ -207,7 +207,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseSteerInput: $json") + throw OpenAIInvalidDataException("Unknown ResponseSteerInput") } } @@ -430,7 +430,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseSteerInputItem: $json") + throw OpenAIInvalidDataException("Unknown ResponseSteerInputItem") } } @@ -980,7 +980,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Content: $json") + throw OpenAIInvalidDataException("Unknown Content") } } @@ -1736,7 +1736,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Output: $json") + throw OpenAIInvalidDataException("Unknown Output") } } @@ -1970,7 +1970,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Caller: $json") + throw OpenAIInvalidDataException("Unknown Caller") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerInputContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerInputContent.kt index 19743f9ea..79e957ccb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerInputContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerInputContent.kt @@ -233,7 +233,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseSteerInputContent: $json") + throw OpenAIInvalidDataException("Unknown ResponseSteerInputContent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerRequiredInput.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerRequiredInput.kt index 6dbc2d16c..f6cbcd49b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerRequiredInput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseSteerRequiredInput.kt @@ -439,7 +439,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseSteerRequiredInput: $json") + throw OpenAIInvalidDataException("Unknown ResponseSteerRequiredInput") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseStreamEvent.kt index 26af5a7e3..ffe342027 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseStreamEvent.kt @@ -2246,7 +2246,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponseStreamEvent: $json") + throw OpenAIInvalidDataException("Unknown ResponseStreamEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponsesClientEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponsesClientEvent.kt index 0fef2c9d0..362788b75 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponsesClientEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponsesClientEvent.kt @@ -350,7 +350,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponsesClientEvent: $json") + throw OpenAIInvalidDataException("Unknown ResponsesClientEvent") } } @@ -408,6 +408,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val type: JsonValue, + private val accessPrograms: JsonField, private val background: JsonField, private val contextManagement: JsonField>, private val conversation: JsonField, @@ -446,6 +447,9 @@ private constructor( @JsonCreator private constructor( @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(), + @JsonProperty("access_programs") + @ExcludeMissing + accessPrograms: JsonField = JsonMissing.of(), @JsonProperty("background") @ExcludeMissing background: JsonField = JsonMissing.of(), @@ -532,6 +536,7 @@ private constructor( @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), ) : this( type, + accessPrograms, background, contextManagement, conversation, @@ -580,6 +585,15 @@ private constructor( */ @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type + /** + * Domain-specific access programs to use for this request. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accessPrograms(): Optional = + accessPrograms.getOptional("access_programs") + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -981,6 +995,16 @@ private constructor( */ @Deprecated("deprecated") fun user(): Optional = user.getOptional("user") + /** + * Returns the raw JSON value of [accessPrograms]. + * + * Unlike [accessPrograms], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("access_programs") + @ExcludeMissing + fun _accessPrograms(): JsonField = accessPrograms + /** * Returns the raw JSON value of [background]. * @@ -1286,6 +1310,7 @@ private constructor( class Builder internal constructor() { private var type: JsonValue = JsonValue.from("response.create") + private var accessPrograms: JsonField = JsonMissing.of() private var background: JsonField = JsonMissing.of() private var contextManagement: JsonField>? = null private var conversation: JsonField = JsonMissing.of() @@ -1323,6 +1348,7 @@ private constructor( @JvmSynthetic internal fun from(responseCreate: ResponseCreate) = apply { type = responseCreate.type + accessPrograms = responseCreate.accessPrograms background = responseCreate.background contextManagement = responseCreate.contextManagement.map { it.toMutableList() } conversation = responseCreate.conversation @@ -1372,6 +1398,21 @@ private constructor( */ fun type(type: JsonValue) = apply { this.type = type } + /** Domain-specific access programs to use for this request. */ + fun accessPrograms(accessPrograms: AccessPrograms) = + accessPrograms(JsonField.of(accessPrograms)) + + /** + * Sets [Builder.accessPrograms] to an arbitrary JSON value. + * + * You should usually call [Builder.accessPrograms] with a well-typed [AccessPrograms] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun accessPrograms(accessPrograms: JsonField) = apply { + this.accessPrograms = accessPrograms + } + /** * Whether to run the model response in the background. * [Learn more](https://developers.openai.com/api/docs/guides/background). @@ -2413,6 +2454,7 @@ private constructor( fun build(): ResponseCreate = ResponseCreate( type, + accessPrograms, background, (contextManagement ?: JsonMissing.of()).map { it.toImmutable() }, conversation, @@ -2470,6 +2512,7 @@ private constructor( throw OpenAIInvalidDataException("'type' is invalid, received $it") } } + accessPrograms().ifPresent { it.validate() } background() contextManagement().ifPresent { it.forEach { it.validate() } } conversation().ifPresent { it.validate() } @@ -2522,6 +2565,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = type.let { if (it == JsonValue.from("response.create")) 1 else 0 } + + (accessPrograms.asKnown().getOrNull()?.validity() ?: 0) + (if (background.asKnown().isPresent) 1 else 0) + (contextManagement.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (conversation.asKnown().getOrNull()?.validity() ?: 0) + @@ -2555,6 +2599,340 @@ private constructor( (truncation.asKnown().getOrNull()?.validity() ?: 0) + (if (user.asKnown().isPresent) 1 else 0) + /** Domain-specific access programs to use for this request. */ + class AccessPrograms + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cyber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("cyber") @ExcludeMissing cyber: JsonField = JsonMissing.of() + ) : this(cyber, mutableMapOf()) + + /** + * The Cyber access program to use for this request. Supported values are `standard`, + * `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from + * the model's Cyber tier and your organization and project access, subject to + * model-specific eligibility restrictions. By default, models without a Cyber tier use + * Standard. Blue-tier models use Daybreak Blue when authorized; otherwise they fall + * back to Standard unless the model requires Daybreak access. Red-tier models use + * Daybreak Red and require authorization. Requests that require unavailable Daybreak + * access return 403. An implicit Standard fallback is represented by null in the + * response's access_programs field, rather than an explicit Standard selection. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun cyber(): Optional = cyber.getOptional("cyber") + + /** + * Returns the raw JSON value of [cyber]. + * + * Unlike [cyber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("cyber") @ExcludeMissing fun _cyber(): JsonField = cyber + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [AccessPrograms]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccessPrograms]. */ + class Builder internal constructor() { + + private var cyber: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(accessPrograms: AccessPrograms) = apply { + cyber = accessPrograms.cyber + additionalProperties = accessPrograms.additionalProperties.toMutableMap() + } + + /** + * The Cyber access program to use for this request. Supported values are + * `standard`, `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the + * program from the model's Cyber tier and your organization and project access, + * subject to model-specific eligibility restrictions. By default, models without a + * Cyber tier use Standard. Blue-tier models use Daybreak Blue when authorized; + * otherwise they fall back to Standard unless the model requires Daybreak access. + * Red-tier models use Daybreak Red and require authorization. Requests that require + * unavailable Daybreak access return 403. An implicit Standard fallback is + * represented by null in the response's access_programs field, rather than an + * explicit Standard selection. + */ + fun cyber(cyber: Cyber) = cyber(JsonField.of(cyber)) + + /** + * Sets [Builder.cyber] to an arbitrary JSON value. + * + * You should usually call [Builder.cyber] with a well-typed [Cyber] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun cyber(cyber: JsonField) = apply { this.cyber = cyber } + + 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 [AccessPrograms]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): AccessPrograms = + AccessPrograms(cyber, 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(): AccessPrograms = apply { + if (validated) { + return@apply + } + + cyber().ifPresent { it.validate() } + 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 = (cyber.asKnown().getOrNull()?.validity() ?: 0) + + /** + * The Cyber access program to use for this request. Supported values are `standard`, + * `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves the program from + * the model's Cyber tier and your organization and project access, subject to + * model-specific eligibility restrictions. By default, models without a Cyber tier use + * Standard. Blue-tier models use Daybreak Blue when authorized; otherwise they fall + * back to Standard unless the model requires Daybreak access. Red-tier models use + * Daybreak Red and require authorization. Requests that require unavailable Daybreak + * access return 403. An implicit Standard fallback is represented by null in the + * response's access_programs field, rather than an explicit Standard selection. + */ + class Cyber @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val STANDARD = of("standard") + + @JvmField val DAYBREAK_BLUE = of("daybreak_blue") + + @JvmField val DAYBREAK_RED = of("daybreak_red") + + @JvmStatic fun of(value: String) = Cyber(JsonField.of(value)) + } + + /** An enum containing [Cyber]'s known values. */ + enum class Known { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + } + + /** + * An enum containing [Cyber]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cyber] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + STANDARD, + DAYBREAK_BLUE, + DAYBREAK_RED, + /** + * An enum member indicating that [Cyber] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + STANDARD -> Value.STANDARD + DAYBREAK_BLUE -> Value.DAYBREAK_BLUE + DAYBREAK_RED -> Value.DAYBREAK_RED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OpenAIInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + STANDARD -> Known.STANDARD + DAYBREAK_BLUE -> Known.DAYBREAK_BLUE + DAYBREAK_RED -> Known.DAYBREAK_RED + else -> throw OpenAIInvalidDataException("Unknown Cyber: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws OpenAIInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + OpenAIInvalidDataException("Value is not a String") + } + + 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(): Cyber = apply { + if (validated) { + return@apply + } + + known() + 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 (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Cyber && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccessPrograms && + cyber == other.cyber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(cyber, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AccessPrograms{cyber=$cyber, additionalProperties=$additionalProperties}" + } + class ContextManagement @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -2980,7 +3358,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Conversation: $json") + throw OpenAIInvalidDataException("Unknown Conversation") } } @@ -3224,7 +3602,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } @@ -6049,7 +6427,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } @@ -6291,6 +6669,7 @@ private constructor( return other is ResponseCreate && type == other.type && + accessPrograms == other.accessPrograms && background == other.background && contextManagement == other.contextManagement && conversation == other.conversation && @@ -6329,6 +6708,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( type, + accessPrograms, background, contextManagement, conversation, @@ -6368,6 +6748,6 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ResponseCreate{type=$type, background=$background, contextManagement=$contextManagement, conversation=$conversation, include=$include, input=$input, instructions=$instructions, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, metadata=$metadata, model=$model, moderation=$moderation, parallelToolCalls=$parallelToolCalls, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, store=$store, stream=$stream, streamId=$streamId, streamOptions=$streamOptions, temperature=$temperature, text=$text, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, truncation=$truncation, user=$user, additionalProperties=$additionalProperties}" + "ResponseCreate{type=$type, accessPrograms=$accessPrograms, background=$background, contextManagement=$contextManagement, conversation=$conversation, include=$include, input=$input, instructions=$instructions, maxOutputTokens=$maxOutputTokens, maxToolCalls=$maxToolCalls, metadata=$metadata, model=$model, moderation=$moderation, parallelToolCalls=$parallelToolCalls, previousResponseId=$previousResponseId, prompt=$prompt, promptCacheKey=$promptCacheKey, promptCacheOptions=$promptCacheOptions, promptCacheRetention=$promptCacheRetention, reasoning=$reasoning, safetyIdentifier=$safetyIdentifier, serviceTier=$serviceTier, store=$store, stream=$stream, streamId=$streamId, streamOptions=$streamOptions, temperature=$temperature, text=$text, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, truncation=$truncation, user=$user, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponsesServerEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponsesServerEvent.kt index a10e16474..b8bb89463 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponsesServerEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/ResponsesServerEvent.kt @@ -2965,7 +2965,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ResponsesServerEvent: $json") + throw OpenAIInvalidDataException("Unknown ResponsesServerEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/StructuredResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/StructuredResponse.kt index c5ddbf076..029c7ad96 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/StructuredResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/StructuredResponse.kt @@ -22,6 +22,12 @@ class StructuredResponse( /** @see Response.id */ fun id(): String = rawResponse.id() + /** @see Response.accessPrograms */ + fun accessPrograms(): Optional = rawResponse.accessPrograms() + + /** @see Response._accessPrograms */ + fun _accessPrograms(): JsonField = rawResponse._accessPrograms() + /** @see Response.createdAt */ fun createdAt(): Double = rawResponse.createdAt() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/StructuredResponseCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/StructuredResponseCreateParams.kt index 8ee91eecd..0b3152a31 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/StructuredResponseCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/StructuredResponseCreateParams.kt @@ -67,6 +67,16 @@ class StructuredResponseCreateParams( this.paramsBuilder = paramsBuilder } + /** @see ResponseCreateParams.Builder.accessPrograms */ + fun accessPrograms(accessPrograms: ResponseCreateParams.AccessPrograms) = apply { + paramsBuilder.accessPrograms(accessPrograms) + } + + /** @see ResponseCreateParams.Builder.accessPrograms */ + fun accessPrograms(accessPrograms: JsonField) = apply { + paramsBuilder.accessPrograms(accessPrograms) + } + // The `body(...)` function is deliberately not supported. /** @see ResponseCreateParams.Builder.input */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/Tool.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/Tool.kt index 71fd62c9c..e9fac8384 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/Tool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/Tool.kt @@ -688,7 +688,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Tool: $json") + throw OpenAIInvalidDataException("Unknown Tool") } } @@ -1861,7 +1861,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown AllowedTools: $json") + throw OpenAIInvalidDataException("Unknown AllowedTools") } } @@ -2679,7 +2679,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown RequireApproval: $json") + throw OpenAIInvalidDataException("Unknown RequireApproval") } } @@ -4076,7 +4076,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Container: $json") + throw OpenAIInvalidDataException("Unknown Container") } } @@ -4792,7 +4792,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown NetworkPolicy: $json") + throw OpenAIInvalidDataException("Unknown NetworkPolicy") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/responses/inputtokens/InputTokenCountParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/responses/inputtokens/InputTokenCountParams.kt index 1e621bbb5..a3d82ed0d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/responses/inputtokens/InputTokenCountParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/responses/inputtokens/InputTokenCountParams.kt @@ -1990,7 +1990,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Conversation: $json") + throw OpenAIInvalidDataException("Unknown Conversation") } } @@ -2221,7 +2221,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Input: $json") + throw OpenAIInvalidDataException("Unknown Input") } } @@ -3249,7 +3249,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown ToolChoice: $json") + throw OpenAIInvalidDataException("Unknown ToolChoice") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/skills/SkillCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/skills/SkillCreateParams.kt index b621e5f0f..8316f79ba 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/skills/SkillCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/skills/SkillCreateParams.kt @@ -565,7 +565,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Files: $json") + throw OpenAIInvalidDataException("Unknown Files") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/skills/versions/VersionCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/skills/versions/VersionCreateParams.kt index d24872966..28b0d59e8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/skills/versions/VersionCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/skills/versions/VersionCreateParams.kt @@ -645,7 +645,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Files: $json") + throw OpenAIInvalidDataException("Unknown Files") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/FileChunkingStrategy.kt b/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/FileChunkingStrategy.kt index a3183f634..6d19821aa 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/FileChunkingStrategy.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/FileChunkingStrategy.kt @@ -200,7 +200,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown FileChunkingStrategy: $json") + throw OpenAIInvalidDataException("Unknown FileChunkingStrategy") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/FileChunkingStrategyParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/FileChunkingStrategyParam.kt index df558cecd..8f39b547d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/FileChunkingStrategyParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/FileChunkingStrategyParam.kt @@ -205,7 +205,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown FileChunkingStrategyParam: $json") + throw OpenAIInvalidDataException("Unknown FileChunkingStrategyParam") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/VectorStoreSearchParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/VectorStoreSearchParams.kt index ff2c412cf..d8020ba01 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/VectorStoreSearchParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/vectorstores/VectorStoreSearchParams.kt @@ -926,7 +926,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Query: $json") + throw OpenAIInvalidDataException("Unknown Query") } } @@ -1166,7 +1166,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Filters: $json") + throw OpenAIInvalidDataException("Unknown Filters") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateError.kt b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateError.kt index b5e12a485..cba56fe48 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateError.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateError.kt @@ -12,6 +12,7 @@ import com.openai.core.JsonField import com.openai.core.JsonMissing import com.openai.core.JsonValue import com.openai.core.checkRequired +import com.openai.core.toImmutable import com.openai.errors.OpenAIInvalidDataException import java.util.Collections import java.util.Objects @@ -24,6 +25,7 @@ class VideoCreateError private constructor( private val code: JsonField, private val message: JsonField, + private val headers: JsonField, private val misalignment: JsonField, private val additionalProperties: MutableMap, ) { @@ -32,10 +34,11 @@ private constructor( private constructor( @JsonProperty("code") @ExcludeMissing code: JsonField = JsonMissing.of(), @JsonProperty("message") @ExcludeMissing message: JsonField = JsonMissing.of(), + @JsonProperty("headers") @ExcludeMissing headers: JsonField = JsonMissing.of(), @JsonProperty("misalignment") @ExcludeMissing misalignment: JsonField = JsonMissing.of(), - ) : this(code, message, misalignment, mutableMapOf()) + ) : this(code, message, headers, misalignment, mutableMapOf()) /** * A machine-readable error code that was returned. @@ -53,6 +56,14 @@ private constructor( */ fun message(): String = message.getRequired("message") + /** + * The Retry-After and Retry-After-Ms headers returned with the original error, if any. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun headers(): Optional = headers.getOptional("headers") + /** * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -73,6 +84,13 @@ private constructor( */ @JsonProperty("message") @ExcludeMissing fun _message(): JsonField = message + /** + * Returns the raw JSON value of [headers]. + * + * Unlike [headers], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("headers") @ExcludeMissing fun _headers(): JsonField = headers + /** * Returns the raw JSON value of [misalignment]. * @@ -113,6 +131,7 @@ private constructor( private var code: JsonField? = null private var message: JsonField? = null + private var headers: JsonField = JsonMissing.of() private var misalignment: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -120,6 +139,7 @@ private constructor( internal fun from(videoCreateError: VideoCreateError) = apply { code = videoCreateError.code message = videoCreateError.message + headers = videoCreateError.headers misalignment = videoCreateError.misalignment additionalProperties = videoCreateError.additionalProperties.toMutableMap() } @@ -146,6 +166,17 @@ private constructor( */ fun message(message: JsonField) = apply { this.message = message } + /** The Retry-After and Retry-After-Ms headers returned with the original error, if any. */ + fun headers(headers: Headers) = headers(JsonField.of(headers)) + + /** + * Sets [Builder.headers] to an arbitrary JSON value. + * + * You should usually call [Builder.headers] with a well-typed [Headers] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun headers(headers: JsonField) = apply { this.headers = headers } + fun misalignment(misalignment: Misalignment) = misalignment(JsonField.of(misalignment)) /** @@ -195,6 +226,7 @@ private constructor( VideoCreateError( checkRequired("code", code), checkRequired("message", message), + headers, misalignment, additionalProperties.toMutableMap(), ) @@ -217,6 +249,7 @@ private constructor( code() message() + headers().ifPresent { it.validate() } misalignment().ifPresent { it.validate() } validated = true } @@ -238,8 +271,118 @@ private constructor( internal fun validity(): Int = (if (code.asKnown().isPresent) 1 else 0) + (if (message.asKnown().isPresent) 1 else 0) + + (headers.asKnown().getOrNull()?.validity() ?: 0) + (misalignment.asKnown().getOrNull()?.validity() ?: 0) + /** The Retry-After and Retry-After-Ms headers returned with the original error, if any. */ + class Headers + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Headers]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Headers]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(headers: Headers) = apply { + additionalProperties = headers.additionalProperties.toMutableMap() + } + + 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 [Headers]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Headers = Headers(additionalProperties.toImmutable()) + } + + 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(): Headers = apply { + if (validated) { + return@apply + } + + 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 = + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Headers && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Headers{additionalProperties=$additionalProperties}" + } + class Misalignment @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -834,16 +977,17 @@ private constructor( return other is VideoCreateError && code == other.code && message == other.message && + headers == other.headers && misalignment == other.misalignment && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(code, message, misalignment, additionalProperties) + Objects.hash(code, message, headers, misalignment, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "VideoCreateError{code=$code, message=$message, misalignment=$misalignment, additionalProperties=$additionalProperties}" + "VideoCreateError{code=$code, message=$message, headers=$headers, misalignment=$misalignment, additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateParams.kt index a608ebcc0..2b739f6f5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoCreateParams.kt @@ -924,7 +924,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown InputReference: $json") + throw OpenAIInvalidDataException("Unknown InputReference") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoEditParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoEditParams.kt index f9a7474aa..d9b2529d0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoEditParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoEditParams.kt @@ -666,7 +666,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Video: $json") + throw OpenAIInvalidDataException("Unknown Video") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoExtendParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoExtendParams.kt index 577741bca..c335dba51 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoExtendParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/videos/VideoExtendParams.kt @@ -748,7 +748,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Video: $json") + throw OpenAIInvalidDataException("Unknown Video") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/webhooks/UnwrapWebhookEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/webhooks/UnwrapWebhookEvent.kt index dd5e39b3a..7f16bd559 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/webhooks/UnwrapWebhookEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/webhooks/UnwrapWebhookEvent.kt @@ -879,7 +879,7 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown UnwrapWebhookEvent: $json") + throw OpenAIInvalidDataException("Unknown UnwrapWebhookEvent") } } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/audio/TranscriptionServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/audio/TranscriptionServiceAsync.kt index d570926f7..93bf8750a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/audio/TranscriptionServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/audio/TranscriptionServiceAsync.kt @@ -32,8 +32,9 @@ interface TranscriptionServiceAsync { /** * Transcribes audio into the input language. * - * Returns a transcription object in `json`, `diarized_json`, or `verbose_json` format, or a - * stream of transcript events. + * Returns a transcription object in `json`, `diarized_json`, or `verbose_json` format, plain + * text in `text`, `srt`, or `vtt` format, or a stream of transcript events. Supported formats + * depend on the model. */ fun create(params: TranscriptionCreateParams): CompletableFuture = create(params, RequestOptions.none()) @@ -47,8 +48,9 @@ interface TranscriptionServiceAsync { /** * Transcribes audio into the input language. * - * Returns a transcription object in `json`, `diarized_json`, or `verbose_json` format, or a - * stream of transcript events. + * Returns a transcription object in `json`, `diarized_json`, or `verbose_json` format, plain + * text in `text`, `srt`, or `vtt` format, or a stream of transcript events. Supported formats + * depend on the model. */ fun createStreaming( params: TranscriptionCreateParams diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/agents/vaults/CredentialServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/agents/vaults/CredentialServiceAsync.kt index 2a1a16c0f..36ead073b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/agents/vaults/CredentialServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/agents/vaults/CredentialServiceAsync.kt @@ -83,7 +83,7 @@ interface CredentialServiceAsync { ): CompletableFuture /** - * Rotates a vault credential's write-only secret and returns only credential metadata. See + * Updates credential metadata or rotates its write-only secret. See * [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults). */ fun update( diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/audio/TranscriptionService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/audio/TranscriptionService.kt index 6efcf4205..d7a6f3407 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/audio/TranscriptionService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/audio/TranscriptionService.kt @@ -30,8 +30,9 @@ interface TranscriptionService { /** * Transcribes audio into the input language. * - * Returns a transcription object in `json`, `diarized_json`, or `verbose_json` format, or a - * stream of transcript events. + * Returns a transcription object in `json`, `diarized_json`, or `verbose_json` format, plain + * text in `text`, `srt`, or `vtt` format, or a stream of transcript events. Supported formats + * depend on the model. */ fun create(params: TranscriptionCreateParams): TranscriptionCreateResponse = create(params, RequestOptions.none()) @@ -45,8 +46,9 @@ interface TranscriptionService { /** * Transcribes audio into the input language. * - * Returns a transcription object in `json`, `diarized_json`, or `verbose_json` format, or a - * stream of transcript events. + * Returns a transcription object in `json`, `diarized_json`, or `verbose_json` format, plain + * text in `text`, `srt`, or `vtt` format, or a stream of transcript events. Supported formats + * depend on the model. */ @MustBeClosed fun createStreaming( diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/agents/vaults/CredentialService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/agents/vaults/CredentialService.kt index a0f97515c..b10668ad7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/agents/vaults/CredentialService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/agents/vaults/CredentialService.kt @@ -78,7 +78,7 @@ interface CredentialService { ): Credential /** - * Rotates a vault credential's write-only secret and returns only credential metadata. See + * Updates credential metadata or rotates its write-only secret. See * [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults). */ fun update(credentialId: String, params: CredentialUpdateParams): Credential = diff --git a/openai-java-core/src/test/kotlin/com/openai/helpers/EnvironmentCredentialVisitorCompatibilityTest.kt b/openai-java-core/src/test/kotlin/com/openai/helpers/EnvironmentCredentialVisitorCompatibilityTest.kt index b6f38cb32..873af6dea 100644 --- a/openai-java-core/src/test/kotlin/com/openai/helpers/EnvironmentCredentialVisitorCompatibilityTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/helpers/EnvironmentCredentialVisitorCompatibilityTest.kt @@ -135,9 +135,7 @@ internal class EnvironmentCredentialVisitorCompatibilityTest { } .cause assertThat(error).isInstanceOf(OpenAIInvalidDataException::class.java) - assertThat(error?.message) - .doesNotContain("fake-secret") - .contains("[REDACTED]", "future_field", "preserved") + assertThat(error).hasMessage("Unknown ${union.simpleName}") assertThat(jsonMapper().readTree(jsonMapper().writeValueAsString(auth))) .isEqualTo(expected) } diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParamTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParamTest.kt index d5ce0f3c8..320b2655f 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParamTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParamTest.kt @@ -109,7 +109,7 @@ internal class CredentialAuthRotateParamTest { .contains("[REDACTED]", "future_field", "preserved") } assertThat(auth._json()).contains(raw) - assertThat(params._body().auth()._json()).contains(raw) + assertThat(params._body().auth().get()._json()).contains(raw) assertThat(mapper.readTree(mapper.writeValueAsString(auth))) .isEqualTo(mapper.readTree(original)) } @@ -157,7 +157,8 @@ internal class CredentialAuthRotateParamTest { } assertThat(environmentVariable.secretValue()).isEqualTo(secret) assertThat(environmentVariable._additionalProperties()["secret_value"]).isEqualTo(raw) - assertThat(params._body().auth().asEnvironmentVariable()).isEqualTo(environmentVariable) + assertThat(params._body().auth().get().asEnvironmentVariable()) + .isEqualTo(environmentVariable) assertThat(mapper.writeValueAsString(auth)).isEqualTo(serialized) assertThat(serialized).contains(secret, "fake-additional-secret") assertThat(mapper.readTree(serialized).get("secret_value")) @@ -184,7 +185,8 @@ internal class CredentialAuthRotateParamTest { val mapper = jsonMapper() assertThat(mapper.readTree(mapper.writeValueAsString(auth)).get("secret_value").asText()) .isEqualTo(secret) - assertThat(params._body().auth().asEnvironmentVariable().secretValue()).isEqualTo(secret) + assertThat(params._body().auth().get().asEnvironmentVariable().secretValue()) + .isEqualTo(secret) } @Test diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthTest.kt index a2fb94f29..8925e2074 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthTest.kt @@ -36,6 +36,7 @@ internal class CredentialAuthTest { .id("credential_test") .auth(auth) .createdAt(0L) + .metadata(Credential.Metadata.builder().build()) .name("Test credential") .updatedAt(0L) .vaultId("vault_test") @@ -49,9 +50,7 @@ internal class CredentialAuthTest { } val error = assertThrows { auth.validate() } assertThat(error).hasNoCause() - assertThat(error.message) - .doesNotContain(secret) - .contains("[REDACTED]", "future_field", "preserved") + assertThat(error).hasMessage("Unknown CredentialAuth") assertThat(auth._json()).contains(raw) assertThat(credential.auth()._json()).contains(raw) assertThat(mapper.readTree(mapper.writeValueAsString(auth))) @@ -60,14 +59,14 @@ internal class CredentialAuthTest { @ParameterizedTest @ValueSource(strings = ["{}", "{\"type\":\"future\",\"future_field\":\"preserved\"}"]) - fun unknownDiagnosticsWithoutSecretAreUnchanged(json: String) { + fun unknownDiagnosticsOmitPayloadWithoutChangingToString(json: String) { val mapper = jsonMapper() val raw = mapper.readValue(json, jacksonTypeRef()) val auth = mapper.readValue(json, jacksonTypeRef()) assertThat(auth.toString()).isEqualTo("CredentialAuth{_unknown=$raw}") assertThat(assertThrows { auth.validate() }) - .hasMessage("Unknown CredentialAuth: $raw") + .hasMessage("Unknown CredentialAuth") } @ParameterizedTest @@ -99,6 +98,7 @@ internal class CredentialAuthTest { .id("credential_test") .auth(auth) .createdAt(0L) + .metadata(Credential.Metadata.builder().build()) .name("Test credential") .updatedAt(0L) .vaultId("vault_test") @@ -264,7 +264,7 @@ internal class CredentialAuthTest { jsonMapper().convertValue(testCase.value, jacksonTypeRef()) val e = assertThrows { credentialAuth.validate() } - assertThat(e).hasMessage("Unknown CredentialAuth: ${testCase.value}") + assertThat(e).hasMessage("Unknown CredentialAuth") assertThat(credentialAuth.toString()) .isEqualTo("CredentialAuth{_unknown=${testCase.value}}") } diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialCreateParamsTest.kt index 331549da2..4c3c0fb20 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialCreateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialCreateParamsTest.kt @@ -2,6 +2,7 @@ package com.openai.models.beta.agents.vaults.credentials +import com.openai.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -29,6 +30,11 @@ internal class CredentialCreateParamsTest { .build() ) .name("x") + .metadata( + CredentialCreateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .build() } @@ -74,6 +80,11 @@ internal class CredentialCreateParamsTest { .build() ) .name("x") + .metadata( + CredentialCreateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .build() val body = params._body() @@ -99,6 +110,12 @@ internal class CredentialCreateParamsTest { ) ) assertThat(body.name()).isEqualTo("x") + assertThat(body.metadata()) + .contains( + CredentialCreateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) } @Test diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialListPageResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialListPageResponseTest.kt index 177566daf..66db6f5cf 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialListPageResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialListPageResponseTest.kt @@ -3,6 +3,7 @@ package com.openai.models.beta.agents.vaults.credentials import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.openai.core.JsonValue import com.openai.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -32,6 +33,11 @@ internal class CredentialListPageResponseTest { .build() ) .createdAt(0L) + .metadata( + Credential.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .name("name") .updatedAt(0L) .vaultId("vault_id") @@ -62,6 +68,11 @@ internal class CredentialListPageResponseTest { .build() ) .createdAt(0L) + .metadata( + Credential.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .name("name") .updatedAt(0L) .vaultId("vault_id") @@ -96,6 +107,11 @@ internal class CredentialListPageResponseTest { .build() ) .createdAt(0L) + .metadata( + Credential.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .name("name") .updatedAt(0L) .vaultId("vault_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialTest.kt index 9b3febbad..ee3fc7695 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialTest.kt @@ -3,6 +3,7 @@ package com.openai.models.beta.agents.vaults.credentials import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.openai.core.JsonValue import com.openai.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -30,6 +31,11 @@ internal class CredentialTest { .build() ) .createdAt(0L) + .metadata( + Credential.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .name("name") .updatedAt(0L) .vaultId("vault_id") @@ -55,6 +61,12 @@ internal class CredentialTest { ) ) assertThat(credential.createdAt()).isEqualTo(0L) + assertThat(credential.metadata()) + .isEqualTo( + Credential.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) assertThat(credential.name()).isEqualTo("name") assertThat(credential.updatedAt()).isEqualTo(0L) assertThat(credential.vaultId()).isEqualTo("vault_id") @@ -82,6 +94,11 @@ internal class CredentialTest { .build() ) .createdAt(0L) + .metadata( + Credential.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .name("name") .updatedAt(0L) .vaultId("vault_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialUpdateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialUpdateParamsTest.kt index 630a46567..5a1f4f51a 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialUpdateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialUpdateParamsTest.kt @@ -2,6 +2,7 @@ package com.openai.models.beta.agents.vaults.credentials +import com.openai.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -29,6 +30,11 @@ internal class CredentialUpdateParamsTest { ) .build() ) + .metadata( + CredentialUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .build() } @@ -38,7 +44,6 @@ internal class CredentialUpdateParamsTest { CredentialUpdateParams.builder() .vaultId("vault_id") .credentialId("credential_id") - .auth(CredentialAuthRotateParam.McpOAuth.builder().build()) .build() assertThat(params._pathParam(0)).isEqualTo("vault_id") @@ -70,12 +75,17 @@ internal class CredentialUpdateParamsTest { ) .build() ) + .metadata( + CredentialUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .build() val body = params._body() assertThat(body.auth()) - .isEqualTo( + .contains( CredentialAuthRotateParam.ofMcpOAuth( CredentialAuthRotateParam.McpOAuth.builder() .accessToken("access_token") @@ -94,6 +104,12 @@ internal class CredentialUpdateParamsTest { .build() ) ) + assertThat(body.metadata()) + .contains( + CredentialUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) } @Test @@ -102,16 +118,8 @@ internal class CredentialUpdateParamsTest { CredentialUpdateParams.builder() .vaultId("vault_id") .credentialId("credential_id") - .auth(CredentialAuthRotateParam.McpOAuth.builder().build()) .build() val body = params._body() - - assertThat(body.auth()) - .isEqualTo( - CredentialAuthRotateParam.ofMcpOAuth( - CredentialAuthRotateParam.McpOAuth.builder().build() - ) - ) } } diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCompletedEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCompletedEventTest.kt index bd0746693..7eb4ecd7a 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCompletedEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCompletedEventTest.kt @@ -17,6 +17,11 @@ internal class BetaResponseCompletedEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -262,6 +267,11 @@ internal class BetaResponseCompletedEventTest { .isEqualTo( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -508,6 +518,11 @@ internal class BetaResponseCompletedEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCreatedEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCreatedEventTest.kt index 5cc4f1c70..78a9f9750 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCreatedEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCreatedEventTest.kt @@ -17,6 +17,11 @@ internal class BetaResponseCreatedEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -262,6 +267,11 @@ internal class BetaResponseCreatedEventTest { .isEqualTo( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -508,6 +518,11 @@ internal class BetaResponseCreatedEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFailedEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFailedEventTest.kt index cdd4ed69e..dd42860f2 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFailedEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFailedEventTest.kt @@ -17,6 +17,11 @@ internal class BetaResponseFailedEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -262,6 +267,11 @@ internal class BetaResponseFailedEventTest { .isEqualTo( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -508,6 +518,11 @@ internal class BetaResponseFailedEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInProgressEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInProgressEventTest.kt index 96eb6d202..f3ef08846 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInProgressEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInProgressEventTest.kt @@ -17,6 +17,11 @@ internal class BetaResponseInProgressEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -262,6 +267,11 @@ internal class BetaResponseInProgressEventTest { .isEqualTo( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -508,6 +518,11 @@ internal class BetaResponseInProgressEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseIncompleteEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseIncompleteEventTest.kt index 9b72db119..b830e8730 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseIncompleteEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseIncompleteEventTest.kt @@ -17,6 +17,11 @@ internal class BetaResponseIncompleteEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -262,6 +267,11 @@ internal class BetaResponseIncompleteEventTest { .isEqualTo( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -508,6 +518,11 @@ internal class BetaResponseIncompleteEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseQueuedEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseQueuedEventTest.kt index a94d25ee8..947857bd5 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseQueuedEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseQueuedEventTest.kt @@ -17,6 +17,11 @@ internal class BetaResponseQueuedEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -262,6 +267,11 @@ internal class BetaResponseQueuedEventTest { .isEqualTo( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -508,6 +518,11 @@ internal class BetaResponseQueuedEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseStreamEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseStreamEventTest.kt index c3dd0190a..a65a4458d 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseStreamEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseStreamEventTest.kt @@ -1058,6 +1058,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -1371,6 +1376,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -1954,6 +1964,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -2267,6 +2282,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -3737,6 +3757,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -4051,6 +4076,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -4318,6 +4348,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -4631,6 +4666,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -4896,6 +4936,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -5210,6 +5255,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -8690,6 +8740,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -9003,6 +9058,11 @@ internal class BetaResponseStreamEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseTest.kt index 69a09c3ba..fffc7a74f 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseTest.kt @@ -3,6 +3,7 @@ package com.openai.models.beta.responses import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.openai.core.JsonNull import com.openai.core.JsonValue import com.openai.core.jsonMapper import org.assertj.core.api.Assertions.assertThat @@ -10,11 +11,42 @@ import org.junit.jupiter.api.Test internal class BetaResponseTest { + @Test + fun buildWithoutAccessPrograms() { + val response = + BetaResponse.builder() + .id("response-id") + .createdAt(0.0) + .error(null) + .incompleteDetails(null) + .instructions(null) + .metadata(null) + .model("test-model") + .output(listOf()) + .parallelToolCalls(false) + .temperature(null) + .toolChoice(JsonNull.of()) + .tools(listOf()) + .topP(null) + .build() + + assertThat(response.accessPrograms()).isEmpty() + assertThat(response._accessPrograms()).isEqualTo(JsonNull.of()) + val json = jsonMapper().readTree(jsonMapper().writeValueAsString(response)) + assertThat(json.has("access_programs")).isTrue() + assertThat(json.get("access_programs").isNull).isTrue() + } + @Test fun create() { val betaResponse = BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -245,6 +277,12 @@ internal class BetaResponseTest { .build() assertThat(betaResponse.id()).isEqualTo("id") + assertThat(betaResponse.accessPrograms()) + .contains( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) assertThat(betaResponse.createdAt()).isEqualTo(0.0) assertThat(betaResponse.error()) .contains( @@ -492,6 +530,11 @@ internal class BetaResponseTest { val betaResponse = BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesClientEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesClientEventTest.kt index d730e0643..91d26ac46 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesClientEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesClientEventTest.kt @@ -18,6 +18,13 @@ internal class BetaResponsesClientEventTest { fun ofResponseCreate() { val responseCreate = BetaResponsesClientEvent.ResponseCreate.builder() + .accessPrograms( + BetaResponsesClientEvent.ResponseCreate.AccessPrograms.builder() + .cyber( + BetaResponsesClientEvent.ResponseCreate.AccessPrograms.Cyber.STANDARD + ) + .build() + ) .background(true) .addContextManagement( BetaResponsesClientEvent.ResponseCreate.ContextManagement.builder() @@ -171,6 +178,14 @@ internal class BetaResponsesClientEventTest { val betaResponsesClientEvent = BetaResponsesClientEvent.ofResponseCreate( BetaResponsesClientEvent.ResponseCreate.builder() + .accessPrograms( + BetaResponsesClientEvent.ResponseCreate.AccessPrograms.builder() + .cyber( + BetaResponsesClientEvent.ResponseCreate.AccessPrograms.Cyber + .STANDARD + ) + .build() + ) .background(true) .addContextManagement( BetaResponsesClientEvent.ResponseCreate.ContextManagement.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesServerEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesServerEventTest.kt index 6f9afe867..2e1694f94 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesServerEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesServerEventTest.kt @@ -1164,6 +1164,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -1483,6 +1488,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -2076,6 +2086,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -2394,6 +2409,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -3817,6 +3837,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -4136,6 +4161,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -4403,6 +4433,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -4721,6 +4756,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -4986,6 +5026,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -5305,6 +5350,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -8931,6 +8981,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() @@ -9249,6 +9304,11 @@ internal class BetaResponsesServerEventTest { .response( BetaResponse.builder() .id("id") + .accessPrograms( + BetaResponse.AccessPrograms.builder() + .cyber(BetaResponse.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( BetaResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/ResponseCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/ResponseCreateParamsTest.kt index 8358b14a8..6e9265d56 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/ResponseCreateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/ResponseCreateParamsTest.kt @@ -14,6 +14,11 @@ internal class ResponseCreateParamsTest { fun create() { ResponseCreateParams.builder() .addBeta(ResponseCreateParams.Beta.RESPONSES_MULTI_AGENT_V1) + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() @@ -136,6 +141,11 @@ internal class ResponseCreateParamsTest { val params = ResponseCreateParams.builder() .addBeta(ResponseCreateParams.Beta.RESPONSES_MULTI_AGENT_V1) + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() @@ -276,6 +286,11 @@ internal class ResponseCreateParamsTest { val params = ResponseCreateParams.builder() .addBeta(ResponseCreateParams.Beta.RESPONSES_MULTI_AGENT_V1) + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() @@ -398,6 +413,12 @@ internal class ResponseCreateParamsTest { val body = params._body() + assertThat(body.accessPrograms()) + .contains( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) assertThat(body.background()).contains(true) assertThat(body.contextManagement().getOrNull()) .containsExactly( diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCompletedEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCompletedEventTest.kt index cbe9452a5..c9dc3cdb5 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCompletedEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCompletedEventTest.kt @@ -21,6 +21,11 @@ internal class ResponseCompletedEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -256,6 +261,11 @@ internal class ResponseCompletedEventTest { .isEqualTo( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -491,6 +501,11 @@ internal class ResponseCompletedEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCreateParamsTest.kt index c5ee83752..291dbdf7c 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCreateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCreateParamsTest.kt @@ -17,6 +17,11 @@ internal class ResponseCreateParamsTest { @Test fun create() { ResponseCreateParams.builder() + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() @@ -132,6 +137,11 @@ internal class ResponseCreateParamsTest { fun body() { val params = ResponseCreateParams.builder() + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() @@ -248,6 +258,12 @@ internal class ResponseCreateParamsTest { val body = params._body() + assertThat(body.accessPrograms()) + .contains( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) assertThat(body.background()).contains(true) assertThat(body.contextManagement().getOrNull()) .containsExactly( diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCreatedEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCreatedEventTest.kt index 8de489c37..3335eb31e 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCreatedEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseCreatedEventTest.kt @@ -21,6 +21,11 @@ internal class ResponseCreatedEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -256,6 +261,11 @@ internal class ResponseCreatedEventTest { .isEqualTo( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -491,6 +501,11 @@ internal class ResponseCreatedEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseFailedEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseFailedEventTest.kt index cc3101cf0..67298294b 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseFailedEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseFailedEventTest.kt @@ -21,6 +21,11 @@ internal class ResponseFailedEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -256,6 +261,11 @@ internal class ResponseFailedEventTest { .isEqualTo( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -491,6 +501,11 @@ internal class ResponseFailedEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseInProgressEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseInProgressEventTest.kt index dd591d07b..cc7521d3d 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseInProgressEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseInProgressEventTest.kt @@ -21,6 +21,11 @@ internal class ResponseInProgressEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -256,6 +261,11 @@ internal class ResponseInProgressEventTest { .isEqualTo( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -491,6 +501,11 @@ internal class ResponseInProgressEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseIncompleteEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseIncompleteEventTest.kt index b33e70234..963cea025 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseIncompleteEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseIncompleteEventTest.kt @@ -21,6 +21,11 @@ internal class ResponseIncompleteEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -256,6 +261,11 @@ internal class ResponseIncompleteEventTest { .isEqualTo( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -491,6 +501,11 @@ internal class ResponseIncompleteEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseQueuedEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseQueuedEventTest.kt index 50ff4aa0e..58423f921 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseQueuedEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseQueuedEventTest.kt @@ -21,6 +21,11 @@ internal class ResponseQueuedEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -256,6 +261,11 @@ internal class ResponseQueuedEventTest { .isEqualTo( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -491,6 +501,11 @@ internal class ResponseQueuedEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseStreamEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseStreamEventTest.kt index 343506bee..8e4a78f35 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseStreamEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseStreamEventTest.kt @@ -938,6 +938,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -1241,6 +1246,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -1793,6 +1803,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -2096,6 +2111,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -3435,6 +3455,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -3738,6 +3763,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -3996,6 +4026,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -4299,6 +4334,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -4557,6 +4597,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -4860,6 +4905,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -7998,6 +8048,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -8301,6 +8356,11 @@ internal class ResponseStreamEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseTest.kt index ed3abd4e3..31c36e3df 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseTest.kt @@ -3,6 +3,7 @@ package com.openai.models.responses import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.openai.core.JsonNull import com.openai.core.JsonValue import com.openai.core.jsonMapper import com.openai.models.ChatModel @@ -15,11 +16,42 @@ import org.junit.jupiter.api.Test internal class ResponseTest { + @Test + fun buildWithoutAccessPrograms() { + val response = + Response.builder() + .id("response-id") + .createdAt(0.0) + .error(null) + .incompleteDetails(null) + .instructions(null) + .metadata(null) + .model("test-model") + .output(listOf()) + .parallelToolCalls(false) + .temperature(null) + .toolChoice(JsonNull.of()) + .tools(listOf()) + .topP(null) + .build() + + assertThat(response.accessPrograms()).isEmpty() + assertThat(response._accessPrograms()).isEqualTo(JsonNull.of()) + val json = jsonMapper().readTree(jsonMapper().writeValueAsString(response)) + assertThat(json.has("access_programs")).isTrue() + assertThat(json.get("access_programs").isNull).isTrue() + } + @Test fun create() { val response = Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -241,6 +273,12 @@ internal class ResponseTest { .build() assertThat(response.id()).isEqualTo("id") + assertThat(response.accessPrograms()) + .contains( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) assertThat(response.createdAt()).isEqualTo(0.0) assertThat(response.error()) .contains( @@ -479,6 +517,11 @@ internal class ResponseTest { val response = Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponsesClientEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponsesClientEventTest.kt index f694a1c98..3cbceae58 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponsesClientEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponsesClientEventTest.kt @@ -22,6 +22,11 @@ internal class ResponsesClientEventTest { fun ofResponseCreate() { val responseCreate = ResponsesClientEvent.ResponseCreate.builder() + .accessPrograms( + ResponsesClientEvent.ResponseCreate.AccessPrograms.builder() + .cyber(ResponsesClientEvent.ResponseCreate.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponsesClientEvent.ResponseCreate.ContextManagement.builder() @@ -162,6 +167,13 @@ internal class ResponsesClientEventTest { val responsesClientEvent = ResponsesClientEvent.ofResponseCreate( ResponsesClientEvent.ResponseCreate.builder() + .accessPrograms( + ResponsesClientEvent.ResponseCreate.AccessPrograms.builder() + .cyber( + ResponsesClientEvent.ResponseCreate.AccessPrograms.Cyber.STANDARD + ) + .build() + ) .background(true) .addContextManagement( ResponsesClientEvent.ResponseCreate.ContextManagement.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponsesServerEventTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponsesServerEventTest.kt index 95ff62808..c151b529e 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponsesServerEventTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/ResponsesServerEventTest.kt @@ -1034,6 +1034,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -1340,6 +1345,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -1901,6 +1911,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -2207,6 +2222,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -3499,6 +3519,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -3805,6 +3830,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -4063,6 +4093,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -4369,6 +4404,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -4627,6 +4667,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -4933,6 +4978,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -8198,6 +8248,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() @@ -8504,6 +8559,11 @@ internal class ResponsesServerEventTest { .response( Response.builder() .id("id") + .accessPrograms( + Response.AccessPrograms.builder() + .cyber(Response.AccessPrograms.Cyber.STANDARD) + .build() + ) .createdAt(0.0) .error( ResponseError.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseCreateParamsTest.kt index 970d86337..690ef8a7e 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseCreateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseCreateParamsTest.kt @@ -135,6 +135,13 @@ internal class StructuredResponseCreateParamsTest { DelegationWriteTestCase("input", JSON_FIELD), DelegationWriteTestCase("input", STRING), DelegationWriteTestCase("inputOfResponse", LIST), + DelegationWriteTestCase( + "accessPrograms", + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build(), + ), + DelegationWriteTestCase("accessPrograms", JSON_FIELD), DelegationWriteTestCase("model", RESPONSES_MODEL), DelegationWriteTestCase("model", JSON_FIELD), DelegationWriteTestCase("model", STRING), diff --git a/openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseTest.kt index 6e805023e..8c0f5ca8e 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseTest.kt @@ -56,6 +56,8 @@ internal class StructuredResponseTest { private fun delegationTestCases() = listOf( DelegationReadTestCase("id", STRING), + DelegationReadTestCase("accessPrograms", OPTIONAL), + DelegationReadTestCase("_accessPrograms", JSON_FIELD), DelegationReadTestCase("createdAt", DOUBLE), DelegationReadTestCase("error", OPTIONAL), DelegationReadTestCase("incompleteDetails", OPTIONAL), diff --git a/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoCreateErrorTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoCreateErrorTest.kt index 975810a65..0bb4e2e3b 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoCreateErrorTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoCreateErrorTest.kt @@ -3,6 +3,7 @@ package com.openai.models.videos import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.openai.core.JsonValue import com.openai.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -15,6 +16,11 @@ internal class VideoCreateErrorTest { VideoCreateError.builder() .code("code") .message("message") + .headers( + VideoCreateError.Headers.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .misalignment( VideoCreateError.Misalignment.builder() .detailedExplanation("detailed_explanation") @@ -31,6 +37,12 @@ internal class VideoCreateErrorTest { assertThat(videoCreateError.code()).isEqualTo("code") assertThat(videoCreateError.message()).isEqualTo("message") + assertThat(videoCreateError.headers()) + .contains( + VideoCreateError.Headers.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) assertThat(videoCreateError.misalignment()) .contains( VideoCreateError.Misalignment.builder() @@ -50,6 +62,11 @@ internal class VideoCreateErrorTest { VideoCreateError.builder() .code("code") .message("message") + .headers( + VideoCreateError.Headers.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .misalignment( VideoCreateError.Misalignment.builder() .detailedExplanation("detailed_explanation") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoListPageResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoListPageResponseTest.kt index 64ea9a19d..246eeef00 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoListPageResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoListPageResponseTest.kt @@ -3,6 +3,7 @@ package com.openai.models.videos import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.openai.core.JsonValue import com.openai.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -22,6 +23,11 @@ internal class VideoListPageResponseTest { VideoCreateError.builder() .code("code") .message("message") + .headers( + VideoCreateError.Headers.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .misalignment( VideoCreateError.Misalignment.builder() .detailedExplanation("detailed_explanation") @@ -63,6 +69,11 @@ internal class VideoListPageResponseTest { VideoCreateError.builder() .code("code") .message("message") + .headers( + VideoCreateError.Headers.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .misalignment( VideoCreateError.Misalignment.builder() .detailedExplanation("detailed_explanation") @@ -108,6 +119,11 @@ internal class VideoListPageResponseTest { VideoCreateError.builder() .code("code") .message("message") + .headers( + VideoCreateError.Headers.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .misalignment( VideoCreateError.Misalignment.builder() .detailedExplanation("detailed_explanation") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoTest.kt index 5327995a8..6f7c1a3a7 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/videos/VideoTest.kt @@ -3,6 +3,7 @@ package com.openai.models.videos import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.openai.core.JsonValue import com.openai.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -20,6 +21,11 @@ internal class VideoTest { VideoCreateError.builder() .code("code") .message("message") + .headers( + VideoCreateError.Headers.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .misalignment( VideoCreateError.Misalignment.builder() .detailedExplanation("detailed_explanation") @@ -54,6 +60,11 @@ internal class VideoTest { VideoCreateError.builder() .code("code") .message("message") + .headers( + VideoCreateError.Headers.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .misalignment( VideoCreateError.Misalignment.builder() .detailedExplanation("detailed_explanation") @@ -92,6 +103,11 @@ internal class VideoTest { VideoCreateError.builder() .code("code") .message("message") + .headers( + VideoCreateError.Headers.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .misalignment( VideoCreateError.Misalignment.builder() .detailedExplanation("detailed_explanation") diff --git a/openai-java-core/src/test/kotlin/com/openai/services/EnvironmentCredentialsTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/EnvironmentCredentialsTest.kt index aaba3154e..f19f5aaa9 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/EnvironmentCredentialsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/EnvironmentCredentialsTest.kt @@ -286,7 +286,7 @@ internal class EnvironmentCredentialsTest { aResponse() .withHeader("Content-Type", "application/json") .withBody( - """{"id":"credential_test","auth":$auth,"created_at":1700000000,"updated_at":1700000000,"name":"Test credential","object":"vault.credential","vault_id":"vault_test"}""" + """{"id":"credential_test","metadata":{},"auth":$auth,"created_at":1700000000,"updated_at":1700000000,"name":"Test credential","object":"vault.credential","vault_id":"vault_test"}""" ) private fun unrestrictedMetadata() = diff --git a/openai-java-core/src/test/kotlin/com/openai/services/ResponseStreamEventValidationTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/ResponseStreamEventValidationTest.kt index cc0edae2d..a05aa0fcc 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/ResponseStreamEventValidationTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/ResponseStreamEventValidationTest.kt @@ -45,8 +45,7 @@ internal class ResponseStreamEventValidationTest { assertThat(result.error) .isInstanceOf(OpenAIInvalidDataException::class.java) - .hasMessageContaining("Unknown ResponseStreamEvent") - .hasMessageContaining("type=future.event") + .hasMessage("Unknown ResponseStreamEvent") assertThat(result.events.map(::eventType)).containsExactly("response.output_text.delta") assertThat(result.outputTextDeltas()).containsExactly("before") } diff --git a/openai-java-core/src/test/kotlin/com/openai/services/async/ResponseServiceAsyncTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/async/ResponseServiceAsyncTest.kt index 8941cbc11..3a238c31c 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/async/ResponseServiceAsyncTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/async/ResponseServiceAsyncTest.kt @@ -37,6 +37,11 @@ internal class ResponseServiceAsyncTest { val responseFuture = responseServiceAsync.create( ResponseCreateParams.builder() + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() @@ -174,6 +179,11 @@ internal class ResponseServiceAsyncTest { val responseStreamResponse = responseServiceAsync.createStreaming( ResponseCreateParams.builder() + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/services/async/beta/ResponseServiceAsyncTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/async/beta/ResponseServiceAsyncTest.kt index a43d2c177..b3f18d8ca 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/async/beta/ResponseServiceAsyncTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/async/beta/ResponseServiceAsyncTest.kt @@ -35,6 +35,11 @@ internal class ResponseServiceAsyncTest { responseServiceAsync.create( ResponseCreateParams.builder() .addBeta(ResponseCreateParams.Beta.RESPONSES_MULTI_AGENT_V1) + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() @@ -178,6 +183,11 @@ internal class ResponseServiceAsyncTest { responseServiceAsync.createStreaming( ResponseCreateParams.builder() .addBeta(ResponseCreateParams.Beta.RESPONSES_MULTI_AGENT_V1) + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/services/async/beta/agents/vaults/CredentialServiceAsyncTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/async/beta/agents/vaults/CredentialServiceAsyncTest.kt index 65b6bc334..6878d6091 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/async/beta/agents/vaults/CredentialServiceAsyncTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/async/beta/agents/vaults/CredentialServiceAsyncTest.kt @@ -4,6 +4,7 @@ package com.openai.services.async.beta.agents.vaults import com.openai.TestServerExtension import com.openai.client.okhttp.OpenAIOkHttpClientAsync +import com.openai.core.JsonValue import com.openai.models.beta.agents.vaults.credentials.CredentialAuthCreateParam import com.openai.models.beta.agents.vaults.credentials.CredentialAuthRotateParam import com.openai.models.beta.agents.vaults.credentials.CredentialCreateParams @@ -49,6 +50,11 @@ internal class CredentialServiceAsyncTest { .build() ) .name("x") + .metadata( + CredentialCreateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .build() ) @@ -111,6 +117,11 @@ internal class CredentialServiceAsyncTest { ) .build() ) + .metadata( + CredentialUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .build() ) diff --git a/openai-java-core/src/test/kotlin/com/openai/services/blocking/ResponseServiceTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/blocking/ResponseServiceTest.kt index 953075ea6..d7a593e33 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/blocking/ResponseServiceTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/blocking/ResponseServiceTest.kt @@ -37,6 +37,11 @@ internal class ResponseServiceTest { val response = responseService.create( ResponseCreateParams.builder() + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() @@ -173,6 +178,11 @@ internal class ResponseServiceTest { val responseStreamResponse = responseService.createStreaming( ResponseCreateParams.builder() + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/ResponseServiceTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/ResponseServiceTest.kt index 0757f6436..8a043afcc 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/ResponseServiceTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/ResponseServiceTest.kt @@ -35,6 +35,11 @@ internal class ResponseServiceTest { responseService.create( ResponseCreateParams.builder() .addBeta(ResponseCreateParams.Beta.RESPONSES_MULTI_AGENT_V1) + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() @@ -177,6 +182,11 @@ internal class ResponseServiceTest { responseService.createStreaming( ResponseCreateParams.builder() .addBeta(ResponseCreateParams.Beta.RESPONSES_MULTI_AGENT_V1) + .accessPrograms( + ResponseCreateParams.AccessPrograms.builder() + .cyber(ResponseCreateParams.AccessPrograms.Cyber.STANDARD) + .build() + ) .background(true) .addContextManagement( ResponseCreateParams.ContextManagement.builder() diff --git a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/agents/vaults/CredentialServiceTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/agents/vaults/CredentialServiceTest.kt index dd3f08b39..03633685f 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/agents/vaults/CredentialServiceTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/agents/vaults/CredentialServiceTest.kt @@ -4,6 +4,7 @@ package com.openai.services.blocking.beta.agents.vaults import com.openai.TestServerExtension import com.openai.client.okhttp.OpenAIOkHttpClient +import com.openai.core.JsonValue import com.openai.models.beta.agents.vaults.credentials.CredentialAuthCreateParam import com.openai.models.beta.agents.vaults.credentials.CredentialAuthRotateParam import com.openai.models.beta.agents.vaults.credentials.CredentialCreateParams @@ -49,6 +50,11 @@ internal class CredentialServiceTest { .build() ) .name("x") + .metadata( + CredentialCreateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .build() ) @@ -109,6 +115,11 @@ internal class CredentialServiceTest { ) .build() ) + .metadata( + CredentialUpdateParams.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) .build() )