From 2ca768ad80da1643680ce99fee977080e19f2e2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Jul 2026 16:42:33 +0000 Subject: [PATCH 1/6] feat(api): gpt-5.6-sol updates --- .stats.yml | 8 +- .../kotlin/com/openai/models/ChatModel.kt | 18 + .../kotlin/com/openai/models/Reasoning.kt | 228 +- .../com/openai/models/ReasoningEffort.kt | 21 +- .../beta/assistants/AssistantCreateParams.kt | 71 +- .../beta/assistants/AssistantUpdateParams.kt | 71 +- .../beta/responses/BetaApplyPatchTool.kt | 376 + .../beta/responses/BetaCompactedResponse.kt | 558 + .../beta/responses/BetaComputerAction.kt | 2881 ++ .../models/beta/responses/BetaComputerTool.kt | 171 + .../responses/BetaComputerUsePreviewTool.kt | 477 + .../beta/responses/BetaContainerAuto.kt | 987 + .../BetaContainerNetworkPolicyAllowlist.kt | 311 + .../BetaContainerNetworkPolicyDisabled.kt | 173 + .../BetaContainerNetworkPolicyDomainSecret.kt | 259 + .../beta/responses/BetaContainerReference.kt | 227 + .../models/beta/responses/BetaCustomTool.kt | 1188 + .../beta/responses/BetaEasyInputMessage.kt | 1004 + .../beta/responses/BetaFileSearchTool.kt | 3930 +++ .../beta/responses/BetaFunctionShellTool.kt | 699 + .../models/beta/responses/BetaFunctionTool.kt | 894 + .../models/beta/responses/BetaInlineSkill.kt | 303 + .../beta/responses/BetaInlineSkillSource.kt | 262 + .../beta/responses/BetaLocalEnvironment.kt | 228 + .../models/beta/responses/BetaLocalSkill.kt | 260 + .../beta/responses/BetaNamespaceTool.kt | 1336 + .../models/beta/responses/BetaResponse.kt | 9394 ++++++ .../BetaResponseApplyPatchToolCall.kt | 2209 ++ .../BetaResponseApplyPatchToolCallOutput.kt | 1216 + .../responses/BetaResponseAudioDeltaEvent.kt | 475 + .../responses/BetaResponseAudioDoneEvent.kt | 439 + .../BetaResponseAudioTranscriptDeltaEvent.kt | 479 + .../BetaResponseAudioTranscriptDoneEvent.kt | 443 + ...sponseCodeInterpreterCallCodeDeltaEvent.kt | 557 + ...esponseCodeInterpreterCallCodeDoneEvent.kt | 557 + ...sponseCodeInterpreterCallCompletedEvent.kt | 525 + ...ponseCodeInterpreterCallInProgressEvent.kt | 525 + ...nseCodeInterpreterCallInterpretingEvent.kt | 525 + .../BetaResponseCodeInterpreterToolCall.kt | 1444 + .../responses/BetaResponseCompactionItem.kt | 512 + .../BetaResponseCompactionItemParam.kt | 484 + .../responses/BetaResponseCompletedEvent.kt | 478 + .../responses/BetaResponseComputerToolCall.kt | 1320 + .../BetaResponseComputerToolCallOutputItem.kt | 1073 + ...esponseComputerToolCallOutputScreenshot.kt | 251 + .../BetaResponseContainerReference.kt | 227 + .../beta/responses/BetaResponseContent.kt | 600 + .../BetaResponseContentPartAddedEvent.kt | 1104 + .../BetaResponseContentPartDoneEvent.kt | 1104 + .../BetaResponseConversationParam.kt | 183 + .../responses/BetaResponseCreatedEvent.kt | 478 + .../responses/BetaResponseCustomToolCall.kt | 1062 + ...taResponseCustomToolCallInputDeltaEvent.kt | 556 + ...etaResponseCustomToolCallInputDoneEvent.kt | 556 + .../BetaResponseCustomToolCallItem.kt | 733 + .../BetaResponseCustomToolCallOutput.kt | 1535 + .../BetaResponseCustomToolCallOutputItem.kt | 683 + .../beta/responses/BetaResponseError.kt | 458 + .../beta/responses/BetaResponseErrorEvent.kt | 553 + .../beta/responses/BetaResponseFailedEvent.kt | 478 + ...etaResponseFileSearchCallCompletedEvent.kt | 518 + ...taResponseFileSearchCallInProgressEvent.kt | 520 + ...etaResponseFileSearchCallSearchingEvent.kt | 518 + .../BetaResponseFileSearchToolCall.kt | 1180 + .../responses/BetaResponseFormatTextConfig.kt | 332 + .../BetaResponseFormatTextJsonSchemaConfig.kt | 484 + ...ResponseFunctionCallArgumentsDeltaEvent.kt | 556 + ...aResponseFunctionCallArgumentsDoneEvent.kt | 600 + .../BetaResponseFunctionCallOutputItem.kt | 290 + ...aResponseFunctionShellCallOutputContent.kt | 731 + .../BetaResponseFunctionShellToolCall.kt | 1819 ++ ...BetaResponseFunctionShellToolCallOutput.kt | 2063 ++ .../responses/BetaResponseFunctionToolCall.kt | 1261 + .../BetaResponseFunctionToolCallItem.kt | 748 + .../BetaResponseFunctionToolCallOutputItem.kt | 1767 ++ .../BetaResponseFunctionWebSearch.kt | 1906 ++ .../BetaResponseImageGenCallCompletedEvent.kt | 520 + ...BetaResponseImageGenCallGeneratingEvent.kt | 522 + ...BetaResponseImageGenCallInProgressEvent.kt | 520 + ...taResponseImageGenCallPartialImageEvent.kt | 630 + .../responses/BetaResponseInProgressEvent.kt | 478 + .../beta/responses/BetaResponseIncludable.kt | 195 + .../responses/BetaResponseIncompleteEvent.kt | 478 + .../BetaResponseInjectCreatedEvent.kt | 312 + .../beta/responses/BetaResponseInjectEvent.kt | 573 + .../BetaResponseInjectFailedEvent.kt | 1038 + .../beta/responses/BetaResponseInputAudio.kt | 574 + .../responses/BetaResponseInputContent.kt | 284 + .../beta/responses/BetaResponseInputFile.kt | 734 + .../responses/BetaResponseInputFileContent.kt | 752 + .../beta/responses/BetaResponseInputImage.kt | 673 + .../BetaResponseInputImageContent.kt | 671 + .../beta/responses/BetaResponseInputItem.kt | 24772 ++++++++++++++++ .../responses/BetaResponseInputMessageItem.kt | 888 + .../beta/responses/BetaResponseInputText.kt | 437 + .../responses/BetaResponseInputTextContent.kt | 444 + .../models/beta/responses/BetaResponseItem.kt | 13038 ++++++++ .../responses/BetaResponseLocalEnvironment.kt | 171 + .../BetaResponseMcpCallArgumentsDeltaEvent.kt | 554 + .../BetaResponseMcpCallArgumentsDoneEvent.kt | 563 + .../BetaResponseMcpCallCompletedEvent.kt | 517 + .../BetaResponseMcpCallFailedEvent.kt | 516 + .../BetaResponseMcpCallInProgressEvent.kt | 517 + .../BetaResponseMcpListToolsCompletedEvent.kt | 518 + .../BetaResponseMcpListToolsFailedEvent.kt | 518 + ...BetaResponseMcpListToolsInProgressEvent.kt | 518 + .../beta/responses/BetaResponseOutputAudio.kt | 262 + .../beta/responses/BetaResponseOutputItem.kt | 12967 ++++++++ .../BetaResponseOutputItemAddedEvent.kt | 699 + .../BetaResponseOutputItemDoneEvent.kt | 699 + .../responses/BetaResponseOutputMessage.kt | 1140 + .../responses/BetaResponseOutputRefusal.kt | 223 + .../beta/responses/BetaResponseOutputText.kt | 2514 ++ ...aResponseOutputTextAnnotationAddedEvent.kt | 645 + .../beta/responses/BetaResponsePrompt.kt | 383 + .../beta/responses/BetaResponseQueuedEvent.kt | 478 + .../responses/BetaResponseReasoningItem.kt | 1198 + ...aResponseReasoningSummaryPartAddedEvent.kt | 812 + ...taResponseReasoningSummaryPartDoneEvent.kt | 994 + ...aResponseReasoningSummaryTextDeltaEvent.kt | 606 + ...taResponseReasoningSummaryTextDoneEvent.kt | 606 + .../BetaResponseReasoningTextDeltaEvent.kt | 604 + .../BetaResponseReasoningTextDoneEvent.kt | 603 + .../BetaResponseRefusalDeltaEvent.kt | 601 + .../responses/BetaResponseRefusalDoneEvent.kt | 609 + .../beta/responses/BetaResponseStatus.kt | 170 + .../beta/responses/BetaResponseStreamEvent.kt | 2851 ++ .../beta/responses/BetaResponseTextConfig.kt | 409 + .../responses/BetaResponseTextDeltaEvent.kt | 1126 + .../responses/BetaResponseTextDoneEvent.kt | 1126 + .../responses/BetaResponseToolSearchCall.kt | 887 + .../BetaResponseToolSearchOutputItem.kt | 1035 + .../BetaResponseToolSearchOutputItemParam.kt | 992 + .../beta/responses/BetaResponseUsage.kt | 786 + ...BetaResponseWebSearchCallCompletedEvent.kt | 518 + ...etaResponseWebSearchCallInProgressEvent.kt | 520 + ...BetaResponseWebSearchCallSearchingEvent.kt | 518 + .../responses/BetaResponsesClientEvent.kt | 8384 ++++++ .../responses/BetaResponsesServerEvent.kt | 2972 ++ .../beta/responses/BetaSkillReference.kt | 257 + .../openai/models/beta/responses/BetaTool.kt | 7168 +++++ .../beta/responses/BetaToolChoiceAllowed.kt | 556 + .../responses/BetaToolChoiceApplyPatch.kt | 169 + .../beta/responses/BetaToolChoiceCustom.kt | 223 + .../beta/responses/BetaToolChoiceFunction.kt | 223 + .../beta/responses/BetaToolChoiceMcp.kt | 269 + .../beta/responses/BetaToolChoiceOptions.kt | 157 + .../beta/responses/BetaToolChoiceShell.kt | 169 + .../beta/responses/BetaToolChoiceTypes.kt | 389 + .../beta/responses/BetaToolSearchTool.kt | 412 + .../responses/BetaWebSearchPreviewTool.kt | 1099 + .../beta/responses/BetaWebSearchTool.kt | 1249 + .../beta/responses/ResponseCancelParams.kt | 396 + .../beta/responses/ResponseCompactParams.kt | 3060 ++ .../beta/responses/ResponseCreateParams.kt | 9777 ++++++ .../beta/responses/ResponseDeleteParams.kt | 392 + .../beta/responses/ResponseRetrieveParams.kt | 461 + .../inputitems/BetaResponseItemList.kt | 543 + .../responses/inputitems/InputItemListPage.kt | 287 + .../inputitems/InputItemListPageAsync.kt | 302 + .../inputitems/InputItemListParams.kt | 604 + .../inputtokens/InputTokenCountParams.kt | 4973 ++++ .../inputtokens/InputTokenCountResponse.kt | 220 + .../beta/threads/runs/RunCreateParams.kt | 71 +- .../completions/ChatCompletionContentPart.kt | 234 +- .../ChatCompletionContentPartImage.kt | 220 +- .../ChatCompletionContentPartInputAudio.kt | 221 +- .../ChatCompletionContentPartText.kt | 222 +- .../completions/ChatCompletionCreateParams.kt | 1637 +- .../models/completions/CompletionUsage.kt | 55 +- .../ComputerScreenshotContent.kt | 218 +- .../conversations/ConversationCreateParams.kt | 18 + .../conversations/items/ConversationItem.kt | 850 + .../items/ConversationItemList.kt | 8 + .../conversations/items/ItemCreateParams.kt | 18 + .../CreateEvalCompletionsRunDataSource.kt | 36 +- .../models/evals/runs/RunCancelResponse.kt | 82 +- .../models/evals/runs/RunCreateParams.kt | 82 +- .../models/evals/runs/RunCreateResponse.kt | 82 +- .../models/evals/runs/RunListResponse.kt | 82 +- .../models/evals/runs/RunRetrieveResponse.kt | 82 +- .../graders/gradermodels/ScoreModelGrader.kt | 36 +- .../realtime/RealtimeResponseCreateMcpTool.kt | 201 +- .../realtime/RealtimeSessionCreateRequest.kt | 12 + .../realtime/RealtimeToolsConfigUnion.kt | 205 +- .../RealtimeSessionCreateResponse.kt | 221 +- .../openai/models/responses/ApplyPatchTool.kt | 220 +- .../models/responses/CompactedResponse.kt | 10 + .../com/openai/models/responses/CustomTool.kt | 214 +- .../models/responses/FunctionShellTool.kt | 214 +- .../openai/models/responses/FunctionTool.kt | 381 +- .../openai/models/responses/NamespaceTool.kt | 401 +- .../com/openai/models/responses/Response.kt | 649 +- .../responses/ResponseApplyPatchToolCall.kt | 485 +- .../ResponseApplyPatchToolCallOutput.kt | 495 +- .../models/responses/ResponseCompactParams.kt | 651 +- .../models/responses/ResponseCreateParams.kt | 1899 +- .../responses/ResponseCustomToolCall.kt | 496 +- .../responses/ResponseCustomToolCallItem.kt | 68 +- .../responses/ResponseCustomToolCallOutput.kt | 489 +- .../ResponseCustomToolCallOutputItem.kt | 73 +- .../openai/models/responses/ResponseError.kt | 6 + .../ResponseFunctionShellToolCall.kt | 495 +- .../ResponseFunctionShellToolCallOutput.kt | 484 +- .../responses/ResponseFunctionToolCall.kt | 505 +- .../responses/ResponseFunctionToolCallItem.kt | 79 +- .../ResponseFunctionToolCallOutputItem.kt | 487 +- .../models/responses/ResponseInputFile.kt | 260 +- .../responses/ResponseInputFileContent.kt | 267 +- .../models/responses/ResponseInputImage.kt | 218 +- .../responses/ResponseInputImageContent.kt | 225 +- .../models/responses/ResponseInputItem.kt | 14455 +++++---- .../models/responses/ResponseInputText.kt | 222 +- .../responses/ResponseInputTextContent.kt | 229 +- .../openai/models/responses/ResponseItem.kt | 850 + .../models/responses/ResponseOutputItem.kt | 1074 +- .../responses/ResponseOutputItemAddedEvent.kt | 7 + .../responses/ResponseOutputItemDoneEvent.kt | 7 + .../ResponseReasoningSummaryPartDoneEvent.kt | 181 +- .../responses/ResponseToolSearchOutputItem.kt | 3 + .../ResponseToolSearchOutputItemParam.kt | 3 + .../openai/models/responses/ResponseUsage.kt | 58 +- .../models/responses/ResponsesClientEvent.kt | 1859 +- .../com/openai/models/responses/Tool.kt | 463 +- .../responses/inputitems/InputItemListPage.kt | 8 + .../inputitems/InputItemListPageAsync.kt | 8 + .../responses/inputitems/ResponseItemList.kt | 7 + .../inputtokens/InputTokenCountParams.kt | 95 +- .../SafetyIdentifierBlockedWebhookEvent.kt | 809 + .../models/webhooks/UnwrapWebhookEvent.kt | 50 +- .../openai/services/async/BetaServiceAsync.kt | 8 - .../services/async/BetaServiceAsyncImpl.kt | 12 - .../async/beta/ResponseServiceAsync.kt | 517 + .../async/beta/ResponseServiceAsyncImpl.kt | 418 + .../beta/responses/InputItemServiceAsync.kt | 117 + .../responses/InputItemServiceAsyncImpl.kt | 104 + .../beta/responses/InputTokenServiceAsync.kt | 89 + .../responses/InputTokenServiceAsyncImpl.kt | 92 + .../openai/services/blocking/BetaService.kt | 8 - .../services/blocking/BetaServiceImpl.kt | 12 - .../services/blocking/beta/ResponseService.kt | 508 + .../blocking/beta/ResponseServiceImpl.kt | 382 + .../beta/responses/InputItemService.kt | 110 + .../beta/responses/InputItemServiceImpl.kt | 99 + .../beta/responses/InputTokenService.kt | 86 + .../beta/responses/InputTokenServiceImpl.kt | 88 + .../kotlin/com/openai/models/AllModelsTest.kt | 4 +- .../kotlin/com/openai/models/ReasoningTest.kt | 3 + .../com/openai/models/ResponsesModelTest.kt | 4 +- .../beta/responses/BetaApplyPatchToolTest.kt | 40 + .../responses/BetaCompactedResponseTest.kt | 211 + .../beta/responses/BetaComputerActionTest.kt | 361 + .../beta/responses/BetaComputerToolTest.kt | 30 + .../BetaComputerUsePreviewToolTest.kt | 45 + .../beta/responses/BetaContainerAutoTest.kt | 58 + ...BetaContainerNetworkPolicyAllowlistTest.kt | 62 + .../BetaContainerNetworkPolicyDisabledTest.kt | 33 + ...aContainerNetworkPolicyDomainSecretTest.kt | 45 + .../responses/BetaContainerReferenceTest.kt | 34 + .../beta/responses/BetaCustomToolTest.kt | 52 + .../responses/BetaEasyInputMessageTest.kt | 48 + .../beta/responses/BetaFileSearchToolTest.kt | 102 + .../responses/BetaFunctionShellToolTest.kt | 73 + .../beta/responses/BetaFunctionToolTest.kt | 85 + .../responses/BetaInlineSkillSourceTest.kt | 32 + .../beta/responses/BetaInlineSkillTest.kt | 45 + .../responses/BetaLocalEnvironmentTest.kt | 58 + .../beta/responses/BetaLocalSkillTest.kt | 36 + .../beta/responses/BetaNamespaceToolTest.kt | 90 + ...etaResponseApplyPatchToolCallOutputTest.kt | 70 + .../BetaResponseApplyPatchToolCallTest.kt | 84 + .../BetaResponseAudioDeltaEventTest.kt | 45 + .../BetaResponseAudioDoneEventTest.kt | 42 + ...taResponseAudioTranscriptDeltaEventTest.kt | 58 + ...etaResponseAudioTranscriptDoneEventTest.kt | 53 + ...seCodeInterpreterCallCodeDeltaEventTest.kt | 64 + ...nseCodeInterpreterCallCodeDoneEventTest.kt | 64 + ...seCodeInterpreterCallCompletedEventTest.kt | 61 + ...eCodeInterpreterCallInProgressEventTest.kt | 61 + ...odeInterpreterCallInterpretingEventTest.kt | 61 + ...BetaResponseCodeInterpreterToolCallTest.kt | 72 + .../BetaResponseCompactionItemParamTest.kt | 53 + .../BetaResponseCompactionItemTest.kt | 48 + .../BetaResponseCompletedEventTest.kt | 683 + ...aResponseComputerToolCallOutputItemTest.kt | 107 + ...nseComputerToolCallOutputScreenshotTest.kt | 43 + .../BetaResponseComputerToolCallTest.kt | 130 + .../BetaResponseContainerReferenceTest.kt | 35 + .../BetaResponseContentPartAddedEventTest.kt | 143 + .../BetaResponseContentPartDoneEventTest.kt | 139 + .../beta/responses/BetaResponseContentTest.kt | 312 + .../BetaResponseConversationParamTest.kt | 35 + .../responses/BetaResponseCreatedEventTest.kt | 683 + ...sponseCustomToolCallInputDeltaEventTest.kt | 64 + ...esponseCustomToolCallInputDoneEventTest.kt | 64 + .../BetaResponseCustomToolCallItemTest.kt | 66 + ...etaResponseCustomToolCallOutputItemTest.kt | 67 + .../BetaResponseCustomToolCallOutputTest.kt | 60 + .../BetaResponseCustomToolCallTest.kt | 58 + .../responses/BetaResponseErrorEventTest.kt | 51 + .../beta/responses/BetaResponseErrorTest.kt | 41 + .../responses/BetaResponseFailedEventTest.kt | 683 + ...esponseFileSearchCallCompletedEventTest.kt | 61 + ...sponseFileSearchCallInProgressEventTest.kt | 61 + ...esponseFileSearchCallSearchingEventTest.kt | 61 + .../BetaResponseFileSearchToolCallTest.kt | 98 + .../BetaResponseFormatTextConfigTest.kt | 130 + ...aResponseFormatTextJsonSchemaConfigTest.kt | 62 + ...onseFunctionCallArgumentsDeltaEventTest.kt | 64 + ...ponseFunctionCallArgumentsDoneEventTest.kt | 67 + .../BetaResponseFunctionCallOutputItemTest.kt | 173 + ...ponseFunctionShellCallOutputContentTest.kt | 46 + ...ResponseFunctionShellToolCallOutputTest.kt | 97 + .../BetaResponseFunctionShellToolCallTest.kt | 97 + .../BetaResponseFunctionToolCallItemTest.kt | 66 + ...aResponseFunctionToolCallOutputItemTest.kt | 73 + .../BetaResponseFunctionToolCallTest.kt | 62 + .../BetaResponseFunctionWebSearchTest.kt | 87 + ...aResponseImageGenCallCompletedEventTest.kt | 61 + ...ResponseImageGenCallGeneratingEventTest.kt | 61 + ...ResponseImageGenCallInProgressEventTest.kt | 61 + ...sponseImageGenCallPartialImageEventTest.kt | 68 + .../BetaResponseInProgressEventTest.kt | 683 + .../BetaResponseIncompleteEventTest.kt | 683 + .../BetaResponseInjectCreatedEventTest.kt | 45 + .../responses/BetaResponseInjectEventTest.kt | 65 + .../BetaResponseInjectFailedEventTest.kt | 91 + .../responses/BetaResponseInputAudioTest.kt | 54 + .../responses/BetaResponseInputContentTest.kt | 163 + .../BetaResponseInputFileContentTest.kt | 59 + .../responses/BetaResponseInputFileTest.kt | 58 + .../BetaResponseInputImageContentTest.kt | 54 + .../responses/BetaResponseInputImageTest.kt | 52 + .../responses/BetaResponseInputItemTest.kt | 3220 ++ .../BetaResponseInputMessageItemTest.kt | 77 + .../BetaResponseInputTextContentTest.kt | 46 + .../responses/BetaResponseInputTextTest.kt | 46 + .../beta/responses/BetaResponseItemTest.kt | 2891 ++ .../BetaResponseLocalEnvironmentTest.kt | 30 + ...aResponseMcpCallArgumentsDeltaEventTest.kt | 64 + ...taResponseMcpCallArgumentsDoneEventTest.kt | 64 + .../BetaResponseMcpCallCompletedEventTest.kt | 59 + .../BetaResponseMcpCallFailedEventTest.kt | 55 + .../BetaResponseMcpCallInProgressEventTest.kt | 59 + ...aResponseMcpListToolsCompletedEventTest.kt | 61 + ...BetaResponseMcpListToolsFailedEventTest.kt | 59 + ...ResponseMcpListToolsInProgressEventTest.kt | 61 + .../responses/BetaResponseOutputAudioTest.kt | 35 + .../BetaResponseOutputItemAddedEventTest.kt | 169 + .../BetaResponseOutputItemDoneEventTest.kt | 169 + .../responses/BetaResponseOutputItemTest.kt | 2796 ++ .../BetaResponseOutputMessageTest.kt | 131 + .../BetaResponseOutputRefusalTest.kt | 34 + ...ponseOutputTextAnnotationAddedEventTest.kt | 72 + .../responses/BetaResponseOutputTextTest.kt | 106 + .../beta/responses/BetaResponsePromptTest.kt | 58 + .../responses/BetaResponseQueuedEventTest.kt | 683 + .../BetaResponseReasoningItemTest.kt | 58 + ...ponseReasoningSummaryPartAddedEventTest.kt | 74 + ...sponseReasoningSummaryPartDoneEventTest.kt | 74 + ...ponseReasoningSummaryTextDeltaEventTest.kt | 67 + ...sponseReasoningSummaryTextDoneEventTest.kt | 67 + ...BetaResponseReasoningTextDeltaEventTest.kt | 65 + .../BetaResponseReasoningTextDoneEventTest.kt | 65 + .../BetaResponseRefusalDeltaEventTest.kt | 59 + .../BetaResponseRefusalDoneEventTest.kt | 54 + .../responses/BetaResponseStreamEventTest.kt | 8177 +++++ .../models/beta/responses/BetaResponseTest.kt | 660 + .../responses/BetaResponseTextConfigTest.kt | 42 + .../BetaResponseTextDeltaEventTest.kt | 91 + .../BetaResponseTextDoneEventTest.kt | 91 + .../BetaResponseToolSearchCallTest.kt | 61 + ...taResponseToolSearchOutputItemParamTest.kt | 127 + .../BetaResponseToolSearchOutputItemTest.kt | 124 + .../beta/responses/BetaResponseUsageTest.kt | 71 + ...ResponseWebSearchCallCompletedEventTest.kt | 61 + ...esponseWebSearchCallInProgressEventTest.kt | 61 + ...ResponseWebSearchCallSearchingEventTest.kt | 61 + .../responses/BetaResponsesClientEventTest.kt | 386 + .../responses/BetaResponsesServerEventTest.kt | 8501 ++++++ .../beta/responses/BetaSkillReferenceTest.kt | 35 + .../responses/BetaToolChoiceAllowedTest.kt | 55 + .../responses/BetaToolChoiceApplyPatchTest.kt | 30 + .../responses/BetaToolChoiceCustomTest.kt | 32 + .../responses/BetaToolChoiceFunctionTest.kt | 32 + .../beta/responses/BetaToolChoiceMcpTest.kt | 35 + .../beta/responses/BetaToolChoiceShellTest.kt | 30 + .../beta/responses/BetaToolChoiceTypesTest.kt | 34 + .../beta/responses/BetaToolSearchToolTest.kt | 45 + .../models/beta/responses/BetaToolTest.kt | 980 + .../responses/BetaWebSearchPreviewToolTest.kt | 73 + .../beta/responses/BetaWebSearchToolTest.kt | 74 + .../responses/ResponseCancelParamsTest.kt | 56 + .../responses/ResponseCompactParamsTest.kt | 115 + .../responses/ResponseCreateParamsTest.kt | 526 + .../responses/ResponseDeleteParamsTest.kt | 56 + .../responses/ResponseRetrieveParamsTest.kt | 98 + .../inputitems/BetaResponseItemListTest.kt | 110 + .../inputitems/InputItemListParamsTest.kt | 94 + .../inputtokens/InputTokenCountParamsTest.kt | 242 + .../InputTokenCountResponseTest.kt | 32 + .../threads/ThreadCreateAndRunParamsTest.kt | 6 +- .../beta/threads/runs/RunCreateParamsTest.kt | 8 +- .../completions/ChatCompletionChunkTest.kt | 3 + .../ChatCompletionContentPartImageTest.kt | 8 + ...ChatCompletionContentPartInputAudioTest.kt | 8 + .../ChatCompletionContentPartTest.kt | 33 +- .../ChatCompletionContentPartTextTest.kt | 16 +- .../ChatCompletionCreateParamsTest.kt | 97 +- .../ChatCompletionListPageResponseTest.kt | 3 + .../ChatCompletionStoreMessageTest.kt | 25 +- .../chat/completions/ChatCompletionTest.kt | 3 + .../messages/MessageListPageResponseTest.kt | 26 +- .../models/completions/CompletionTest.kt | 3 + .../models/completions/CompletionUsageTest.kt | 3 + .../ComputerScreenshotContentTest.kt | 8 + .../models/conversations/MessageTest.kt | 27 +- .../items/ConversationItemListTest.kt | 28 +- .../items/ConversationItemTest.kt | 239 +- .../gradermodels/EvalContentItemTest.kt | 15 +- .../RealtimeResponseCreateMcpToolTest.kt | 5 + .../realtime/RealtimeToolsConfigUnionTest.kt | 2 + .../models/responses/ApplyPatchToolTest.kt | 10 +- .../models/responses/CompactedResponseTest.kt | 15 +- .../openai/models/responses/CustomToolTest.kt | 5 + .../models/responses/FunctionShellToolTest.kt | 5 + .../models/responses/FunctionToolTest.kt | 21 + .../models/responses/NamespaceToolTest.kt | 18 + .../ResponseApplyPatchToolCallOutputTest.kt | 4 + .../ResponseApplyPatchToolCallTest.kt | 4 + .../responses/ResponseCompactParamsTest.kt | 29 +- .../responses/ResponseCompletedEventTest.kt | 46 +- .../models/responses/ResponseContentTest.kt | 27 +- .../responses/ResponseCreateParamsTest.kt | 104 +- .../responses/ResponseCreatedEventTest.kt | 46 +- .../ResponseCustomToolCallItemTest.kt | 4 + .../ResponseCustomToolCallOutputItemTest.kt | 4 + .../ResponseCustomToolCallOutputTest.kt | 4 + .../responses/ResponseCustomToolCallTest.kt | 4 + .../responses/ResponseFailedEventTest.kt | 46 +- .../ResponseFunctionCallOutputItemTest.kt | 31 +- ...ResponseFunctionShellToolCallOutputTest.kt | 4 + .../ResponseFunctionShellToolCallTest.kt | 4 + .../ResponseFunctionToolCallItemTest.kt | 4 + .../ResponseFunctionToolCallOutputItemTest.kt | 4 + .../responses/ResponseFunctionToolCallTest.kt | 4 + .../responses/ResponseInProgressEventTest.kt | 46 +- .../responses/ResponseIncompleteEventTest.kt | 46 +- .../responses/ResponseInputContentTest.kt | 27 +- .../responses/ResponseInputFileContentTest.kt | 14 +- .../models/responses/ResponseInputFileTest.kt | 10 +- .../ResponseInputImageContentTest.kt | 8 + .../responses/ResponseInputImageTest.kt | 4 + .../models/responses/ResponseInputItemTest.kt | 254 +- .../responses/ResponseInputMessageItemTest.kt | 27 +- .../responses/ResponseInputTextContentTest.kt | 18 +- .../models/responses/ResponseInputTextTest.kt | 14 +- .../models/responses/ResponseItemTest.kt | 242 +- .../responses/ResponseOutputItemTest.kt | 220 + .../responses/ResponseQueuedEventTest.kt | 46 +- ...sponseReasoningSummaryPartDoneEventTest.kt | 4 + .../responses/ResponseStreamEventTest.kt | 170 + .../openai/models/responses/ResponseTest.kt | 55 +- .../ResponseToolSearchOutputItemParamTest.kt | 18 + .../ResponseToolSearchOutputItemTest.kt | 18 + .../models/responses/ResponseUsageTest.kt | 17 +- .../responses/ResponsesClientEventTest.kt | 108 +- .../responses/ResponsesServerEventTest.kt | 170 + .../com/openai/models/responses/ToolTest.kt | 102 +- .../inputitems/ResponseItemListTest.kt | 28 +- .../inputtokens/InputTokenCountParamsTest.kt | 21 + ...SafetyIdentifierBlockedWebhookEventTest.kt | 74 + .../models/webhooks/UnwrapWebhookEventTest.kt | 84 + .../com/openai/services/ServiceParamsTest.kt | 32 +- .../async/ResponseServiceAsyncTest.kt | 86 +- .../async/beta/ResponseServiceAsyncTest.kt | 436 + .../async/beta/ThreadServiceAsyncTest.kt | 4 +- .../responses/InputItemServiceAsyncTest.kt | 28 + .../responses/InputTokenServiceAsyncTest.kt | 80 + .../async/beta/threads/RunServiceAsyncTest.kt | 4 +- .../chat/ChatCompletionServiceAsyncTest.kt | 66 +- .../responses/InputTokenServiceAsyncTest.kt | 7 + .../services/blocking/ResponseServiceTest.kt | 86 +- .../blocking/beta/ResponseServiceTest.kt | 425 + .../blocking/beta/ThreadServiceTest.kt | 4 +- .../beta/responses/InputItemServiceTest.kt | 27 + .../beta/responses/InputTokenServiceTest.kt | 79 + .../blocking/beta/threads/RunServiceTest.kt | 4 +- .../chat/ChatCompletionServiceTest.kt | 66 +- .../responses/InputTokenServiceTest.kt | 7 + .../proguard/ProGuardCompatibilityTest.kt | 8 +- 491 files changed, 278164 insertions(+), 6852 deletions(-) create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaApplyPatchTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaCompactedResponse.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaComputerAction.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaComputerTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaComputerUsePreviewTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaContainerAuto.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaContainerNetworkPolicyAllowlist.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaContainerNetworkPolicyDisabled.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaContainerNetworkPolicyDomainSecret.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaContainerReference.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaCustomTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaEasyInputMessage.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaFileSearchTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaFunctionShellTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaFunctionTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaInlineSkill.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaInlineSkillSource.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaLocalEnvironment.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaLocalSkill.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaNamespaceTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponse.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCall.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCallOutput.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseAudioDeltaEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseAudioDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseAudioTranscriptDeltaEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseAudioTranscriptDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterCallCodeDeltaEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterCallCodeDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterCallCompletedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterCallInProgressEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterCallInterpretingEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterToolCall.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCompactionItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCompactionItemParam.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCompletedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseComputerToolCall.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseComputerToolCallOutputItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseComputerToolCallOutputScreenshot.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContainerReference.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContentPartAddedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseContentPartDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseConversationParam.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCreatedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCall.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallInputDeltaEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallInputDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallOutput.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallOutputItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseError.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseErrorEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFailedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFileSearchCallCompletedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFileSearchCallInProgressEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFileSearchCallSearchingEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFileSearchToolCall.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFormatTextConfig.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFormatTextJsonSchemaConfig.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionCallArgumentsDeltaEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionCallArgumentsDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionCallOutputItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellCallOutputContent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCall.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCallOutput.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCall.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseFunctionWebSearch.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseImageGenCallCompletedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseImageGenCallGeneratingEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseImageGenCallInProgressEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseImageGenCallPartialImageEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInProgressEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseIncludable.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseIncompleteEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectCreatedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectFailedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputAudio.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputContent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputFile.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputFileContent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputImage.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputImageContent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputMessageItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputText.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputTextContent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseLocalEnvironment.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseMcpCallArgumentsDeltaEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseMcpCallArgumentsDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseMcpCallCompletedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseMcpCallFailedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseMcpCallInProgressEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseMcpListToolsCompletedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseMcpListToolsFailedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseMcpListToolsInProgressEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputAudio.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputItemAddedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputItemDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputMessage.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputRefusal.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputText.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseOutputTextAnnotationAddedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsePrompt.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseQueuedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseReasoningItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseReasoningSummaryPartAddedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseReasoningSummaryPartDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseReasoningSummaryTextDeltaEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseReasoningSummaryTextDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseReasoningTextDeltaEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseReasoningTextDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseRefusalDeltaEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseRefusalDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseStatus.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseStreamEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseTextConfig.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseTextDeltaEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseTextDoneEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseToolSearchCall.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseToolSearchOutputItem.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseToolSearchOutputItemParam.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseUsage.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseWebSearchCallCompletedEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseWebSearchCallInProgressEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseWebSearchCallSearchingEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesClientEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesServerEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaSkillReference.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaToolChoiceAllowed.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaToolChoiceApplyPatch.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaToolChoiceCustom.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaToolChoiceFunction.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaToolChoiceMcp.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaToolChoiceOptions.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaToolChoiceShell.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaToolChoiceTypes.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaToolSearchTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaWebSearchPreviewTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaWebSearchTool.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseCancelParams.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseCompactParams.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseCreateParams.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseDeleteParams.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/ResponseRetrieveParams.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/inputitems/BetaResponseItemList.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/inputitems/InputItemListPage.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/inputitems/InputItemListPageAsync.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/inputitems/InputItemListParams.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/inputtokens/InputTokenCountParams.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/beta/responses/inputtokens/InputTokenCountResponse.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/models/webhooks/SafetyIdentifierBlockedWebhookEvent.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/async/beta/ResponseServiceAsync.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/async/beta/ResponseServiceAsyncImpl.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/async/beta/responses/InputItemServiceAsync.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/async/beta/responses/InputItemServiceAsyncImpl.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/async/beta/responses/InputTokenServiceAsync.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/async/beta/responses/InputTokenServiceAsyncImpl.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ResponseService.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ResponseServiceImpl.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/responses/InputItemService.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/responses/InputItemServiceImpl.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/responses/InputTokenService.kt create mode 100644 openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/responses/InputTokenServiceImpl.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaApplyPatchToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaCompactedResponseTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaComputerActionTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaComputerToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaComputerUsePreviewToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaContainerAutoTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaContainerNetworkPolicyAllowlistTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaContainerNetworkPolicyDisabledTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaContainerNetworkPolicyDomainSecretTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaContainerReferenceTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaCustomToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaEasyInputMessageTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaFileSearchToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaFunctionShellToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaFunctionToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaInlineSkillSourceTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaInlineSkillTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaLocalEnvironmentTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaLocalSkillTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaNamespaceToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCallOutputTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseApplyPatchToolCallTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseAudioDeltaEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseAudioDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseAudioTranscriptDeltaEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseAudioTranscriptDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterCallCodeDeltaEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterCallCodeDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterCallCompletedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterCallInProgressEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterCallInterpretingEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCodeInterpreterToolCallTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCompactionItemParamTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCompactionItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCompletedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseComputerToolCallOutputItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseComputerToolCallOutputScreenshotTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseComputerToolCallTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseContainerReferenceTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseContentPartAddedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseContentPartDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseContentTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseConversationParamTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCreatedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallInputDeltaEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallInputDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallOutputItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallOutputTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseCustomToolCallTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseErrorEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseErrorTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFailedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFileSearchCallCompletedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFileSearchCallInProgressEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFileSearchCallSearchingEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFileSearchToolCallTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFormatTextConfigTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFormatTextJsonSchemaConfigTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionCallArgumentsDeltaEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionCallArgumentsDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionCallOutputItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellCallOutputContentTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCallOutputTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionShellToolCallTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallOutputItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionToolCallTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionWebSearchTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseImageGenCallCompletedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseImageGenCallGeneratingEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseImageGenCallInProgressEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseImageGenCallPartialImageEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInProgressEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseIncompleteEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInjectCreatedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInjectEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInjectFailedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputAudioTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputContentTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputFileContentTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputFileTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputImageContentTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputImageTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputMessageItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputTextContentTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputTextTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseLocalEnvironmentTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseMcpCallArgumentsDeltaEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseMcpCallArgumentsDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseMcpCallCompletedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseMcpCallFailedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseMcpCallInProgressEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseMcpListToolsCompletedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseMcpListToolsFailedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseMcpListToolsInProgressEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputAudioTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputItemAddedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputItemDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputMessageTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputRefusalTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputTextAnnotationAddedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseOutputTextTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsePromptTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseQueuedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseReasoningItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseReasoningSummaryPartAddedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseReasoningSummaryPartDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseReasoningSummaryTextDeltaEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseReasoningSummaryTextDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseReasoningTextDeltaEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseReasoningTextDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseRefusalDeltaEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseRefusalDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseStreamEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseTextConfigTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseTextDeltaEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseTextDoneEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseToolSearchCallTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseToolSearchOutputItemParamTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseToolSearchOutputItemTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseUsageTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseWebSearchCallCompletedEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseWebSearchCallInProgressEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseWebSearchCallSearchingEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesClientEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesServerEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaSkillReferenceTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaToolChoiceAllowedTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaToolChoiceApplyPatchTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaToolChoiceCustomTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaToolChoiceFunctionTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaToolChoiceMcpTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaToolChoiceShellTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaToolChoiceTypesTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaToolSearchToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaWebSearchPreviewToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaWebSearchToolTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/ResponseCancelParamsTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/ResponseCompactParamsTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/ResponseCreateParamsTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/ResponseDeleteParamsTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/ResponseRetrieveParamsTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/inputitems/BetaResponseItemListTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/inputitems/InputItemListParamsTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/inputtokens/InputTokenCountParamsTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/beta/responses/inputtokens/InputTokenCountResponseTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/models/webhooks/SafetyIdentifierBlockedWebhookEventTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/services/async/beta/ResponseServiceAsyncTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/services/async/beta/responses/InputItemServiceAsyncTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/services/async/beta/responses/InputTokenServiceAsyncTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/ResponseServiceTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/responses/InputItemServiceTest.kt create mode 100644 openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/responses/InputTokenServiceTest.kt diff --git a/.stats.yml b/.stats.yml index fe88e03e3..4e142c3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 263 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-b5b621065906a2579dc180db1236ee3b08a4fca9539accc2fbbf88da0ca3923f.yml -openapi_spec_hash: 45b1b4692b26e714008d8120ccfc7433 -config_hash: ef3ce17315a31703e7af0567b3e9738c +configured_endpoints: 270 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-356010b9b9fd6228b457b8fcfa376cf4928a8f3bd4728e7ba5e4b6b5ef4f5843.yml +openapi_spec_hash: 885864ae98a443166f585f856c464fb2 +config_hash: 1f1e3b4050e2cb4bc780ce0b70e2b3e6 diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt index 16bf07847..35755e10b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt @@ -20,6 +20,12 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField Value.GPT_5_6_SOL + GPT_5_6_TERRA -> Value.GPT_5_6_TERRA + GPT_5_6_LUNA -> Value.GPT_5_6_LUNA GPT_5_4 -> Value.GPT_5_4 GPT_5_4_MINI -> Value.GPT_5_4_MINI GPT_5_4_NANO -> Value.GPT_5_4_NANO @@ -455,6 +470,9 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField Known.GPT_5_6_SOL + GPT_5_6_TERRA -> Known.GPT_5_6_TERRA + GPT_5_6_LUNA -> Known.GPT_5_6_LUNA GPT_5_4 -> Known.GPT_5_4 GPT_5_4_MINI -> Known.GPT_5_4_MINI GPT_5_4_NANO -> Known.GPT_5_4_NANO diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Reasoning.kt b/openai-java-core/src/main/kotlin/com/openai/models/Reasoning.kt index 285ebff40..df225da7f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Reasoning.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Reasoning.kt @@ -28,6 +28,7 @@ private constructor( private val context: JsonField, private val effort: JsonField, private val generateSummary: JsonField, + private val mode: JsonField, private val summary: JsonField, private val additionalProperties: MutableMap, ) { @@ -41,8 +42,9 @@ private constructor( @JsonProperty("generate_summary") @ExcludeMissing generateSummary: JsonField = JsonMissing.of(), + @JsonProperty("mode") @ExcludeMissing mode: JsonField = JsonMissing.of(), @JsonProperty("summary") @ExcludeMissing summary: JsonField = JsonMissing.of(), - ) : this(context, effort, generateSummary, summary, mutableMapOf()) + ) : this(context, effort, generateSummary, mode, summary, mutableMapOf()) /** * Controls which reasoning items are rendered back to the model on later turns. When returned @@ -54,17 +56,12 @@ private constructor( fun context(): Optional = context.getOptional("context") /** - * Constrains effort on reasoning for - * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported - * values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort - * can result in faster responses and fewer tokens used on reasoning in a response. - * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning - * values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for - * all reasoning values in gpt-5.1. - * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support - * `none`. - * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - * - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + * Constrains effort on reasoning for reasoning models. Currently supported values are `none`, + * `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning effort can result + * in faster responses and fewer tokens used on reasoning in a response. Not all reasoning + * models support every value. See the + * [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for model-specific + * support. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -84,6 +81,16 @@ private constructor( fun generateSummary(): Optional = generateSummary.getOptional("generate_summary") + /** + * Controls the reasoning execution mode for the request. + * + * When returned on a response, this is the effective execution mode. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun mode(): Optional = mode.getOptional("mode") + /** * A summary of the reasoning performed by the model. This can be useful for debugging and * understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`. @@ -120,6 +127,13 @@ private constructor( @ExcludeMissing fun _generateSummary(): JsonField = generateSummary + /** + * Returns the raw JSON value of [mode]. + * + * Unlike [mode], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("mode") @ExcludeMissing fun _mode(): JsonField = mode + /** * Returns the raw JSON value of [summary]. * @@ -151,6 +165,7 @@ private constructor( private var context: JsonField = JsonMissing.of() private var effort: JsonField = JsonMissing.of() private var generateSummary: JsonField = JsonMissing.of() + private var mode: JsonField = JsonMissing.of() private var summary: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -159,6 +174,7 @@ private constructor( context = reasoning.context effort = reasoning.effort generateSummary = reasoning.generateSummary + mode = reasoning.mode summary = reasoning.summary additionalProperties = reasoning.additionalProperties.toMutableMap() } @@ -182,18 +198,12 @@ private constructor( fun context(context: JsonField) = apply { this.context = context } /** - * Constrains effort on reasoning for - * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently - * supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing - * reasoning effort can result in faster responses and fewer tokens used on reasoning in a - * response. - * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning - * values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported - * for all reasoning values in gpt-5.1. - * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support - * `none`. - * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - * - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + * Constrains effort on reasoning for reasoning models. Currently supported values are + * `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning effort + * can result in faster responses and fewer tokens used on reasoning in a response. Not all + * reasoning models support every value. See the + * [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for model-specific + * support. */ fun effort(effort: ReasoningEffort?) = effort(JsonField.ofNullable(effort)) @@ -236,6 +246,29 @@ private constructor( this.generateSummary = generateSummary } + /** + * Controls the reasoning execution mode for the request. + * + * When returned on a response, this is the effective execution mode. + */ + fun mode(mode: Mode) = mode(JsonField.of(mode)) + + /** + * Sets [Builder.mode] to an arbitrary JSON value. + * + * You should usually call [Builder.mode] with a well-typed [Mode] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun mode(mode: JsonField) = apply { this.mode = mode } + + /** + * Sets [mode] to an arbitrary [String]. + * + * You should usually call [mode] with a well-typed [Mode] constant instead. This method is + * primarily for setting the field to an undocumented or not yet supported value. + */ + fun mode(value: String) = mode(Mode.of(value)) + /** * A summary of the reasoning performed by the model. This can be useful for debugging and * understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`. @@ -285,6 +318,7 @@ private constructor( context, effort, generateSummary, + mode, summary, additionalProperties.toMutableMap(), ) @@ -308,6 +342,7 @@ private constructor( context().ifPresent { it.validate() } effort().ifPresent { it.validate() } generateSummary().ifPresent { it.validate() } + mode() summary().ifPresent { it.validate() } validated = true } @@ -330,6 +365,7 @@ private constructor( (context.asKnown().getOrNull()?.validity() ?: 0) + (effort.asKnown().getOrNull()?.validity() ?: 0) + (generateSummary.asKnown().getOrNull()?.validity() ?: 0) + + (if (mode.asKnown().isPresent) 1 else 0) + (summary.asKnown().getOrNull()?.validity() ?: 0) /** @@ -627,6 +663,145 @@ private constructor( override fun toString() = value.toString() } + /** + * Controls the reasoning execution mode for the request. + * + * When returned on a response, this is the effective execution mode. + */ + class Mode @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 PRO = of("pro") + + @JvmStatic fun of(value: String) = Mode(JsonField.of(value)) + } + + /** An enum containing [Mode]'s known values. */ + enum class Known { + STANDARD, + PRO, + } + + /** + * An enum containing [Mode]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Mode] 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, + PRO, + /** An enum member indicating that [Mode] 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 + PRO -> Value.PRO + 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 + PRO -> Known.PRO + else -> throw OpenAIInvalidDataException("Unknown Mode: $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(): Mode = 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 Mode && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** * A summary of the reasoning performed by the model. This can be useful for debugging and * understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`. @@ -783,16 +958,17 @@ private constructor( context == other.context && effort == other.effort && generateSummary == other.generateSummary && + mode == other.mode && summary == other.summary && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(context, effort, generateSummary, summary, additionalProperties) + Objects.hash(context, effort, generateSummary, mode, summary, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Reasoning{context=$context, effort=$effort, generateSummary=$generateSummary, summary=$summary, additionalProperties=$additionalProperties}" + "Reasoning{context=$context, effort=$effort, generateSummary=$generateSummary, mode=$mode, summary=$summary, additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ReasoningEffort.kt b/openai-java-core/src/main/kotlin/com/openai/models/ReasoningEffort.kt index 0bead0c0a..24e86d596 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ReasoningEffort.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ReasoningEffort.kt @@ -8,16 +8,11 @@ import com.openai.core.JsonField import com.openai.errors.OpenAIInvalidDataException /** - * Constrains effort on reasoning for - * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values - * are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result - * in faster responses and fewer tokens used on reasoning in a response. - * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values - * for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all - * reasoning values in gpt-5.1. - * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`. - * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - * - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + * Constrains effort on reasoning for reasoning models. Currently supported values are `none`, + * `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning effort can result in + * faster responses and fewer tokens used on reasoning in a response. Not all reasoning models + * support every value. See the [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + * for model-specific support. */ class ReasoningEffort @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -45,6 +40,8 @@ class ReasoningEffort @JsonCreator private constructor(private val value: JsonFi @JvmField val XHIGH = of("xhigh") + @JvmField val MAX = of("max") + @JvmStatic fun of(value: String) = ReasoningEffort(JsonField.of(value)) } @@ -56,6 +53,7 @@ class ReasoningEffort @JsonCreator private constructor(private val value: JsonFi MEDIUM, HIGH, XHIGH, + MAX, } /** @@ -74,6 +72,7 @@ class ReasoningEffort @JsonCreator private constructor(private val value: JsonFi MEDIUM, HIGH, XHIGH, + MAX, /** * An enum member indicating that [ReasoningEffort] was instantiated with an unknown value. */ @@ -95,6 +94,7 @@ class ReasoningEffort @JsonCreator private constructor(private val value: JsonFi MEDIUM -> Value.MEDIUM HIGH -> Value.HIGH XHIGH -> Value.XHIGH + MAX -> Value.MAX else -> Value._UNKNOWN } @@ -114,6 +114,7 @@ class ReasoningEffort @JsonCreator private constructor(private val value: JsonFi MEDIUM -> Known.MEDIUM HIGH -> Known.HIGH XHIGH -> Known.XHIGH + MAX -> Known.MAX else -> throw OpenAIInvalidDataException("Unknown ReasoningEffort: $value") } 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 0613798c1..4dc7723f5 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 @@ -97,17 +97,12 @@ private constructor( fun name(): Optional = body.name() /** - * Constrains effort on reasoning for - * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported - * values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort - * can result in faster responses and fewer tokens used on reasoning in a response. - * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning - * values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for - * all reasoning values in gpt-5.1. - * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support - * `none`. - * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - * - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + * Constrains effort on reasoning for reasoning models. Currently supported values are `none`, + * `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning effort can result + * in faster responses and fewer tokens used on reasoning in a response. Not all reasoning + * models support every value. See the + * [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for model-specific + * support. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -403,18 +398,12 @@ private constructor( fun name(name: JsonField) = apply { body.name(name) } /** - * Constrains effort on reasoning for - * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently - * supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing - * reasoning effort can result in faster responses and fewer tokens used on reasoning in a - * response. - * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning - * values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported - * for all reasoning values in gpt-5.1. - * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support - * `none`. - * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - * - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + * Constrains effort on reasoning for reasoning models. Currently supported values are + * `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning effort + * can result in faster responses and fewer tokens used on reasoning in a response. Not all + * reasoning models support every value. See the + * [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for model-specific + * support. */ fun reasoningEffort(reasoningEffort: ReasoningEffort?) = apply { body.reasoningEffort(reasoningEffort) @@ -873,18 +862,12 @@ private constructor( fun name(): Optional = name.getOptional("name") /** - * Constrains effort on reasoning for - * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently - * supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing - * reasoning effort can result in faster responses and fewer tokens used on reasoning in a - * response. - * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning - * values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported - * for all reasoning values in gpt-5.1. - * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support - * `none`. - * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - * - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + * Constrains effort on reasoning for reasoning models. Currently supported values are + * `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning effort + * can result in faster responses and fewer tokens used on reasoning in a response. Not all + * reasoning models support every value. See the + * [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for model-specific + * support. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -1212,18 +1195,12 @@ private constructor( fun name(name: JsonField) = apply { this.name = name } /** - * Constrains effort on reasoning for - * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently - * supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. - * Reducing reasoning effort can result in faster responses and fewer tokens used on - * reasoning in a response. - * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported - * reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls - * are supported for all reasoning values in gpt-5.1. - * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not - * support `none`. - * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - * - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + * Constrains effort on reasoning for reasoning models. Currently supported values are + * `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning + * effort can result in faster responses and fewer tokens used on reasoning in a + * response. Not all reasoning models support every value. See the + * [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for + * model-specific support. */ fun reasoningEffort(reasoningEffort: ReasoningEffort?) = reasoningEffort(JsonField.ofNullable(reasoningEffort)) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantUpdateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantUpdateParams.kt index 93e6ecff9..4115e8f65 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantUpdateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantUpdateParams.kt @@ -89,17 +89,12 @@ private constructor( fun name(): Optional = body.name() /** - * Constrains effort on reasoning for - * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported - * values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort - * can result in faster responses and fewer tokens used on reasoning in a response. - * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning - * values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for - * all reasoning values in gpt-5.1. - * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support - * `none`. - * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - * - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + * Constrains effort on reasoning for reasoning models. Currently supported values are `none`, + * `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning effort can result + * in faster responses and fewer tokens used on reasoning in a response. Not all reasoning + * models support every value. See the + * [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for model-specific + * support. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -397,18 +392,12 @@ private constructor( fun name(name: JsonField) = apply { body.name(name) } /** - * Constrains effort on reasoning for - * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently - * supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing - * reasoning effort can result in faster responses and fewer tokens used on reasoning in a - * response. - * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning - * values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported - * for all reasoning values in gpt-5.1. - * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support - * `none`. - * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - * - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + * Constrains effort on reasoning for reasoning models. Currently supported values are + * `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning effort + * can result in faster responses and fewer tokens used on reasoning in a response. Not all + * reasoning models support every value. See the + * [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for model-specific + * support. */ fun reasoningEffort(reasoningEffort: ReasoningEffort?) = apply { body.reasoningEffort(reasoningEffort) @@ -867,18 +856,12 @@ private constructor( fun name(): Optional = name.getOptional("name") /** - * Constrains effort on reasoning for - * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently - * supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing - * reasoning effort can result in faster responses and fewer tokens used on reasoning in a - * response. - * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning - * values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported - * for all reasoning values in gpt-5.1. - * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support - * `none`. - * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - * - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + * Constrains effort on reasoning for reasoning models. Currently supported values are + * `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning effort + * can result in faster responses and fewer tokens used on reasoning in a response. Not all + * reasoning models support every value. See the + * [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for model-specific + * support. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -1199,18 +1182,12 @@ private constructor( fun name(name: JsonField) = apply { this.name = name } /** - * Constrains effort on reasoning for - * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently - * supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. - * Reducing reasoning effort can result in faster responses and fewer tokens used on - * reasoning in a response. - * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported - * reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls - * are supported for all reasoning values in gpt-5.1. - * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not - * support `none`. - * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - * - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + * Constrains effort on reasoning for reasoning models. Currently supported values are + * `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning + * effort can result in faster responses and fewer tokens used on reasoning in a + * response. Not all reasoning models support every value. See the + * [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for + * model-specific support. */ fun reasoningEffort(reasoningEffort: ReasoningEffort?) = reasoningEffort(JsonField.ofNullable(reasoningEffort)) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaApplyPatchTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaApplyPatchTool.kt new file mode 100644 index 000000000..c0b39c34e --- /dev/null +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaApplyPatchTool.kt @@ -0,0 +1,376 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.models.beta.responses + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.openai.core.Enum +import com.openai.core.ExcludeMissing +import com.openai.core.JsonField +import com.openai.core.JsonMissing +import com.openai.core.JsonValue +import com.openai.core.checkKnown +import com.openai.core.toImmutable +import com.openai.errors.OpenAIInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Allows the assistant to create, delete, or update files using unified diffs. */ +class BetaApplyPatchTool +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val type: JsonValue, + private val allowedCallers: JsonField>, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(), + @JsonProperty("allowed_callers") + @ExcludeMissing + allowedCallers: JsonField> = JsonMissing.of(), + ) : this(type, allowedCallers, mutableMapOf()) + + /** + * The type of the tool. Always `apply_patch`. + * + * Expected to always return the following: + * ```java + * JsonValue.from("apply_patch") + * ``` + * + * However, this method can be useful for debugging and logging (e.g. if the server responded + * with an unexpected value). + */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type + + /** + * The tool invocation context(s). + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun allowedCallers(): Optional> = + allowedCallers.getOptional("allowed_callers") + + /** + * Returns the raw JSON value of [allowedCallers]. + * + * Unlike [allowedCallers], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("allowed_callers") + @ExcludeMissing + fun _allowedCallers(): JsonField> = allowedCallers + + @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 [BetaApplyPatchTool]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BetaApplyPatchTool]. */ + class Builder internal constructor() { + + private var type: JsonValue = JsonValue.from("apply_patch") + private var allowedCallers: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(betaApplyPatchTool: BetaApplyPatchTool) = apply { + type = betaApplyPatchTool.type + allowedCallers = betaApplyPatchTool.allowedCallers.map { it.toMutableList() } + additionalProperties = betaApplyPatchTool.additionalProperties.toMutableMap() + } + + /** + * Sets the field to an arbitrary JSON value. + * + * It is usually unnecessary to call this method because the field defaults to the + * following: + * ```java + * JsonValue.from("apply_patch") + * ``` + * + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun type(type: JsonValue) = apply { this.type = type } + + /** The tool invocation context(s). */ + fun allowedCallers(allowedCallers: List?) = + allowedCallers(JsonField.ofNullable(allowedCallers)) + + /** Alias for calling [Builder.allowedCallers] with `allowedCallers.orElse(null)`. */ + fun allowedCallers(allowedCallers: Optional>) = + allowedCallers(allowedCallers.getOrNull()) + + /** + * Sets [Builder.allowedCallers] to an arbitrary JSON value. + * + * You should usually call [Builder.allowedCallers] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun allowedCallers(allowedCallers: JsonField>) = apply { + this.allowedCallers = allowedCallers.map { it.toMutableList() } + } + + /** + * Adds a single [AllowedCaller] to [allowedCallers]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addAllowedCaller(allowedCaller: AllowedCaller) = apply { + allowedCallers = + (allowedCallers ?: JsonField.of(mutableListOf())).also { + checkKnown("allowedCallers", it).add(allowedCaller) + } + } + + 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 [BetaApplyPatchTool]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): BetaApplyPatchTool = + BetaApplyPatchTool( + type, + (allowedCallers ?: JsonMissing.of()).map { it.toImmutable() }, + 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(): BetaApplyPatchTool = apply { + if (validated) { + return@apply + } + + _type().let { + if (it != JsonValue.from("apply_patch")) { + throw OpenAIInvalidDataException("'type' is invalid, received $it") + } + } + allowedCallers().ifPresent { it.forEach { 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 = + type.let { if (it == JsonValue.from("apply_patch")) 1 else 0 } + + (allowedCallers.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + class AllowedCaller @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 DIRECT = of("direct") + + @JvmField val PROGRAMMATIC = of("programmatic") + + @JvmStatic fun of(value: String) = AllowedCaller(JsonField.of(value)) + } + + /** An enum containing [AllowedCaller]'s known values. */ + enum class Known { + DIRECT, + PROGRAMMATIC, + } + + /** + * An enum containing [AllowedCaller]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [AllowedCaller] 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 { + DIRECT, + PROGRAMMATIC, + /** + * An enum member indicating that [AllowedCaller] 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) { + DIRECT -> Value.DIRECT + PROGRAMMATIC -> Value.PROGRAMMATIC + 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) { + DIRECT -> Known.DIRECT + PROGRAMMATIC -> Known.PROGRAMMATIC + else -> throw OpenAIInvalidDataException("Unknown AllowedCaller: $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(): AllowedCaller = 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 AllowedCaller && 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 BetaApplyPatchTool && + type == other.type && + allowedCallers == other.allowedCallers && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(type, allowedCallers, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "BetaApplyPatchTool{type=$type, allowedCallers=$allowedCallers, additionalProperties=$additionalProperties}" +} diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaCompactedResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaCompactedResponse.kt new file mode 100644 index 000000000..ddc58444a --- /dev/null +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaCompactedResponse.kt @@ -0,0 +1,558 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.models.beta.responses + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.openai.core.ExcludeMissing +import com.openai.core.JsonField +import com.openai.core.JsonMissing +import com.openai.core.JsonValue +import com.openai.core.checkKnown +import com.openai.core.checkRequired +import com.openai.core.toImmutable +import com.openai.errors.OpenAIInvalidDataException +import java.util.Collections +import java.util.Objects +import kotlin.jvm.optionals.getOrNull + +class BetaCompactedResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val createdAt: JsonField, + private val object_: JsonValue, + private val output: JsonField>, + private val usage: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), + @JsonProperty("object") @ExcludeMissing object_: JsonValue = JsonMissing.of(), + @JsonProperty("output") + @ExcludeMissing + output: JsonField> = JsonMissing.of(), + @JsonProperty("usage") + @ExcludeMissing + usage: JsonField = JsonMissing.of(), + ) : this(id, createdAt, object_, output, usage, mutableMapOf()) + + /** + * The unique identifier for the compacted 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 id(): String = id.getRequired("id") + + /** + * Unix timestamp (in seconds) when the compacted conversation was created. + * + * @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 createdAt(): Long = createdAt.getRequired("created_at") + + /** + * The object type. Always `response.compaction`. + * + * Expected to always return the following: + * ```java + * JsonValue.from("response.compaction") + * ``` + * + * However, this method can be useful for debugging and logging (e.g. if the server responded + * with an unexpected value). + */ + @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ + + /** + * The compacted list of output items. This is a list of all user messages, followed by a single + * compaction item. + * + * @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 output(): List = output.getRequired("output") + + /** + * Token accounting for the compaction pass, including cached, reasoning, and total tokens. + * + * @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 usage(): BetaResponseUsage = usage.getRequired("usage") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [createdAt]. + * + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("created_at") @ExcludeMissing fun _createdAt(): JsonField = createdAt + + /** + * Returns the raw JSON value of [output]. + * + * Unlike [output], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("output") + @ExcludeMissing + fun _output(): JsonField> = output + + /** + * Returns the raw JSON value of [usage]. + * + * Unlike [usage], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("usage") @ExcludeMissing fun _usage(): JsonField = usage + + @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 [BetaCompactedResponse]. + * + * The following fields are required: + * ```java + * .id() + * .createdAt() + * .output() + * .usage() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BetaCompactedResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var createdAt: JsonField? = null + private var object_: JsonValue = JsonValue.from("response.compaction") + private var output: JsonField>? = null + private var usage: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(betaCompactedResponse: BetaCompactedResponse) = apply { + id = betaCompactedResponse.id + createdAt = betaCompactedResponse.createdAt + object_ = betaCompactedResponse.object_ + output = betaCompactedResponse.output.map { it.toMutableList() } + usage = betaCompactedResponse.usage + additionalProperties = betaCompactedResponse.additionalProperties.toMutableMap() + } + + /** The unique identifier for the compacted response. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** Unix timestamp (in seconds) when the compacted conversation was created. */ + fun createdAt(createdAt: Long) = createdAt(JsonField.of(createdAt)) + + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + + /** + * Sets the field to an arbitrary JSON value. + * + * It is usually unnecessary to call this method because the field defaults to the + * following: + * ```java + * JsonValue.from("response.compaction") + * ``` + * + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun object_(object_: JsonValue) = apply { this.object_ = object_ } + + /** + * The compacted list of output items. This is a list of all user messages, followed by a + * single compaction item. + */ + fun output(output: List) = output(JsonField.of(output)) + + /** + * Sets [Builder.output] to an arbitrary JSON value. + * + * You should usually call [Builder.output] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun output(output: JsonField>) = apply { + this.output = output.map { it.toMutableList() } + } + + /** + * Adds a single [BetaResponseOutputItem] to [Builder.output]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addOutput(output: BetaResponseOutputItem) = apply { + this.output = + (this.output ?: JsonField.of(mutableListOf())).also { + checkKnown("output", it).add(output) + } + } + + /** Alias for calling [addOutput] with `BetaResponseOutputItem.ofMessage(message)`. */ + fun addOutput(message: BetaResponseOutputMessage) = + addOutput(BetaResponseOutputItem.ofMessage(message)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofFileSearchCall(fileSearchCall)`. + */ + fun addOutput(fileSearchCall: BetaResponseFileSearchToolCall) = + addOutput(BetaResponseOutputItem.ofFileSearchCall(fileSearchCall)) + + /** + * Alias for calling [addOutput] with `BetaResponseOutputItem.ofFunctionCall(functionCall)`. + */ + fun addOutput(functionCall: BetaResponseFunctionToolCall) = + addOutput(BetaResponseOutputItem.ofFunctionCall(functionCall)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofFunctionCallOutput(functionCallOutput)`. + */ + fun addOutput(functionCallOutput: BetaResponseFunctionToolCallOutputItem) = + addOutput(BetaResponseOutputItem.ofFunctionCallOutput(functionCallOutput)) + + /** + * Alias for calling [addOutput] with `BetaResponseOutputItem.ofAgentMessage(agentMessage)`. + */ + fun addOutput(agentMessage: BetaResponseOutputItem.AgentMessage) = + addOutput(BetaResponseOutputItem.ofAgentMessage(agentMessage)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofMultiAgentCall(multiAgentCall)`. + */ + fun addOutput(multiAgentCall: BetaResponseOutputItem.MultiAgentCall) = + addOutput(BetaResponseOutputItem.ofMultiAgentCall(multiAgentCall)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofMultiAgentCallOutput(multiAgentCallOutput)`. + */ + fun addOutput(multiAgentCallOutput: BetaResponseOutputItem.MultiAgentCallOutput) = + addOutput(BetaResponseOutputItem.ofMultiAgentCallOutput(multiAgentCallOutput)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofWebSearchCall(webSearchCall)`. + */ + fun addOutput(webSearchCall: BetaResponseFunctionWebSearch) = + addOutput(BetaResponseOutputItem.ofWebSearchCall(webSearchCall)) + + /** + * Alias for calling [addOutput] with `BetaResponseOutputItem.ofComputerCall(computerCall)`. + */ + fun addOutput(computerCall: BetaResponseComputerToolCall) = + addOutput(BetaResponseOutputItem.ofComputerCall(computerCall)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofComputerCallOutput(computerCallOutput)`. + */ + fun addOutput(computerCallOutput: BetaResponseComputerToolCallOutputItem) = + addOutput(BetaResponseOutputItem.ofComputerCallOutput(computerCallOutput)) + + /** Alias for calling [addOutput] with `BetaResponseOutputItem.ofReasoning(reasoning)`. */ + fun addOutput(reasoning: BetaResponseReasoningItem) = + addOutput(BetaResponseOutputItem.ofReasoning(reasoning)) + + /** Alias for calling [addOutput] with `BetaResponseOutputItem.ofProgram(program)`. */ + fun addOutput(program: BetaResponseOutputItem.Program) = + addOutput(BetaResponseOutputItem.ofProgram(program)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofProgramOutput(programOutput)`. + */ + fun addOutput(programOutput: BetaResponseOutputItem.ProgramOutput) = + addOutput(BetaResponseOutputItem.ofProgramOutput(programOutput)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofToolSearchCall(toolSearchCall)`. + */ + fun addOutput(toolSearchCall: BetaResponseToolSearchCall) = + addOutput(BetaResponseOutputItem.ofToolSearchCall(toolSearchCall)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofToolSearchOutput(toolSearchOutput)`. + */ + fun addOutput(toolSearchOutput: BetaResponseToolSearchOutputItem) = + addOutput(BetaResponseOutputItem.ofToolSearchOutput(toolSearchOutput)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofAdditionalTools(additionalTools)`. + */ + fun addOutput(additionalTools: BetaResponseOutputItem.AdditionalTools) = + addOutput(BetaResponseOutputItem.ofAdditionalTools(additionalTools)) + + /** Alias for calling [addOutput] with `BetaResponseOutputItem.ofCompaction(compaction)`. */ + fun addOutput(compaction: BetaResponseCompactionItem) = + addOutput(BetaResponseOutputItem.ofCompaction(compaction)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofImageGenerationCall(imageGenerationCall)`. + */ + fun addOutput(imageGenerationCall: BetaResponseOutputItem.ImageGenerationCall) = + addOutput(BetaResponseOutputItem.ofImageGenerationCall(imageGenerationCall)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofCodeInterpreterCall(codeInterpreterCall)`. + */ + fun addOutput(codeInterpreterCall: BetaResponseCodeInterpreterToolCall) = + addOutput(BetaResponseOutputItem.ofCodeInterpreterCall(codeInterpreterCall)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofLocalShellCall(localShellCall)`. + */ + fun addOutput(localShellCall: BetaResponseOutputItem.LocalShellCall) = + addOutput(BetaResponseOutputItem.ofLocalShellCall(localShellCall)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofLocalShellCallOutput(localShellCallOutput)`. + */ + fun addOutput(localShellCallOutput: BetaResponseOutputItem.LocalShellCallOutput) = + addOutput(BetaResponseOutputItem.ofLocalShellCallOutput(localShellCallOutput)) + + /** Alias for calling [addOutput] with `BetaResponseOutputItem.ofShellCall(shellCall)`. */ + fun addOutput(shellCall: BetaResponseFunctionShellToolCall) = + addOutput(BetaResponseOutputItem.ofShellCall(shellCall)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofShellCallOutput(shellCallOutput)`. + */ + fun addOutput(shellCallOutput: BetaResponseFunctionShellToolCallOutput) = + addOutput(BetaResponseOutputItem.ofShellCallOutput(shellCallOutput)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofApplyPatchCall(applyPatchCall)`. + */ + fun addOutput(applyPatchCall: BetaResponseApplyPatchToolCall) = + addOutput(BetaResponseOutputItem.ofApplyPatchCall(applyPatchCall)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofApplyPatchCallOutput(applyPatchCallOutput)`. + */ + fun addOutput(applyPatchCallOutput: BetaResponseApplyPatchToolCallOutput) = + addOutput(BetaResponseOutputItem.ofApplyPatchCallOutput(applyPatchCallOutput)) + + /** Alias for calling [addOutput] with `BetaResponseOutputItem.ofMcpCall(mcpCall)`. */ + fun addOutput(mcpCall: BetaResponseOutputItem.McpCall) = + addOutput(BetaResponseOutputItem.ofMcpCall(mcpCall)) + + /** + * Alias for calling [addOutput] with `BetaResponseOutputItem.ofMcpListTools(mcpListTools)`. + */ + fun addOutput(mcpListTools: BetaResponseOutputItem.McpListTools) = + addOutput(BetaResponseOutputItem.ofMcpListTools(mcpListTools)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofMcpApprovalRequest(mcpApprovalRequest)`. + */ + fun addOutput(mcpApprovalRequest: BetaResponseOutputItem.McpApprovalRequest) = + addOutput(BetaResponseOutputItem.ofMcpApprovalRequest(mcpApprovalRequest)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofMcpApprovalResponse(mcpApprovalResponse)`. + */ + fun addOutput(mcpApprovalResponse: BetaResponseOutputItem.McpApprovalResponse) = + addOutput(BetaResponseOutputItem.ofMcpApprovalResponse(mcpApprovalResponse)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofCustomToolCall(customToolCall)`. + */ + fun addOutput(customToolCall: BetaResponseCustomToolCall) = + addOutput(BetaResponseOutputItem.ofCustomToolCall(customToolCall)) + + /** + * Alias for calling [addOutput] with + * `BetaResponseOutputItem.ofCustomToolCallOutput(customToolCallOutput)`. + */ + fun addOutput(customToolCallOutput: BetaResponseCustomToolCallOutputItem) = + addOutput(BetaResponseOutputItem.ofCustomToolCallOutput(customToolCallOutput)) + + /** + * Token accounting for the compaction pass, including cached, reasoning, and total tokens. + */ + fun usage(usage: BetaResponseUsage) = usage(JsonField.of(usage)) + + /** + * Sets [Builder.usage] to an arbitrary JSON value. + * + * You should usually call [Builder.usage] with a well-typed [BetaResponseUsage] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun usage(usage: JsonField) = apply { this.usage = usage } + + 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 [BetaCompactedResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .createdAt() + * .output() + * .usage() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BetaCompactedResponse = + BetaCompactedResponse( + checkRequired("id", id), + checkRequired("createdAt", createdAt), + object_, + checkRequired("output", output).map { it.toImmutable() }, + checkRequired("usage", usage), + 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(): BetaCompactedResponse = apply { + if (validated) { + return@apply + } + + id() + createdAt() + _object_().let { + if (it != JsonValue.from("response.compaction")) { + throw OpenAIInvalidDataException("'object_' is invalid, received $it") + } + } + output().forEach { it.validate() } + usage().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 = + (if (id.asKnown().isPresent) 1 else 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + object_.let { if (it == JsonValue.from("response.compaction")) 1 else 0 } + + (output.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (usage.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BetaCompactedResponse && + id == other.id && + createdAt == other.createdAt && + object_ == other.object_ && + output == other.output && + usage == other.usage && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, createdAt, object_, output, usage, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "BetaCompactedResponse{id=$id, createdAt=$createdAt, object_=$object_, output=$output, usage=$usage, additionalProperties=$additionalProperties}" +} 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 new file mode 100644 index 000000000..b9585d360 --- /dev/null +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaComputerAction.kt @@ -0,0 +1,2881 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.models.beta.responses + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.JsonGenerator +import com.fasterxml.jackson.core.ObjectCodec +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.SerializerProvider +import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import com.fasterxml.jackson.databind.annotation.JsonSerialize +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.openai.core.BaseDeserializer +import com.openai.core.BaseSerializer +import com.openai.core.Enum +import com.openai.core.ExcludeMissing +import com.openai.core.JsonField +import com.openai.core.JsonMissing +import com.openai.core.JsonValue +import com.openai.core.checkKnown +import com.openai.core.checkRequired +import com.openai.core.getOrThrow +import com.openai.core.toImmutable +import com.openai.errors.OpenAIInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A click action. */ +@JsonDeserialize(using = BetaComputerAction.Deserializer::class) +@JsonSerialize(using = BetaComputerAction.Serializer::class) +class BetaComputerAction +private constructor( + private val click: Click? = null, + private val doubleClick: DoubleClick? = null, + private val drag: Drag? = null, + private val keypress: Keypress? = null, + private val move: Move? = null, + private val screenshot: JsonValue? = null, + private val scroll: Scroll? = null, + private val type: Type? = null, + private val wait: JsonValue? = null, + private val _json: JsonValue? = null, +) { + + /** A click action. */ + fun click(): Optional = Optional.ofNullable(click) + + /** A double click action. */ + fun doubleClick(): Optional = Optional.ofNullable(doubleClick) + + /** A drag action. */ + fun drag(): Optional = Optional.ofNullable(drag) + + /** A collection of keypresses the model would like to perform. */ + fun keypress(): Optional = Optional.ofNullable(keypress) + + /** A mouse move action. */ + fun move(): Optional = Optional.ofNullable(move) + + /** A screenshot action. */ + fun screenshot(): Optional = Optional.ofNullable(screenshot) + + /** A scroll action. */ + fun scroll(): Optional = Optional.ofNullable(scroll) + + /** An action to type in text. */ + fun type(): Optional = Optional.ofNullable(type) + + /** A wait action. */ + fun wait(): Optional = Optional.ofNullable(wait) + + fun isClick(): Boolean = click != null + + fun isDoubleClick(): Boolean = doubleClick != null + + fun isDrag(): Boolean = drag != null + + fun isKeypress(): Boolean = keypress != null + + fun isMove(): Boolean = move != null + + fun isScreenshot(): Boolean = screenshot != null + + fun isScroll(): Boolean = scroll != null + + fun isType(): Boolean = type != null + + fun isWait(): Boolean = wait != null + + /** A click action. */ + fun asClick(): Click = click.getOrThrow("click") + + /** A double click action. */ + fun asDoubleClick(): DoubleClick = doubleClick.getOrThrow("doubleClick") + + /** A drag action. */ + fun asDrag(): Drag = drag.getOrThrow("drag") + + /** A collection of keypresses the model would like to perform. */ + fun asKeypress(): Keypress = keypress.getOrThrow("keypress") + + /** A mouse move action. */ + fun asMove(): Move = move.getOrThrow("move") + + /** A screenshot action. */ + fun asScreenshot(): JsonValue = screenshot.getOrThrow("screenshot") + + /** A scroll action. */ + fun asScroll(): Scroll = scroll.getOrThrow("scroll") + + /** An action to type in text. */ + fun asType(): Type = type.getOrThrow("type") + + /** A wait action. */ + fun asWait(): JsonValue = wait.getOrThrow("wait") + + fun _json(): Optional = Optional.ofNullable(_json) + + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openai.core.JsonValue; + * import java.util.Optional; + * + * Optional result = betaComputerAction.accept(new BetaComputerAction.Visitor>() { + * @Override + * public Optional visitClick(Click click) { + * return Optional.of(click.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenAIInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ + fun accept(visitor: Visitor): T = + when { + click != null -> visitor.visitClick(click) + doubleClick != null -> visitor.visitDoubleClick(doubleClick) + drag != null -> visitor.visitDrag(drag) + keypress != null -> visitor.visitKeypress(keypress) + move != null -> visitor.visitMove(move) + screenshot != null -> visitor.visitScreenshot(screenshot) + scroll != null -> visitor.visitScroll(scroll) + type != null -> visitor.visitType(type) + wait != null -> visitor.visitWait(wait) + else -> visitor.unknown(_json) + } + + 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(): BetaComputerAction = apply { + if (validated) { + return@apply + } + + accept( + object : Visitor { + override fun visitClick(click: Click) { + click.validate() + } + + override fun visitDoubleClick(doubleClick: DoubleClick) { + doubleClick.validate() + } + + override fun visitDrag(drag: Drag) { + drag.validate() + } + + override fun visitKeypress(keypress: Keypress) { + keypress.validate() + } + + override fun visitMove(move: Move) { + move.validate() + } + + override fun visitScreenshot(screenshot: JsonValue) { + screenshot.let { + if (it != JsonValue.from(mapOf("type" to "screenshot"))) { + throw OpenAIInvalidDataException( + "'screenshot' is invalid, received $it" + ) + } + } + } + + override fun visitScroll(scroll: Scroll) { + scroll.validate() + } + + override fun visitType(type: Type) { + type.validate() + } + + override fun visitWait(wait: JsonValue) { + wait.let { + if (it != JsonValue.from(mapOf("type" to "wait"))) { + throw OpenAIInvalidDataException("'wait' is invalid, received $it") + } + } + } + } + ) + 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 = + accept( + object : Visitor { + override fun visitClick(click: Click) = click.validity() + + override fun visitDoubleClick(doubleClick: DoubleClick) = doubleClick.validity() + + override fun visitDrag(drag: Drag) = drag.validity() + + override fun visitKeypress(keypress: Keypress) = keypress.validity() + + override fun visitMove(move: Move) = move.validity() + + override fun visitScreenshot(screenshot: JsonValue) = + screenshot.let { + if (it == JsonValue.from(mapOf("type" to "screenshot"))) 1 else 0 + } + + override fun visitScroll(scroll: Scroll) = scroll.validity() + + override fun visitType(type: Type) = type.validity() + + override fun visitWait(wait: JsonValue) = + wait.let { if (it == JsonValue.from(mapOf("type" to "wait"))) 1 else 0 } + + override fun unknown(json: JsonValue?) = 0 + } + ) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BetaComputerAction && + click == other.click && + doubleClick == other.doubleClick && + drag == other.drag && + keypress == other.keypress && + move == other.move && + screenshot == other.screenshot && + scroll == other.scroll && + type == other.type && + wait == other.wait + } + + override fun hashCode(): Int = + Objects.hash(click, doubleClick, drag, keypress, move, screenshot, scroll, type, wait) + + override fun toString(): String = + when { + click != null -> "BetaComputerAction{click=$click}" + doubleClick != null -> "BetaComputerAction{doubleClick=$doubleClick}" + drag != null -> "BetaComputerAction{drag=$drag}" + keypress != null -> "BetaComputerAction{keypress=$keypress}" + move != null -> "BetaComputerAction{move=$move}" + screenshot != null -> "BetaComputerAction{screenshot=$screenshot}" + scroll != null -> "BetaComputerAction{scroll=$scroll}" + type != null -> "BetaComputerAction{type=$type}" + wait != null -> "BetaComputerAction{wait=$wait}" + _json != null -> "BetaComputerAction{_unknown=$_json}" + else -> throw IllegalStateException("Invalid BetaComputerAction") + } + + companion object { + + /** A click action. */ + @JvmStatic fun ofClick(click: Click) = BetaComputerAction(click = click) + + /** A double click action. */ + @JvmStatic + fun ofDoubleClick(doubleClick: DoubleClick) = BetaComputerAction(doubleClick = doubleClick) + + /** A drag action. */ + @JvmStatic fun ofDrag(drag: Drag) = BetaComputerAction(drag = drag) + + /** A collection of keypresses the model would like to perform. */ + @JvmStatic fun ofKeypress(keypress: Keypress) = BetaComputerAction(keypress = keypress) + + /** A mouse move action. */ + @JvmStatic fun ofMove(move: Move) = BetaComputerAction(move = move) + + /** A screenshot action. */ + @JvmStatic + fun ofScreenshot() = + BetaComputerAction(screenshot = JsonValue.from(mapOf("type" to "screenshot"))) + + /** A scroll action. */ + @JvmStatic fun ofScroll(scroll: Scroll) = BetaComputerAction(scroll = scroll) + + /** An action to type in text. */ + @JvmStatic fun ofType(type: Type) = BetaComputerAction(type = type) + + /** A wait action. */ + @JvmStatic fun ofWait() = BetaComputerAction(wait = JsonValue.from(mapOf("type" to "wait"))) + } + + /** + * An interface that defines how to map each variant of [BetaComputerAction] to a value of type + * [T]. + */ + interface Visitor { + + /** A click action. */ + fun visitClick(click: Click): T + + /** A double click action. */ + fun visitDoubleClick(doubleClick: DoubleClick): T + + /** A drag action. */ + fun visitDrag(drag: Drag): T + + /** A collection of keypresses the model would like to perform. */ + fun visitKeypress(keypress: Keypress): T + + /** A mouse move action. */ + fun visitMove(move: Move): T + + /** A screenshot action. */ + fun visitScreenshot(screenshot: JsonValue): T + + /** A scroll action. */ + fun visitScroll(scroll: Scroll): T + + /** An action to type in text. */ + fun visitType(type: Type): T + + /** A wait action. */ + fun visitWait(wait: JsonValue): T + + /** + * Maps an unknown variant of [BetaComputerAction] to a value of type [T]. + * + * An instance of [BetaComputerAction] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is unaware + * of. + * + * @throws OpenAIInvalidDataException in the default implementation. + */ + fun unknown(json: JsonValue?): T { + throw OpenAIInvalidDataException("Unknown BetaComputerAction: $json") + } + } + + internal class Deserializer : BaseDeserializer(BetaComputerAction::class) { + + override fun ObjectCodec.deserialize(node: JsonNode): BetaComputerAction { + val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() + + when (type) { + "click" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + BetaComputerAction(click = it, _json = json) + } ?: BetaComputerAction(_json = json) + } + "double_click" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + BetaComputerAction(doubleClick = it, _json = json) + } ?: BetaComputerAction(_json = json) + } + "drag" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + BetaComputerAction(drag = it, _json = json) + } ?: BetaComputerAction(_json = json) + } + "keypress" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + BetaComputerAction(keypress = it, _json = json) + } ?: BetaComputerAction(_json = json) + } + "move" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + BetaComputerAction(move = it, _json = json) + } ?: BetaComputerAction(_json = json) + } + "screenshot" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { BetaComputerAction(screenshot = it, _json = json) } + ?.takeIf { it.isValid() } ?: BetaComputerAction(_json = json) + } + "scroll" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + BetaComputerAction(scroll = it, _json = json) + } ?: BetaComputerAction(_json = json) + } + "type" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + BetaComputerAction(type = it, _json = json) + } ?: BetaComputerAction(_json = json) + } + "wait" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { BetaComputerAction(wait = it, _json = json) } + ?.takeIf { it.isValid() } ?: BetaComputerAction(_json = json) + } + } + + return BetaComputerAction(_json = json) + } + } + + internal class Serializer : BaseSerializer(BetaComputerAction::class) { + + override fun serialize( + value: BetaComputerAction, + generator: JsonGenerator, + provider: SerializerProvider, + ) { + when { + value.click != null -> generator.writeObject(value.click) + value.doubleClick != null -> generator.writeObject(value.doubleClick) + value.drag != null -> generator.writeObject(value.drag) + value.keypress != null -> generator.writeObject(value.keypress) + value.move != null -> generator.writeObject(value.move) + value.screenshot != null -> generator.writeObject(value.screenshot) + value.scroll != null -> generator.writeObject(value.scroll) + value.type != null -> generator.writeObject(value.type) + value.wait != null -> generator.writeObject(value.wait) + value._json != null -> generator.writeObject(value._json) + else -> throw IllegalStateException("Invalid BetaComputerAction") + } + } + } + + /** A click action. */ + class Click + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val button: JsonField