@openrouter/sdk 0.8.0 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FUNCTIONS.md +2 -1
- package/_speakeasy/.github/action-inputs-config.json +4 -0
- package/esm/funcs/analyticsGetUserActivity.js +2 -1
- package/esm/funcs/apiKeysCreate.js +2 -1
- package/esm/funcs/apiKeysDelete.js +2 -1
- package/esm/funcs/apiKeysGet.js +2 -1
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +2 -1
- package/esm/funcs/apiKeysList.js +2 -1
- package/esm/funcs/apiKeysUpdate.js +2 -1
- package/esm/funcs/betaResponsesSend.js +2 -1
- package/esm/funcs/call-model.d.ts +19 -70
- package/esm/funcs/call-model.js +29 -71
- package/esm/funcs/chatSend.d.ts +3 -3
- package/esm/funcs/chatSend.js +20 -3
- package/esm/funcs/creditsCreateCoinbaseCharge.js +2 -1
- package/esm/funcs/creditsGetCredits.js +2 -1
- package/esm/funcs/embeddingsGenerate.js +2 -1
- package/esm/funcs/embeddingsListModels.js +2 -1
- package/esm/funcs/endpointsList.js +2 -1
- package/esm/funcs/endpointsListZdrEndpoints.js +2 -1
- package/esm/funcs/generationsGetGeneration.js +2 -1
- package/esm/funcs/guardrailsBulkAssignKeys.js +2 -1
- package/esm/funcs/guardrailsBulkAssignMembers.js +2 -1
- package/esm/funcs/guardrailsBulkUnassignKeys.js +2 -1
- package/esm/funcs/guardrailsBulkUnassignMembers.js +2 -1
- package/esm/funcs/guardrailsCreate.js +2 -1
- package/esm/funcs/guardrailsDelete.js +2 -1
- package/esm/funcs/guardrailsGet.js +2 -1
- package/esm/funcs/guardrailsList.js +2 -1
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +2 -1
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +2 -1
- package/esm/funcs/guardrailsListKeyAssignments.js +2 -1
- package/esm/funcs/guardrailsListMemberAssignments.js +2 -1
- package/esm/funcs/guardrailsUpdate.js +2 -1
- package/esm/funcs/modelsCount.d.ts +1 -1
- package/esm/funcs/modelsCount.js +9 -4
- package/esm/funcs/modelsList.js +3 -1
- package/esm/funcs/modelsListForUser.js +2 -1
- package/esm/funcs/oAuthCreateAuthCode.d.ts +1 -1
- package/esm/funcs/oAuthCreateAuthCode.js +4 -3
- package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +2 -1
- package/esm/funcs/providersList.js +2 -1
- package/esm/index.d.ts +22 -23
- package/esm/index.js +20 -17
- package/esm/lib/anthropic-compat.d.ts +2 -1
- package/esm/lib/anthropic-compat.js +1 -2
- package/esm/lib/async-params.d.ts +19 -5
- package/esm/lib/async-params.js +5 -1
- package/esm/lib/chat-compat.d.ts +1 -1
- package/esm/lib/chat-compat.js +1 -2
- package/esm/lib/claude-type-guards.d.ts +2 -2
- package/esm/lib/config.d.ts +8 -10
- package/esm/lib/config.js +2 -2
- package/esm/lib/conversation-state.d.ts +1 -1
- package/esm/lib/conversation-state.js +35 -32
- package/esm/lib/env.d.ts +6 -2
- package/esm/lib/env.js +7 -3
- package/esm/lib/model-result.d.ts +73 -17
- package/esm/lib/model-result.js +329 -125
- package/esm/lib/sdks.d.ts +1 -1
- package/esm/lib/sdks.js +8 -28
- package/esm/lib/stream-transformers.d.ts +5 -4
- package/esm/lib/stream-transformers.js +24 -29
- package/esm/lib/stream-type-guards.js +8 -32
- package/esm/lib/tool-context.d.ts +68 -0
- package/esm/lib/tool-context.js +175 -0
- package/esm/lib/tool-executor.d.ts +9 -5
- package/esm/lib/tool-executor.js +26 -16
- package/esm/lib/tool-orchestrator.d.ts +2 -2
- package/esm/lib/tool-types.d.ts +101 -14
- package/esm/lib/tool-types.js +17 -0
- package/esm/lib/tool.d.ts +49 -60
- package/esm/lib/tool.js +15 -19
- package/esm/lib/turn-context.d.ts +1 -1
- package/esm/models/assistantmessage.d.ts +53 -36
- package/esm/models/assistantmessage.js +38 -47
- package/esm/models/assistantmessageimages.d.ts +33 -0
- package/esm/models/assistantmessageimages.js +44 -0
- package/esm/models/chatcompletionaudiooutput.d.ts +38 -0
- package/esm/models/chatcompletionaudiooutput.js +36 -0
- package/esm/models/chatgenerationparams.d.ts +527 -131
- package/esm/models/chatgenerationparams.js +280 -97
- package/esm/models/chatgenerationtokenusage.d.ts +48 -0
- package/esm/models/chatmessagecontentitem.d.ts +16 -10
- package/esm/models/chatmessagecontentitem.js +28 -4
- package/esm/models/chatmessagecontentitemaudio.d.ts +20 -2
- package/esm/models/chatmessagecontentitemaudio.js +9 -2
- package/esm/models/chatmessagecontentitemcachecontrol.d.ts +19 -8
- package/esm/models/chatmessagecontentitemcachecontrol.js +14 -9
- package/esm/models/chatmessagecontentitemfile.d.ts +57 -0
- package/esm/models/chatmessagecontentitemfile.js +59 -0
- package/esm/models/chatmessagecontentitemimage.d.ts +26 -3
- package/esm/models/chatmessagecontentitemimage.js +12 -2
- package/esm/models/chatmessagecontentitemtext.d.ts +17 -2
- package/esm/models/chatmessagecontentitemtext.js +9 -2
- package/esm/models/chatmessagecontentitemvideo.d.ts +12 -55
- package/esm/models/chatmessagecontentitemvideo.js +5 -72
- package/esm/models/chatmessagecontentitemvideolegacy.d.ts +28 -0
- package/esm/models/chatmessagecontentitemvideolegacy.js +33 -0
- package/esm/models/chatmessagetokenlogprob.d.ts +15 -0
- package/esm/models/chatmessagetokenlogprobs.d.ts +10 -1
- package/esm/models/chatmessagetokenlogprobs.js +2 -1
- package/esm/models/chatmessagetoolcall.d.ts +23 -2
- package/esm/models/chatmessagetoolcall.js +9 -2
- package/esm/models/chatresponse.d.ts +30 -2
- package/esm/models/chatresponse.js +7 -2
- package/esm/models/chatresponsechoice.d.ts +13 -2
- package/esm/models/chatresponsechoice.js +1 -2
- package/esm/models/chatstreamingchoice.d.ts +13 -2
- package/esm/models/chatstreamingchoice.js +1 -2
- package/esm/models/chatstreamingmessagechunk.d.ts +31 -2
- package/esm/models/chatstreamingmessagechunk.js +7 -2
- package/esm/models/chatstreamingmessagetoolcall.d.ts +38 -1
- package/esm/models/chatstreamingmessagetoolcall.js +9 -1
- package/esm/models/chatstreamingresponsechunk.d.ts +46 -12
- package/esm/models/chatstreamingresponsechunk.js +12 -26
- package/esm/models/chatstreamoptions.d.ts +8 -0
- package/esm/models/compoundfilter.d.ts +36 -0
- package/esm/models/compoundfilter.js +32 -0
- package/esm/models/conflictresponseerrordata.d.ts +17 -0
- package/esm/models/conflictresponseerrordata.js +16 -0
- package/esm/models/contextcompressionengine.d.ts +15 -0
- package/esm/models/contextcompressionengine.js +14 -0
- package/esm/models/datetimeservertool.d.ts +30 -0
- package/esm/models/datetimeservertool.js +22 -0
- package/esm/models/debugoptions.d.ts +18 -0
- package/esm/models/debugoptions.js +18 -0
- package/esm/models/defaultparameters.d.ts +3 -0
- package/esm/models/defaultparameters.js +6 -0
- package/esm/models/developermessage.d.ts +12 -0
- package/esm/models/errors/conflictresponseerror.d.ts +33 -0
- package/esm/models/errors/{chaterror.js → conflictresponseerror.js} +17 -7
- package/esm/models/errors/index.d.ts +1 -1
- package/esm/models/errors/index.js +1 -1
- package/esm/models/index.d.ts +35 -12
- package/esm/models/index.js +35 -12
- package/esm/models/jsonschemaconfig.d.ts +17 -2
- package/esm/models/jsonschemaconfig.js +1 -1
- package/esm/models/message.d.ts +9 -2
- package/esm/models/message.js +1 -1
- package/esm/models/modelscountresponse.d.ts +4 -4
- package/esm/models/modelscountresponse.js +4 -4
- package/esm/models/namedtoolchoice.d.ts +15 -2
- package/esm/models/namedtoolchoice.js +6 -1
- package/esm/models/openairesponsesinputunion.d.ts +32 -1
- package/esm/models/openairesponsesinputunion.js +53 -1
- package/esm/models/openairesponsesreasoningconfig.d.ts +1 -1
- package/esm/models/openairesponsesreasoningconfig.js +1 -1
- package/esm/models/openresponsesapplypatchtool.d.ts +20 -0
- package/esm/models/openresponsesapplypatchtool.js +21 -0
- package/esm/models/openresponsescodeinterpretertool.d.ts +68 -0
- package/esm/models/openresponsescodeinterpretertool.js +85 -0
- package/esm/models/openresponsescomputertool.d.ts +39 -0
- package/esm/models/openresponsescomputertool.js +50 -0
- package/esm/models/openresponsescustomtool.d.ts +75 -0
- package/esm/models/openresponsescustomtool.js +95 -0
- package/esm/models/openresponseseasyinputmessage.d.ts +30 -4
- package/esm/models/openresponseseasyinputmessage.js +28 -2
- package/esm/models/openresponsesfilesearchtool.d.ts +111 -0
- package/esm/models/openresponsesfilesearchtool.js +180 -0
- package/esm/models/openresponsesfunctioncalloutput.d.ts +46 -7
- package/esm/models/openresponsesfunctioncalloutput.js +56 -4
- package/esm/models/openresponsesfunctionshelltool.d.ts +20 -0
- package/esm/models/openresponsesfunctionshelltool.js +21 -0
- package/esm/models/openresponsesimagegenerationtool.d.ts +125 -0
- package/esm/models/openresponsesimagegenerationtool.js +153 -0
- package/esm/models/openresponsesinputmessageitem.d.ts +2 -2
- package/esm/models/openresponsesinputmessageitem.js +2 -2
- package/esm/models/openresponsesinputunion.d.ts +207 -0
- package/esm/models/openresponsesinputunion.js +225 -0
- package/esm/models/openresponseslocalshelltool.d.ts +20 -0
- package/esm/models/openresponseslocalshelltool.js +21 -0
- package/esm/models/openresponsesmcptool.d.ts +128 -0
- package/esm/models/openresponsesmcptool.js +173 -0
- package/esm/models/openresponsesnonstreamingresponse.d.ts +15 -6
- package/esm/models/openresponsesnonstreamingresponse.js +30 -3
- package/esm/models/openresponsesreasoning.d.ts +2 -2
- package/esm/models/openresponsesreasoning.js +1 -1
- package/esm/models/openresponsesreasoningconfig.d.ts +2 -2
- package/esm/models/openresponsesreasoningconfig.js +1 -1
- package/esm/models/openresponsesrequest.d.ts +111 -39
- package/esm/models/openresponsesrequest.js +112 -38
- package/esm/models/openresponsesstreamevent.d.ts +52 -4
- package/esm/models/openresponsesstreamevent.js +54 -3
- package/esm/models/openresponseswebsearch20250826tool.d.ts +29 -0
- package/esm/models/openresponseswebsearch20250826tool.js +23 -0
- package/esm/models/openresponseswebsearchcallcompleted.d.ts +16 -0
- package/esm/models/openresponseswebsearchcallcompleted.js +24 -0
- package/esm/models/openresponseswebsearchcallinprogress.d.ts +16 -0
- package/esm/models/openresponseswebsearchcallinprogress.js +24 -0
- package/esm/models/openresponseswebsearchcallsearching.d.ts +16 -0
- package/esm/models/openresponseswebsearchcallsearching.js +24 -0
- package/esm/models/openresponseswebsearchpreview20250311tool.d.ts +44 -0
- package/esm/models/openresponseswebsearchpreview20250311tool.js +51 -0
- package/esm/models/openresponseswebsearchpreviewtool.d.ts +44 -0
- package/esm/models/openresponseswebsearchpreviewtool.js +47 -0
- package/esm/models/openresponseswebsearchtool.d.ts +29 -0
- package/esm/models/openresponseswebsearchtool.js +23 -0
- package/esm/models/operations/bulkassignkeystoguardrail.d.ts +16 -3
- package/esm/models/operations/bulkassignkeystoguardrail.js +2 -2
- package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +16 -3
- package/esm/models/operations/bulkassignmemberstoguardrail.js +2 -2
- package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +16 -3
- package/esm/models/operations/bulkunassignkeysfromguardrail.js +2 -2
- package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +16 -3
- package/esm/models/operations/bulkunassignmembersfromguardrail.js +2 -2
- package/esm/models/operations/createauthkeyscode.d.ts +40 -3
- package/esm/models/operations/createauthkeyscode.js +16 -2
- package/esm/models/operations/createcoinbasecharge.d.ts +16 -3
- package/esm/models/operations/createcoinbasecharge.js +2 -2
- package/esm/models/operations/createembeddings.d.ts +16 -3
- package/esm/models/operations/createembeddings.js +2 -2
- package/esm/models/operations/createguardrail.d.ts +25 -3
- package/esm/models/operations/createguardrail.js +6 -2
- package/esm/models/operations/createkeys.d.ts +16 -3
- package/esm/models/operations/createkeys.js +2 -2
- package/esm/models/operations/createresponses.d.ts +16 -3
- package/esm/models/operations/createresponses.js +2 -2
- package/esm/models/operations/deleteguardrail.d.ts +16 -3
- package/esm/models/operations/deleteguardrail.js +2 -2
- package/esm/models/operations/deletekeys.d.ts +16 -3
- package/esm/models/operations/deletekeys.js +2 -2
- package/esm/models/operations/exchangeauthcodeforapikey.d.ts +16 -3
- package/esm/models/operations/exchangeauthcodeforapikey.js +2 -2
- package/esm/models/operations/getcredits.d.ts +16 -3
- package/esm/models/operations/getcredits.js +2 -2
- package/esm/models/operations/getcurrentkey.d.ts +16 -3
- package/esm/models/operations/getcurrentkey.js +2 -2
- package/esm/models/operations/getgeneration.d.ts +27 -3
- package/esm/models/operations/getgeneration.js +9 -2
- package/esm/models/operations/getguardrail.d.ts +20 -3
- package/esm/models/operations/getguardrail.js +4 -2
- package/esm/models/operations/getkey.d.ts +16 -3
- package/esm/models/operations/getkey.js +2 -2
- package/esm/models/operations/getmodels.d.ts +21 -3
- package/esm/models/operations/getmodels.js +4 -2
- package/esm/models/operations/getuseractivity.d.ts +16 -3
- package/esm/models/operations/getuseractivity.js +2 -2
- package/esm/models/operations/list.d.ts +16 -3
- package/esm/models/operations/list.js +2 -2
- package/esm/models/operations/listembeddingsmodels.d.ts +16 -3
- package/esm/models/operations/listembeddingsmodels.js +2 -2
- package/esm/models/operations/listendpoints.d.ts +16 -3
- package/esm/models/operations/listendpoints.js +2 -2
- package/esm/models/operations/listendpointszdr.d.ts +16 -3
- package/esm/models/operations/listendpointszdr.js +2 -2
- package/esm/models/operations/listguardrailkeyassignments.d.ts +16 -3
- package/esm/models/operations/listguardrailkeyassignments.js +2 -2
- package/esm/models/operations/listguardrailmemberassignments.d.ts +16 -3
- package/esm/models/operations/listguardrailmemberassignments.js +2 -2
- package/esm/models/operations/listguardrails.d.ts +20 -3
- package/esm/models/operations/listguardrails.js +4 -2
- package/esm/models/operations/listkeyassignments.d.ts +16 -3
- package/esm/models/operations/listkeyassignments.js +2 -2
- package/esm/models/operations/listmemberassignments.d.ts +16 -3
- package/esm/models/operations/listmemberassignments.js +2 -2
- package/esm/models/operations/listmodelscount.d.ts +21 -3
- package/esm/models/operations/listmodelscount.js +4 -2
- package/esm/models/operations/listmodelsuser.d.ts +16 -3
- package/esm/models/operations/listmodelsuser.js +2 -2
- package/esm/models/operations/listproviders.d.ts +16 -3
- package/esm/models/operations/listproviders.js +2 -2
- package/esm/models/operations/sendchatcompletionrequest.d.ts +27 -5
- package/esm/models/operations/sendchatcompletionrequest.js +22 -4
- package/esm/models/operations/updateguardrail.d.ts +25 -3
- package/esm/models/operations/updateguardrail.js +6 -2
- package/esm/models/operations/updatekeys.d.ts +16 -3
- package/esm/models/operations/updatekeys.js +2 -2
- package/esm/models/outputmessage.d.ts +23 -0
- package/esm/models/outputmessage.js +24 -0
- package/esm/models/outputmodality.d.ts +1 -0
- package/esm/models/outputmodality.js +1 -0
- package/esm/models/providername.d.ts +3 -0
- package/esm/models/providername.js +3 -0
- package/esm/models/providerpreferences.d.ts +49 -14
- package/esm/models/providerpreferences.js +33 -15
- package/esm/models/providersort.d.ts +7 -0
- package/esm/models/providersort.js +4 -0
- package/esm/models/providersortconfig.d.ts +31 -2
- package/esm/models/providersortconfig.js +16 -2
- package/esm/models/reasoningdetailencrypted.d.ts +42 -0
- package/esm/models/reasoningdetailencrypted.js +42 -0
- package/esm/models/reasoningdetailsummary.d.ts +42 -0
- package/esm/models/reasoningdetailsummary.js +42 -0
- package/esm/models/reasoningdetailtext.d.ts +44 -0
- package/esm/models/reasoningdetailtext.js +44 -0
- package/esm/models/reasoningdetailunion.d.ts +19 -0
- package/esm/models/reasoningdetailunion.js +28 -0
- package/esm/models/responseformatjsonobject.d.ts +20 -0
- package/esm/models/responseformatjsonobject.js +21 -0
- package/esm/models/responseformatjsonschema.d.ts +6 -0
- package/esm/models/responseformattext.d.ts +15 -0
- package/esm/models/responseformattext.js +13 -0
- package/esm/models/responseformattextconfig.d.ts +3 -3
- package/esm/models/responseformattextconfig.js +3 -3
- package/esm/models/responseformattextgrammar.d.ts +6 -0
- package/esm/models/responseformattextpython.d.ts +15 -0
- package/esm/models/responseformattextpython.js +13 -0
- package/esm/models/responseoutputtext.d.ts +8 -8
- package/esm/models/responseoutputtext.js +10 -9
- package/esm/models/responseserrorfield.d.ts +4 -4
- package/esm/models/responseserrorfield.js +4 -4
- package/esm/models/responsesoutputitem.d.ts +2 -13
- package/esm/models/responsesoutputitem.js +8 -6
- package/esm/models/responsesoutputitemreasoning.d.ts +3 -32
- package/esm/models/responsesoutputitemreasoning.js +3 -45
- package/esm/models/responsesoutputmessage.d.ts +24 -32
- package/esm/models/responsesoutputmessage.js +26 -47
- package/esm/models/responsesservertooloutput.d.ts +42 -0
- package/esm/models/responsesservertooloutput.js +44 -0
- package/esm/models/responseswebsearchcalloutput.d.ts +90 -5
- package/esm/models/responseswebsearchcalloutput.js +113 -5
- package/esm/models/responseswebsearchservertool.d.ts +35 -0
- package/esm/models/responseswebsearchservertool.js +28 -0
- package/esm/models/systemmessage.d.ts +12 -0
- package/esm/models/toolchoiceoption.d.ts +31 -0
- package/esm/models/toolchoiceoption.js +32 -0
- package/esm/models/tooldefinitionjson.d.ts +62 -10
- package/esm/models/tooldefinitionjson.js +29 -6
- package/esm/models/toolresponsemessage.d.ts +12 -0
- package/esm/models/usermessage.d.ts +12 -0
- package/esm/models/videoinput.d.ts +23 -0
- package/esm/models/videoinput.js +22 -0
- package/esm/models/websearchengine.d.ts +2 -0
- package/esm/models/websearchengine.js +2 -0
- package/esm/models/websearchservertool.d.ts +116 -0
- package/esm/models/websearchservertool.js +77 -0
- package/esm/models/websearchshorthand.d.ts +215 -0
- package/esm/models/websearchshorthand.js +138 -0
- package/esm/sdk/chat.d.ts +1 -1
- package/esm/sdk/sdk.d.ts +6 -3
- package/esm/sdk/sdk.js +3 -4
- package/esm/types/index.d.ts +0 -2
- package/esm/types/index.js +0 -1
- package/jsr.json +1 -1
- package/package.json +11 -6
- package/turbo.json +10 -0
- package/esm/models/chaterror.d.ts +0 -17
- package/esm/models/chaterror.js +0 -25
- package/esm/models/errors/chaterror.d.ts +0 -19
- package/esm/models/openresponsesinput.d.ts +0 -28
- package/esm/models/openresponsesinput.js +0 -54
- package/esm/models/openresponseslogprobs.d.ts +0 -16
- package/esm/models/openresponseslogprobs.js +0 -22
- package/esm/models/openresponsestoplogprobs.d.ts +0 -14
- package/esm/models/openresponsestoplogprobs.js +0 -15
- package/esm/models/providersortunion.d.ts +0 -10
- package/esm/models/providersortunion.js +0 -13
- package/esm/models/responsesformatjsonobject.d.ts +0 -20
- package/esm/models/responsesformatjsonobject.js +0 -21
- package/esm/models/schema10.d.ts +0 -33
- package/esm/models/schema10.js +0 -30
- package/esm/models/schema14.d.ts +0 -8
- package/esm/models/schema14.js +0 -12
- package/esm/models/schema17.d.ts +0 -102
- package/esm/models/schema17.js +0 -95
- package/esm/models/schema19.d.ts +0 -92
- package/esm/models/schema19.js +0 -109
- package/esm/models/schema5.d.ts +0 -86
- package/esm/models/schema5.js +0 -89
|
@@ -6,34 +6,63 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
8
|
import { ChatStreamOptions$outboundSchema, } from "./chatstreamoptions.js";
|
|
9
|
+
import { ContextCompressionEngine$outboundSchema, } from "./contextcompressionengine.js";
|
|
10
|
+
import { DataCollection$outboundSchema, } from "./datacollection.js";
|
|
11
|
+
import { DebugOptions$outboundSchema, } from "./debugoptions.js";
|
|
9
12
|
import { Message$outboundSchema, } from "./message.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
13
|
+
import { PDFParserOptions$outboundSchema, } from "./pdfparseroptions.js";
|
|
14
|
+
import { PreferredMaxLatency$outboundSchema, } from "./preferredmaxlatency.js";
|
|
15
|
+
import { PreferredMinThroughput$outboundSchema, } from "./preferredminthroughput.js";
|
|
16
|
+
import { ProviderName$outboundSchema } from "./providername.js";
|
|
17
|
+
import { Quantization$outboundSchema } from "./quantization.js";
|
|
18
|
+
import { ResponseFormatJSONObject$outboundSchema, } from "./responseformatjsonobject.js";
|
|
12
19
|
import { ResponseFormatJSONSchema$outboundSchema, } from "./responseformatjsonschema.js";
|
|
20
|
+
import { ResponseFormatText$outboundSchema, } from "./responseformattext.js";
|
|
13
21
|
import { ResponseFormatTextGrammar$outboundSchema, } from "./responseformattextgrammar.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { Schema5$outboundSchema, } from "./schema5.js";
|
|
22
|
+
import { ResponseFormatTextPython$outboundSchema, } from "./responseformattextpython.js";
|
|
23
|
+
import { ToolChoiceOption$outboundSchema, } from "./toolchoiceoption.js";
|
|
17
24
|
import { ToolDefinitionJson$outboundSchema, } from "./tooldefinitionjson.js";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
import { WebSearchEngine$outboundSchema, } from "./websearchengine.js";
|
|
26
|
+
export const ChatGenerationParamsSortEnum = {
|
|
27
|
+
Price: "price",
|
|
28
|
+
Throughput: "throughput",
|
|
29
|
+
Latency: "latency",
|
|
30
|
+
Exacto: "exacto",
|
|
21
31
|
};
|
|
22
|
-
export const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Fp8: "fp8",
|
|
28
|
-
Fp16: "fp16",
|
|
29
|
-
Bf16: "bf16",
|
|
30
|
-
Fp32: "fp32",
|
|
31
|
-
Unknown: "unknown",
|
|
32
|
+
export const ChatGenerationParamsProviderSortConfigEnum = {
|
|
33
|
+
Price: "price",
|
|
34
|
+
Throughput: "throughput",
|
|
35
|
+
Latency: "latency",
|
|
36
|
+
Exacto: "exacto",
|
|
32
37
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
/**
|
|
39
|
+
* The provider sorting strategy (price, throughput, latency)
|
|
40
|
+
*/
|
|
41
|
+
export const ChatGenerationParamsBy = {
|
|
42
|
+
Price: "price",
|
|
43
|
+
Throughput: "throughput",
|
|
44
|
+
Latency: "latency",
|
|
45
|
+
Exacto: "exacto",
|
|
36
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model.
|
|
49
|
+
*/
|
|
50
|
+
export const ChatGenerationParamsPartition = {
|
|
51
|
+
Model: "model",
|
|
52
|
+
None: "none",
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The provider sorting strategy (price, throughput, latency)
|
|
56
|
+
*/
|
|
57
|
+
export const ChatGenerationParamsProviderSort = {
|
|
58
|
+
Price: "price",
|
|
59
|
+
Throughput: "throughput",
|
|
60
|
+
Latency: "latency",
|
|
61
|
+
Exacto: "exacto",
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Constrains effort on reasoning for reasoning models
|
|
65
|
+
*/
|
|
37
66
|
export const Effort = {
|
|
38
67
|
Xhigh: "xhigh",
|
|
39
68
|
High: "high",
|
|
@@ -45,45 +74,107 @@ export const Effort = {
|
|
|
45
74
|
export const Modality = {
|
|
46
75
|
Text: "text",
|
|
47
76
|
Image: "image",
|
|
77
|
+
Audio: "audio",
|
|
78
|
+
};
|
|
79
|
+
export const ChatGenerationParamsType = {
|
|
80
|
+
Ephemeral: "ephemeral",
|
|
81
|
+
};
|
|
82
|
+
export const ChatGenerationParamsTtl = {
|
|
83
|
+
Fivem: "5m",
|
|
84
|
+
Oneh: "1h",
|
|
48
85
|
};
|
|
49
86
|
/** @internal */
|
|
50
|
-
export const
|
|
51
|
-
|
|
87
|
+
export const ChatGenerationParamsOrder$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
88
|
+
export function chatGenerationParamsOrderToJSON(chatGenerationParamsOrder) {
|
|
89
|
+
return JSON.stringify(ChatGenerationParamsOrder$outboundSchema.parse(chatGenerationParamsOrder));
|
|
90
|
+
}
|
|
91
|
+
/** @internal */
|
|
92
|
+
export const ChatGenerationParamsOnly$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
93
|
+
export function chatGenerationParamsOnlyToJSON(chatGenerationParamsOnly) {
|
|
94
|
+
return JSON.stringify(ChatGenerationParamsOnly$outboundSchema.parse(chatGenerationParamsOnly));
|
|
95
|
+
}
|
|
96
|
+
/** @internal */
|
|
97
|
+
export const ChatGenerationParamsIgnore$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
98
|
+
export function chatGenerationParamsIgnoreToJSON(chatGenerationParamsIgnore) {
|
|
99
|
+
return JSON.stringify(ChatGenerationParamsIgnore$outboundSchema.parse(chatGenerationParamsIgnore));
|
|
100
|
+
}
|
|
52
101
|
/** @internal */
|
|
53
|
-
export const
|
|
54
|
-
.outboundSchema(Schema8);
|
|
102
|
+
export const ChatGenerationParamsSortEnum$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsSortEnum);
|
|
55
103
|
/** @internal */
|
|
56
|
-
export const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
104
|
+
export const ChatGenerationParamsProviderSortConfigEnum$outboundSchema = z.enum(ChatGenerationParamsProviderSortConfigEnum);
|
|
105
|
+
/** @internal */
|
|
106
|
+
export const ChatGenerationParamsBy$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsBy);
|
|
107
|
+
/** @internal */
|
|
108
|
+
export const ChatGenerationParamsPartition$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsPartition);
|
|
109
|
+
/** @internal */
|
|
110
|
+
export const ChatGenerationParamsProviderSortConfig$outboundSchema = z.object({
|
|
111
|
+
by: z.nullable(ChatGenerationParamsBy$outboundSchema).optional(),
|
|
112
|
+
partition: z.nullable(ChatGenerationParamsPartition$outboundSchema)
|
|
113
|
+
.optional(),
|
|
62
114
|
});
|
|
63
|
-
export function
|
|
64
|
-
return JSON.stringify(
|
|
115
|
+
export function chatGenerationParamsProviderSortConfigToJSON(chatGenerationParamsProviderSortConfig) {
|
|
116
|
+
return JSON.stringify(ChatGenerationParamsProviderSortConfig$outboundSchema.parse(chatGenerationParamsProviderSortConfig));
|
|
65
117
|
}
|
|
66
118
|
/** @internal */
|
|
67
|
-
export const
|
|
68
|
-
|
|
69
|
-
|
|
119
|
+
export const ChatGenerationParamsProviderSortConfigUnion$outboundSchema = z.union([
|
|
120
|
+
z.lazy(() => ChatGenerationParamsProviderSortConfig$outboundSchema),
|
|
121
|
+
ChatGenerationParamsProviderSortConfigEnum$outboundSchema,
|
|
122
|
+
]);
|
|
123
|
+
export function chatGenerationParamsProviderSortConfigUnionToJSON(chatGenerationParamsProviderSortConfigUnion) {
|
|
124
|
+
return JSON.stringify(ChatGenerationParamsProviderSortConfigUnion$outboundSchema.parse(chatGenerationParamsProviderSortConfigUnion));
|
|
70
125
|
}
|
|
71
126
|
/** @internal */
|
|
72
|
-
export const
|
|
73
|
-
|
|
127
|
+
export const ChatGenerationParamsProviderSort$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsProviderSort);
|
|
128
|
+
/** @internal */
|
|
129
|
+
export const ChatGenerationParamsSortUnion$outboundSchema = z.union([
|
|
130
|
+
ChatGenerationParamsProviderSort$outboundSchema,
|
|
131
|
+
z.union([
|
|
132
|
+
z.lazy(() => ChatGenerationParamsProviderSortConfig$outboundSchema),
|
|
133
|
+
ChatGenerationParamsProviderSortConfigEnum$outboundSchema,
|
|
134
|
+
]),
|
|
135
|
+
ChatGenerationParamsSortEnum$outboundSchema,
|
|
136
|
+
]);
|
|
137
|
+
export function chatGenerationParamsSortUnionToJSON(chatGenerationParamsSortUnion) {
|
|
138
|
+
return JSON.stringify(ChatGenerationParamsSortUnion$outboundSchema.parse(chatGenerationParamsSortUnion));
|
|
139
|
+
}
|
|
140
|
+
/** @internal */
|
|
141
|
+
export const ChatGenerationParamsMaxPrice$outboundSchema = z.object({
|
|
142
|
+
prompt: z.string().optional(),
|
|
143
|
+
completion: z.string().optional(),
|
|
144
|
+
image: z.string().optional(),
|
|
145
|
+
audio: z.string().optional(),
|
|
146
|
+
request: z.string().optional(),
|
|
147
|
+
});
|
|
148
|
+
export function chatGenerationParamsMaxPriceToJSON(chatGenerationParamsMaxPrice) {
|
|
149
|
+
return JSON.stringify(ChatGenerationParamsMaxPrice$outboundSchema.parse(chatGenerationParamsMaxPrice));
|
|
150
|
+
}
|
|
151
|
+
/** @internal */
|
|
152
|
+
export const ChatGenerationParamsProvider$outboundSchema = z.object({
|
|
74
153
|
allowFallbacks: z.nullable(z.boolean()).optional(),
|
|
75
154
|
requireParameters: z.nullable(z.boolean()).optional(),
|
|
76
|
-
dataCollection: z.nullable(
|
|
155
|
+
dataCollection: z.nullable(DataCollection$outboundSchema).optional(),
|
|
77
156
|
zdr: z.nullable(z.boolean()).optional(),
|
|
78
157
|
enforceDistillableText: z.nullable(z.boolean()).optional(),
|
|
79
|
-
order: z.nullable(z.array(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
158
|
+
order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
159
|
+
.optional(),
|
|
160
|
+
only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
161
|
+
.optional(),
|
|
162
|
+
ignore: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))).optional(),
|
|
163
|
+
quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(),
|
|
164
|
+
sort: z.nullable(z.union([
|
|
165
|
+
ChatGenerationParamsProviderSort$outboundSchema,
|
|
166
|
+
z.union([
|
|
167
|
+
z.lazy(() => ChatGenerationParamsProviderSortConfig$outboundSchema),
|
|
168
|
+
ChatGenerationParamsProviderSortConfigEnum$outboundSchema,
|
|
169
|
+
]),
|
|
170
|
+
ChatGenerationParamsSortEnum$outboundSchema,
|
|
171
|
+
])).optional(),
|
|
172
|
+
maxPrice: z.lazy(() => ChatGenerationParamsMaxPrice$outboundSchema)
|
|
173
|
+
.optional(),
|
|
174
|
+
preferredMinThroughput: z.nullable(PreferredMinThroughput$outboundSchema)
|
|
175
|
+
.optional(),
|
|
176
|
+
preferredMaxLatency: z.nullable(PreferredMaxLatency$outboundSchema)
|
|
177
|
+
.optional(),
|
|
87
178
|
}).transform((v) => {
|
|
88
179
|
return remap$(v, {
|
|
89
180
|
allowFallbacks: "allow_fallbacks",
|
|
@@ -95,51 +186,129 @@ export const Schema0$outboundSchema = z
|
|
|
95
186
|
preferredMaxLatency: "preferred_max_latency",
|
|
96
187
|
});
|
|
97
188
|
});
|
|
98
|
-
export function
|
|
99
|
-
return JSON.stringify(
|
|
189
|
+
export function chatGenerationParamsProviderToJSON(chatGenerationParamsProvider) {
|
|
190
|
+
return JSON.stringify(ChatGenerationParamsProvider$outboundSchema.parse(chatGenerationParamsProvider));
|
|
100
191
|
}
|
|
101
192
|
/** @internal */
|
|
102
|
-
export const
|
|
103
|
-
.
|
|
193
|
+
export const ChatGenerationParamsPluginContextCompression$outboundSchema = z.object({
|
|
194
|
+
id: z.literal("context-compression"),
|
|
195
|
+
enabled: z.boolean().optional(),
|
|
196
|
+
engine: ContextCompressionEngine$outboundSchema.optional(),
|
|
197
|
+
});
|
|
198
|
+
export function chatGenerationParamsPluginContextCompressionToJSON(chatGenerationParamsPluginContextCompression) {
|
|
199
|
+
return JSON.stringify(ChatGenerationParamsPluginContextCompression$outboundSchema.parse(chatGenerationParamsPluginContextCompression));
|
|
200
|
+
}
|
|
104
201
|
/** @internal */
|
|
105
|
-
export const
|
|
106
|
-
.
|
|
202
|
+
export const ChatGenerationParamsPluginResponseHealing$outboundSchema = z.object({
|
|
203
|
+
id: z.literal("response-healing"),
|
|
204
|
+
enabled: z.boolean().optional(),
|
|
205
|
+
});
|
|
206
|
+
export function chatGenerationParamsPluginResponseHealingToJSON(chatGenerationParamsPluginResponseHealing) {
|
|
207
|
+
return JSON.stringify(ChatGenerationParamsPluginResponseHealing$outboundSchema.parse(chatGenerationParamsPluginResponseHealing));
|
|
208
|
+
}
|
|
107
209
|
/** @internal */
|
|
108
|
-
export const
|
|
109
|
-
|
|
110
|
-
|
|
210
|
+
export const ChatGenerationParamsPluginFileParser$outboundSchema = z.object({
|
|
211
|
+
id: z.literal("file-parser"),
|
|
212
|
+
enabled: z.boolean().optional(),
|
|
213
|
+
pdf: PDFParserOptions$outboundSchema.optional(),
|
|
111
214
|
});
|
|
112
|
-
export function
|
|
113
|
-
return JSON.stringify(
|
|
215
|
+
export function chatGenerationParamsPluginFileParserToJSON(chatGenerationParamsPluginFileParser) {
|
|
216
|
+
return JSON.stringify(ChatGenerationParamsPluginFileParser$outboundSchema.parse(chatGenerationParamsPluginFileParser));
|
|
114
217
|
}
|
|
115
218
|
/** @internal */
|
|
116
|
-
export const
|
|
117
|
-
|
|
219
|
+
export const ChatGenerationParamsPluginWeb$outboundSchema = z.object({
|
|
220
|
+
id: z.literal("web"),
|
|
221
|
+
enabled: z.boolean().optional(),
|
|
222
|
+
maxResults: z.number().optional(),
|
|
223
|
+
searchPrompt: z.string().optional(),
|
|
224
|
+
engine: WebSearchEngine$outboundSchema.optional(),
|
|
225
|
+
includeDomains: z.array(z.string()).optional(),
|
|
226
|
+
excludeDomains: z.array(z.string()).optional(),
|
|
227
|
+
}).transform((v) => {
|
|
228
|
+
return remap$(v, {
|
|
229
|
+
maxResults: "max_results",
|
|
230
|
+
searchPrompt: "search_prompt",
|
|
231
|
+
includeDomains: "include_domains",
|
|
232
|
+
excludeDomains: "exclude_domains",
|
|
233
|
+
});
|
|
118
234
|
});
|
|
119
|
-
export function
|
|
120
|
-
return JSON.stringify(
|
|
235
|
+
export function chatGenerationParamsPluginWebToJSON(chatGenerationParamsPluginWeb) {
|
|
236
|
+
return JSON.stringify(ChatGenerationParamsPluginWeb$outboundSchema.parse(chatGenerationParamsPluginWeb));
|
|
121
237
|
}
|
|
122
238
|
/** @internal */
|
|
123
|
-
export const
|
|
124
|
-
|
|
239
|
+
export const ChatGenerationParamsPluginModeration$outboundSchema = z.object({
|
|
240
|
+
id: z.literal("moderation"),
|
|
241
|
+
});
|
|
242
|
+
export function chatGenerationParamsPluginModerationToJSON(chatGenerationParamsPluginModeration) {
|
|
243
|
+
return JSON.stringify(ChatGenerationParamsPluginModeration$outboundSchema.parse(chatGenerationParamsPluginModeration));
|
|
244
|
+
}
|
|
245
|
+
/** @internal */
|
|
246
|
+
export const ChatGenerationParamsPluginAutoRouter$outboundSchema = z.object({
|
|
247
|
+
id: z.literal("auto-router"),
|
|
248
|
+
enabled: z.boolean().optional(),
|
|
249
|
+
allowedModels: z.array(z.string()).optional(),
|
|
250
|
+
}).transform((v) => {
|
|
251
|
+
return remap$(v, {
|
|
252
|
+
allowedModels: "allowed_models",
|
|
253
|
+
});
|
|
125
254
|
});
|
|
126
|
-
export function
|
|
127
|
-
return JSON.stringify(
|
|
255
|
+
export function chatGenerationParamsPluginAutoRouterToJSON(chatGenerationParamsPluginAutoRouter) {
|
|
256
|
+
return JSON.stringify(ChatGenerationParamsPluginAutoRouter$outboundSchema.parse(chatGenerationParamsPluginAutoRouter));
|
|
128
257
|
}
|
|
129
258
|
/** @internal */
|
|
130
|
-
export const
|
|
131
|
-
|
|
259
|
+
export const ChatGenerationParamsPluginUnion$outboundSchema = z.union([
|
|
260
|
+
z.lazy(() => ChatGenerationParamsPluginAutoRouter$outboundSchema),
|
|
261
|
+
z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema),
|
|
262
|
+
z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema),
|
|
263
|
+
z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema),
|
|
264
|
+
z.lazy(() => ChatGenerationParamsPluginResponseHealing$outboundSchema),
|
|
265
|
+
z.lazy(() => ChatGenerationParamsPluginContextCompression$outboundSchema),
|
|
266
|
+
]);
|
|
267
|
+
export function chatGenerationParamsPluginUnionToJSON(chatGenerationParamsPluginUnion) {
|
|
268
|
+
return JSON.stringify(ChatGenerationParamsPluginUnion$outboundSchema.parse(chatGenerationParamsPluginUnion));
|
|
269
|
+
}
|
|
270
|
+
/** @internal */
|
|
271
|
+
export const ChatGenerationParamsTrace$outboundSchema = z.object({
|
|
272
|
+
traceId: z.string().optional(),
|
|
273
|
+
traceName: z.string().optional(),
|
|
274
|
+
spanName: z.string().optional(),
|
|
275
|
+
generationName: z.string().optional(),
|
|
276
|
+
parentSpanId: z.string().optional(),
|
|
277
|
+
additionalProperties: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
278
|
+
}).transform((v) => {
|
|
279
|
+
return {
|
|
280
|
+
...v.additionalProperties,
|
|
281
|
+
...remap$(v, {
|
|
282
|
+
traceId: "trace_id",
|
|
283
|
+
traceName: "trace_name",
|
|
284
|
+
spanName: "span_name",
|
|
285
|
+
generationName: "generation_name",
|
|
286
|
+
parentSpanId: "parent_span_id",
|
|
287
|
+
additionalProperties: null,
|
|
288
|
+
}),
|
|
289
|
+
};
|
|
290
|
+
});
|
|
291
|
+
export function chatGenerationParamsTraceToJSON(chatGenerationParamsTrace) {
|
|
292
|
+
return JSON.stringify(ChatGenerationParamsTrace$outboundSchema.parse(chatGenerationParamsTrace));
|
|
293
|
+
}
|
|
294
|
+
/** @internal */
|
|
295
|
+
export const Effort$outboundSchema = openEnums
|
|
296
|
+
.outboundSchema(Effort);
|
|
297
|
+
/** @internal */
|
|
298
|
+
export const Reasoning$outboundSchema = z.object({
|
|
299
|
+
effort: z.nullable(Effort$outboundSchema).optional(),
|
|
300
|
+
summary: z.nullable(z.any()).optional(),
|
|
132
301
|
});
|
|
133
|
-
export function
|
|
134
|
-
return JSON.stringify(
|
|
302
|
+
export function reasoningToJSON(reasoning) {
|
|
303
|
+
return JSON.stringify(Reasoning$outboundSchema.parse(reasoning));
|
|
135
304
|
}
|
|
136
305
|
/** @internal */
|
|
137
306
|
export const ResponseFormat$outboundSchema = z.union([
|
|
138
|
-
|
|
139
|
-
|
|
307
|
+
ResponseFormatText$outboundSchema,
|
|
308
|
+
ResponseFormatJSONObject$outboundSchema,
|
|
140
309
|
ResponseFormatJSONSchema$outboundSchema,
|
|
141
310
|
ResponseFormatTextGrammar$outboundSchema,
|
|
142
|
-
|
|
311
|
+
ResponseFormatTextPython$outboundSchema,
|
|
143
312
|
]);
|
|
144
313
|
export function responseFormatToJSON(responseFormat) {
|
|
145
314
|
return JSON.stringify(ResponseFormat$outboundSchema.parse(responseFormat));
|
|
@@ -148,23 +317,13 @@ export function responseFormatToJSON(responseFormat) {
|
|
|
148
317
|
export const Stop$outboundSchema = z.union([
|
|
149
318
|
z.string(),
|
|
150
319
|
z.array(z.string()),
|
|
320
|
+
z.any(),
|
|
151
321
|
]);
|
|
152
322
|
export function stopToJSON(stop) {
|
|
153
323
|
return JSON.stringify(Stop$outboundSchema.parse(stop));
|
|
154
324
|
}
|
|
155
325
|
/** @internal */
|
|
156
|
-
export const
|
|
157
|
-
echoUpstreamBody: z.boolean().optional(),
|
|
158
|
-
}).transform((v) => {
|
|
159
|
-
return remap$(v, {
|
|
160
|
-
echoUpstreamBody: "echo_upstream_body",
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
export function debugToJSON(debug) {
|
|
164
|
-
return JSON.stringify(Debug$outboundSchema.parse(debug));
|
|
165
|
-
}
|
|
166
|
-
/** @internal */
|
|
167
|
-
export const ChatGenerationParamsImageConfig$outboundSchema = z.union([z.string(), z.number(), z.array(z.any())]);
|
|
326
|
+
export const ChatGenerationParamsImageConfig$outboundSchema = z.union([z.string(), z.number(), z.array(z.nullable(z.any()))]);
|
|
168
327
|
export function chatGenerationParamsImageConfigToJSON(chatGenerationParamsImageConfig) {
|
|
169
328
|
return JSON.stringify(ChatGenerationParamsImageConfig$outboundSchema.parse(chatGenerationParamsImageConfig));
|
|
170
329
|
}
|
|
@@ -172,12 +331,31 @@ export function chatGenerationParamsImageConfigToJSON(chatGenerationParamsImageC
|
|
|
172
331
|
export const Modality$outboundSchema = openEnums
|
|
173
332
|
.outboundSchema(Modality);
|
|
174
333
|
/** @internal */
|
|
334
|
+
export const ChatGenerationParamsType$outboundSchema = z.enum(ChatGenerationParamsType);
|
|
335
|
+
/** @internal */
|
|
336
|
+
export const ChatGenerationParamsTtl$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsTtl);
|
|
337
|
+
/** @internal */
|
|
338
|
+
export const CacheControl$outboundSchema = z.object({
|
|
339
|
+
type: ChatGenerationParamsType$outboundSchema,
|
|
340
|
+
ttl: ChatGenerationParamsTtl$outboundSchema.optional(),
|
|
341
|
+
});
|
|
342
|
+
export function cacheControlToJSON(cacheControl) {
|
|
343
|
+
return JSON.stringify(CacheControl$outboundSchema.parse(cacheControl));
|
|
344
|
+
}
|
|
345
|
+
/** @internal */
|
|
175
346
|
export const ChatGenerationParams$outboundSchema = z.object({
|
|
176
|
-
provider: z.nullable(z.lazy(() =>
|
|
177
|
-
plugins: z.array(
|
|
178
|
-
|
|
347
|
+
provider: z.nullable(z.lazy(() => ChatGenerationParamsProvider$outboundSchema)).optional(),
|
|
348
|
+
plugins: z.array(z.union([
|
|
349
|
+
z.lazy(() => ChatGenerationParamsPluginAutoRouter$outboundSchema),
|
|
350
|
+
z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema),
|
|
351
|
+
z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema),
|
|
352
|
+
z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema),
|
|
353
|
+
z.lazy(() => ChatGenerationParamsPluginResponseHealing$outboundSchema),
|
|
354
|
+
z.lazy(() => ChatGenerationParamsPluginContextCompression$outboundSchema),
|
|
355
|
+
])).optional(),
|
|
179
356
|
user: z.string().optional(),
|
|
180
357
|
sessionId: z.string().optional(),
|
|
358
|
+
trace: z.lazy(() => ChatGenerationParamsTrace$outboundSchema).optional(),
|
|
181
359
|
messages: z.array(Message$outboundSchema),
|
|
182
360
|
model: z.string().optional(),
|
|
183
361
|
models: z.array(z.string()).optional(),
|
|
@@ -191,23 +369,26 @@ export const ChatGenerationParams$outboundSchema = z.object({
|
|
|
191
369
|
presencePenalty: z.nullable(z.number()).optional(),
|
|
192
370
|
reasoning: z.lazy(() => Reasoning$outboundSchema).optional(),
|
|
193
371
|
responseFormat: z.union([
|
|
194
|
-
|
|
195
|
-
|
|
372
|
+
ResponseFormatText$outboundSchema,
|
|
373
|
+
ResponseFormatJSONObject$outboundSchema,
|
|
196
374
|
ResponseFormatJSONSchema$outboundSchema,
|
|
197
375
|
ResponseFormatTextGrammar$outboundSchema,
|
|
198
|
-
|
|
376
|
+
ResponseFormatTextPython$outboundSchema,
|
|
199
377
|
]).optional(),
|
|
200
378
|
seed: z.nullable(z.int()).optional(),
|
|
201
|
-
stop: z.nullable(z.union([z.string(), z.array(z.string())]))
|
|
379
|
+
stop: z.nullable(z.union([z.string(), z.array(z.string()), z.any()]))
|
|
380
|
+
.optional(),
|
|
202
381
|
stream: z.boolean().default(false),
|
|
203
382
|
streamOptions: z.nullable(ChatStreamOptions$outboundSchema).optional(),
|
|
204
|
-
temperature: z.nullable(z.number()
|
|
205
|
-
|
|
383
|
+
temperature: z.nullable(z.number().default(1)),
|
|
384
|
+
parallelToolCalls: z.nullable(z.boolean()).optional(),
|
|
385
|
+
toolChoice: ToolChoiceOption$outboundSchema.optional(),
|
|
206
386
|
tools: z.array(ToolDefinitionJson$outboundSchema).optional(),
|
|
207
|
-
topP: z.nullable(z.number()
|
|
208
|
-
debug:
|
|
209
|
-
imageConfig: z.record(z.string(), z.union([z.string(), z.number(), z.array(z.any())])).optional(),
|
|
387
|
+
topP: z.nullable(z.number().default(1)),
|
|
388
|
+
debug: DebugOptions$outboundSchema.optional(),
|
|
389
|
+
imageConfig: z.record(z.string(), z.union([z.string(), z.number(), z.array(z.nullable(z.any()))])).optional(),
|
|
210
390
|
modalities: z.array(Modality$outboundSchema).optional(),
|
|
391
|
+
cacheControl: z.lazy(() => CacheControl$outboundSchema).optional(),
|
|
211
392
|
}).transform((v) => {
|
|
212
393
|
return remap$(v, {
|
|
213
394
|
sessionId: "session_id",
|
|
@@ -219,9 +400,11 @@ export const ChatGenerationParams$outboundSchema = z.object({
|
|
|
219
400
|
presencePenalty: "presence_penalty",
|
|
220
401
|
responseFormat: "response_format",
|
|
221
402
|
streamOptions: "stream_options",
|
|
403
|
+
parallelToolCalls: "parallel_tool_calls",
|
|
222
404
|
toolChoice: "tool_choice",
|
|
223
405
|
topP: "top_p",
|
|
224
406
|
imageConfig: "image_config",
|
|
407
|
+
cacheControl: "cache_control",
|
|
225
408
|
});
|
|
226
409
|
});
|
|
227
410
|
export function chatGenerationParamsToJSON(chatGenerationParams) {
|
|
@@ -1,23 +1,71 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Detailed completion token usage
|
|
6
|
+
*/
|
|
4
7
|
export type CompletionTokensDetails = {
|
|
8
|
+
/**
|
|
9
|
+
* Tokens used for reasoning
|
|
10
|
+
*/
|
|
5
11
|
reasoningTokens?: number | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Tokens used for audio output
|
|
14
|
+
*/
|
|
6
15
|
audioTokens?: number | null | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Accepted prediction tokens
|
|
18
|
+
*/
|
|
7
19
|
acceptedPredictionTokens?: number | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Rejected prediction tokens
|
|
22
|
+
*/
|
|
8
23
|
rejectedPredictionTokens?: number | null | undefined;
|
|
9
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Detailed prompt token usage
|
|
27
|
+
*/
|
|
10
28
|
export type PromptTokensDetails = {
|
|
29
|
+
/**
|
|
30
|
+
* Cached prompt tokens
|
|
31
|
+
*/
|
|
11
32
|
cachedTokens?: number | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Tokens written to cache. Only returned for models with explicit caching and cache write pricing.
|
|
35
|
+
*/
|
|
12
36
|
cacheWriteTokens?: number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Audio input tokens
|
|
39
|
+
*/
|
|
13
40
|
audioTokens?: number | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Video input tokens
|
|
43
|
+
*/
|
|
14
44
|
videoTokens?: number | undefined;
|
|
15
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Token usage statistics
|
|
48
|
+
*/
|
|
16
49
|
export type ChatGenerationTokenUsage = {
|
|
50
|
+
/**
|
|
51
|
+
* Number of tokens in the completion
|
|
52
|
+
*/
|
|
17
53
|
completionTokens: number;
|
|
54
|
+
/**
|
|
55
|
+
* Number of tokens in the prompt
|
|
56
|
+
*/
|
|
18
57
|
promptTokens: number;
|
|
58
|
+
/**
|
|
59
|
+
* Total number of tokens
|
|
60
|
+
*/
|
|
19
61
|
totalTokens: number;
|
|
62
|
+
/**
|
|
63
|
+
* Detailed completion token usage
|
|
64
|
+
*/
|
|
20
65
|
completionTokensDetails?: CompletionTokensDetails | null | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Detailed prompt token usage
|
|
68
|
+
*/
|
|
21
69
|
promptTokensDetails?: PromptTokensDetails | null | undefined;
|
|
22
70
|
};
|
|
23
71
|
/** @internal */
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { ChatMessageContentItemAudio, ChatMessageContentItemAudio$Outbound } from "./chatmessagecontentitemaudio.js";
|
|
4
|
+
import { ChatMessageContentItemFile, ChatMessageContentItemFile$Outbound } from "./chatmessagecontentitemfile.js";
|
|
4
5
|
import { ChatMessageContentItemImage, ChatMessageContentItemImage$Outbound } from "./chatmessagecontentitemimage.js";
|
|
5
6
|
import { ChatMessageContentItemText, ChatMessageContentItemText$Outbound } from "./chatmessagecontentitemtext.js";
|
|
6
7
|
import { ChatMessageContentItemVideo, ChatMessageContentItemVideo$Outbound } from "./chatmessagecontentitemvideo.js";
|
|
8
|
+
import { ChatMessageContentItemVideoLegacy, ChatMessageContentItemVideoLegacy$Outbound } from "./chatmessagecontentitemvideolegacy.js";
|
|
7
9
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
8
|
-
export type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export type ChatMessageContentItem1 = ChatMessageContentItemVideoLegacy | ChatMessageContentItemVideo;
|
|
11
|
+
/**
|
|
12
|
+
* Content part for chat completion messages
|
|
13
|
+
*/
|
|
14
|
+
export type ChatMessageContentItem = ChatMessageContentItemText | ChatMessageContentItemImage | ChatMessageContentItemAudio | ChatMessageContentItemFile | ChatMessageContentItemVideoLegacy | ChatMessageContentItemVideo;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const ChatMessageContentItem1$inboundSchema: z.ZodType<ChatMessageContentItem1, unknown>;
|
|
17
|
+
/** @internal */
|
|
18
|
+
export type ChatMessageContentItem1$Outbound = ChatMessageContentItemVideoLegacy$Outbound | ChatMessageContentItemVideo$Outbound;
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const ChatMessageContentItem1$outboundSchema: z.ZodType<ChatMessageContentItem1$Outbound, ChatMessageContentItem1>;
|
|
21
|
+
export declare function chatMessageContentItem1ToJSON(chatMessageContentItem1: ChatMessageContentItem1): string;
|
|
22
|
+
export declare function chatMessageContentItem1FromJSON(jsonString: string): SafeParseResult<ChatMessageContentItem1, SDKValidationError>;
|
|
13
23
|
/** @internal */
|
|
14
24
|
export declare const ChatMessageContentItem$inboundSchema: z.ZodType<ChatMessageContentItem, unknown>;
|
|
15
25
|
/** @internal */
|
|
16
|
-
export type ChatMessageContentItem$Outbound = ChatMessageContentItemText$Outbound | ChatMessageContentItemImage$Outbound | ChatMessageContentItemAudio$Outbound |
|
|
17
|
-
type: "input_video";
|
|
18
|
-
}) | (ChatMessageContentItemVideo$Outbound & {
|
|
19
|
-
type: "video_url";
|
|
20
|
-
});
|
|
26
|
+
export type ChatMessageContentItem$Outbound = ChatMessageContentItemText$Outbound | ChatMessageContentItemImage$Outbound | ChatMessageContentItemAudio$Outbound | ChatMessageContentItemFile$Outbound | ChatMessageContentItemVideoLegacy$Outbound | ChatMessageContentItemVideo$Outbound;
|
|
21
27
|
/** @internal */
|
|
22
28
|
export declare const ChatMessageContentItem$outboundSchema: z.ZodType<ChatMessageContentItem$Outbound, ChatMessageContentItem>;
|
|
23
29
|
export declare function chatMessageContentItemToJSON(chatMessageContentItem: ChatMessageContentItem): string;
|
|
@@ -5,24 +5,48 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { ChatMessageContentItemAudio$inboundSchema, ChatMessageContentItemAudio$outboundSchema, } from "./chatmessagecontentitemaudio.js";
|
|
8
|
+
import { ChatMessageContentItemFile$inboundSchema, ChatMessageContentItemFile$outboundSchema, } from "./chatmessagecontentitemfile.js";
|
|
8
9
|
import { ChatMessageContentItemImage$inboundSchema, ChatMessageContentItemImage$outboundSchema, } from "./chatmessagecontentitemimage.js";
|
|
9
10
|
import { ChatMessageContentItemText$inboundSchema, ChatMessageContentItemText$outboundSchema, } from "./chatmessagecontentitemtext.js";
|
|
10
11
|
import { ChatMessageContentItemVideo$inboundSchema, ChatMessageContentItemVideo$outboundSchema, } from "./chatmessagecontentitemvideo.js";
|
|
12
|
+
import { ChatMessageContentItemVideoLegacy$inboundSchema, ChatMessageContentItemVideoLegacy$outboundSchema, } from "./chatmessagecontentitemvideolegacy.js";
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const ChatMessageContentItem1$inboundSchema = z.union([
|
|
15
|
+
ChatMessageContentItemVideoLegacy$inboundSchema,
|
|
16
|
+
ChatMessageContentItemVideo$inboundSchema,
|
|
17
|
+
]);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const ChatMessageContentItem1$outboundSchema = z.union([
|
|
20
|
+
ChatMessageContentItemVideoLegacy$outboundSchema,
|
|
21
|
+
ChatMessageContentItemVideo$outboundSchema,
|
|
22
|
+
]);
|
|
23
|
+
export function chatMessageContentItem1ToJSON(chatMessageContentItem1) {
|
|
24
|
+
return JSON.stringify(ChatMessageContentItem1$outboundSchema.parse(chatMessageContentItem1));
|
|
25
|
+
}
|
|
26
|
+
export function chatMessageContentItem1FromJSON(jsonString) {
|
|
27
|
+
return safeParse(jsonString, (x) => ChatMessageContentItem1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatMessageContentItem1' from JSON`);
|
|
28
|
+
}
|
|
11
29
|
/** @internal */
|
|
12
30
|
export const ChatMessageContentItem$inboundSchema = z.union([
|
|
13
31
|
ChatMessageContentItemText$inboundSchema,
|
|
14
32
|
ChatMessageContentItemImage$inboundSchema,
|
|
15
33
|
ChatMessageContentItemAudio$inboundSchema,
|
|
16
|
-
|
|
17
|
-
z.
|
|
34
|
+
ChatMessageContentItemFile$inboundSchema,
|
|
35
|
+
z.union([
|
|
36
|
+
ChatMessageContentItemVideoLegacy$inboundSchema,
|
|
37
|
+
ChatMessageContentItemVideo$inboundSchema,
|
|
38
|
+
]),
|
|
18
39
|
]);
|
|
19
40
|
/** @internal */
|
|
20
41
|
export const ChatMessageContentItem$outboundSchema = z.union([
|
|
21
42
|
ChatMessageContentItemText$outboundSchema,
|
|
22
43
|
ChatMessageContentItemImage$outboundSchema,
|
|
23
44
|
ChatMessageContentItemAudio$outboundSchema,
|
|
24
|
-
|
|
25
|
-
z.
|
|
45
|
+
ChatMessageContentItemFile$outboundSchema,
|
|
46
|
+
z.union([
|
|
47
|
+
ChatMessageContentItemVideoLegacy$outboundSchema,
|
|
48
|
+
ChatMessageContentItemVideo$outboundSchema,
|
|
49
|
+
]),
|
|
26
50
|
]);
|
|
27
51
|
export function chatMessageContentItemToJSON(chatMessageContentItem) {
|
|
28
52
|
return JSON.stringify(ChatMessageContentItem$outboundSchema.parse(chatMessageContentItem));
|