@openrouter/sdk 0.0.0-beta.38 → 0.0.0-beta.39
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/dist/commonjs/funcs/betaResponsesSend.js +1 -1
- package/dist/commonjs/funcs/betaResponsesSend.js.map +1 -1
- package/dist/commonjs/funcs/chatSend.js +1 -1
- package/dist/commonjs/funcs/chatSend.js.map +1 -1
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.d.ts +43 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.d.ts.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.js +50 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.js.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.test.d.ts +2 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.test.d.ts.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.test.js +213 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.test.js.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.d.ts +35 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.d.ts.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.js +75 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.js.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.test.d.ts +2 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.test.d.ts.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.test.js +164 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.test.js.map +1 -0
- package/dist/commonjs/funcs/modelsList.js +1 -1
- package/dist/commonjs/funcs/modelsList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/models/chatgenerationparams.d.ts +16 -42
- package/dist/commonjs/models/chatgenerationparams.d.ts.map +1 -1
- package/dist/commonjs/models/chatgenerationparams.js +27 -6
- package/dist/commonjs/models/chatgenerationparams.js.map +1 -1
- package/dist/commonjs/models/chatmessagecontentitemaudio.d.ts +6 -22
- package/dist/commonjs/models/chatmessagecontentitemaudio.d.ts.map +1 -1
- package/dist/commonjs/models/chatmessagecontentitemaudio.js +10 -2
- package/dist/commonjs/models/chatmessagecontentitemaudio.js.map +1 -1
- package/dist/commonjs/models/chatmessagecontentitemimage.d.ts +6 -14
- package/dist/commonjs/models/chatmessagecontentitemimage.d.ts.map +1 -1
- package/dist/commonjs/models/chatmessagecontentitemimage.js +10 -2
- package/dist/commonjs/models/chatmessagecontentitemimage.js.map +1 -1
- package/dist/commonjs/models/chatresponsechoice.d.ts +6 -18
- package/dist/commonjs/models/chatresponsechoice.d.ts.map +1 -1
- package/dist/commonjs/models/chatresponsechoice.js +10 -2
- package/dist/commonjs/models/chatresponsechoice.js.map +1 -1
- package/dist/commonjs/models/chatstreamingchoice.d.ts +6 -18
- package/dist/commonjs/models/chatstreamingchoice.d.ts.map +1 -1
- package/dist/commonjs/models/chatstreamingchoice.js +10 -2
- package/dist/commonjs/models/chatstreamingchoice.js.map +1 -1
- package/dist/commonjs/models/completionfinishreason.d.ts +6 -14
- package/dist/commonjs/models/completionfinishreason.d.ts.map +1 -1
- package/dist/commonjs/models/completionfinishreason.js +10 -2
- package/dist/commonjs/models/completionfinishreason.js.map +1 -1
- package/dist/commonjs/models/endpointslist.d.ts +21 -269
- package/dist/commonjs/models/endpointslist.d.ts.map +1 -1
- package/dist/commonjs/models/endpointslist.js +37 -8
- package/dist/commonjs/models/endpointslist.js.map +1 -1
- package/dist/commonjs/models/errorresponse.d.ts +6 -148
- package/dist/commonjs/models/errorresponse.d.ts.map +1 -1
- package/dist/commonjs/models/errorresponse.js +10 -2
- package/dist/commonjs/models/errorresponse.js.map +1 -1
- package/dist/commonjs/models/modelslist.d.ts +26 -178
- package/dist/commonjs/models/modelslist.d.ts.map +1 -1
- package/dist/commonjs/models/modelslist.js +46 -11
- package/dist/commonjs/models/modelslist.js.map +1 -1
- package/dist/commonjs/models/operations/addcoinbasecharge.d.ts +6 -14
- package/dist/commonjs/models/operations/addcoinbasecharge.d.ts.map +1 -1
- package/dist/commonjs/models/operations/addcoinbasecharge.js +9 -2
- package/dist/commonjs/models/operations/addcoinbasecharge.js.map +1 -1
- package/dist/commonjs/models/operations/create.d.ts +6 -14
- package/dist/commonjs/models/operations/create.d.ts.map +1 -1
- package/dist/commonjs/models/operations/create.js +10 -2
- package/dist/commonjs/models/operations/create.js.map +1 -1
- package/dist/commonjs/models/operations/createauthorizationcode.d.ts +6 -12
- package/dist/commonjs/models/operations/createauthorizationcode.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createauthorizationcode.js +9 -2
- package/dist/commonjs/models/operations/createauthorizationcode.js.map +1 -1
- package/dist/commonjs/models/operations/exchangeauthorizationcode.d.ts +6 -12
- package/dist/commonjs/models/operations/exchangeauthorizationcode.d.ts.map +1 -1
- package/dist/commonjs/models/operations/exchangeauthorizationcode.js +9 -2
- package/dist/commonjs/models/operations/exchangeauthorizationcode.js.map +1 -1
- package/dist/commonjs/models/operations/generate.d.ts +37 -569
- package/dist/commonjs/models/operations/generate.d.ts.map +1 -1
- package/dist/commonjs/models/operations/generate.js +55 -12
- package/dist/commonjs/models/operations/generate.js.map +1 -1
- package/dist/commonjs/models/operations/getmetadata.d.ts +6 -12
- package/dist/commonjs/models/operations/getmetadata.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getmetadata.js +9 -2
- package/dist/commonjs/models/operations/getmetadata.js.map +1 -1
- package/dist/commonjs/models/operations/getparameters.d.ts +11 -189
- package/dist/commonjs/models/operations/getparameters.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getparameters.js +19 -4
- package/dist/commonjs/models/operations/getparameters.js.map +1 -1
- package/dist/commonjs/models/operations/list.d.ts +21 -125
- package/dist/commonjs/models/operations/list.d.ts.map +1 -1
- package/dist/commonjs/models/operations/list.js +36 -8
- package/dist/commonjs/models/operations/list.js.map +1 -1
- package/dist/commonjs/models/operations/previewzdr.d.ts +21 -269
- package/dist/commonjs/models/operations/previewzdr.d.ts.map +1 -1
- package/dist/commonjs/models/operations/previewzdr.js +38 -9
- package/dist/commonjs/models/operations/previewzdr.js.map +1 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.d.ts +57 -621
- package/dist/commonjs/models/operations/sendresponsesrequest.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.js +88 -20
- package/dist/commonjs/models/operations/sendresponsesrequest.js.map +1 -1
- package/dist/commonjs/models/operations/update.d.ts +6 -14
- package/dist/commonjs/models/operations/update.d.ts.map +1 -1
- package/dist/commonjs/models/operations/update.js +10 -2
- package/dist/commonjs/models/operations/update.js.map +1 -1
- package/dist/commonjs/models/responsefunctioncallstatus.d.ts +6 -14
- package/dist/commonjs/models/responsefunctioncallstatus.d.ts.map +1 -1
- package/dist/commonjs/models/responsefunctioncallstatus.js +10 -2
- package/dist/commonjs/models/responsefunctioncallstatus.js.map +1 -1
- package/dist/commonjs/models/responseimagegenerationcallstatus.d.ts +6 -16
- package/dist/commonjs/models/responseimagegenerationcallstatus.d.ts.map +1 -1
- package/dist/commonjs/models/responseimagegenerationcallstatus.js +10 -2
- package/dist/commonjs/models/responseimagegenerationcallstatus.js.map +1 -1
- package/dist/commonjs/models/responseincludable.d.ts +6 -18
- package/dist/commonjs/models/responseincludable.d.ts.map +1 -1
- package/dist/commonjs/models/responseincludable.js +10 -2
- package/dist/commonjs/models/responseincludable.js.map +1 -1
- package/dist/commonjs/models/responseinputimagedetail.d.ts +6 -14
- package/dist/commonjs/models/responseinputimagedetail.d.ts.map +1 -1
- package/dist/commonjs/models/responseinputimagedetail.js +10 -2
- package/dist/commonjs/models/responseinputimagedetail.js.map +1 -1
- package/dist/commonjs/models/responsereasoningconfig.d.ts +6 -16
- package/dist/commonjs/models/responsereasoningconfig.d.ts.map +1 -1
- package/dist/commonjs/models/responsereasoningconfig.js +10 -2
- package/dist/commonjs/models/responsereasoningconfig.js.map +1 -1
- package/dist/commonjs/models/responsereasoningsummarymode.d.ts +6 -14
- package/dist/commonjs/models/responsereasoningsummarymode.d.ts.map +1 -1
- package/dist/commonjs/models/responsereasoningsummarymode.js +10 -2
- package/dist/commonjs/models/responsereasoningsummarymode.js.map +1 -1
- package/dist/commonjs/models/responsesincompletedetails.d.ts +6 -12
- package/dist/commonjs/models/responsesincompletedetails.d.ts.map +1 -1
- package/dist/commonjs/models/responsesincompletedetails.js +10 -2
- package/dist/commonjs/models/responsesincompletedetails.js.map +1 -1
- package/dist/commonjs/models/responsesnonstreamingresponse.d.ts +21 -61
- package/dist/commonjs/models/responsesnonstreamingresponse.d.ts.map +1 -1
- package/dist/commonjs/models/responsesnonstreamingresponse.js +35 -8
- package/dist/commonjs/models/responsesnonstreamingresponse.js.map +1 -1
- package/dist/commonjs/models/responsesoutputitemfilesearchcall.d.ts +6 -16
- package/dist/commonjs/models/responsesoutputitemfilesearchcall.d.ts.map +1 -1
- package/dist/commonjs/models/responsesoutputitemfilesearchcall.js +9 -2
- package/dist/commonjs/models/responsesoutputitemfilesearchcall.js.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts +6 -16
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.js +10 -2
- package/dist/commonjs/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/commonjs/models/responsesstreamchunkunion.d.ts +31 -81
- package/dist/commonjs/models/responsesstreamchunkunion.d.ts.map +1 -1
- package/dist/commonjs/models/responsesstreamchunkunion.js +55 -12
- package/dist/commonjs/models/responsesstreamchunkunion.js.map +1 -1
- package/dist/commonjs/models/responseswebsearchcalloutput.d.ts +6 -16
- package/dist/commonjs/models/responseswebsearchcalloutput.d.ts.map +1 -1
- package/dist/commonjs/models/responseswebsearchcalloutput.js +10 -2
- package/dist/commonjs/models/responseswebsearchcalloutput.js.map +1 -1
- package/dist/commonjs/models/responsetextverbosity.d.ts +6 -14
- package/dist/commonjs/models/responsetextverbosity.d.ts.map +1 -1
- package/dist/commonjs/models/responsetextverbosity.js +10 -2
- package/dist/commonjs/models/responsetextverbosity.js.map +1 -1
- package/dist/commonjs/sdk/oauth.d.ts +27 -0
- package/dist/commonjs/sdk/oauth.d.ts.map +1 -1
- package/dist/commonjs/sdk/oauth.js +43 -0
- package/dist/commonjs/sdk/oauth.js.map +1 -1
- package/dist/esm/funcs/betaResponsesSend.js +1 -1
- package/dist/esm/funcs/betaResponsesSend.js.map +1 -1
- package/dist/esm/funcs/chatSend.js +1 -1
- package/dist/esm/funcs/chatSend.js.map +1 -1
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.d.ts +43 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.d.ts.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.js +44 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.js.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.test.d.ts +2 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.test.d.ts.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.test.js +211 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.test.js.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.d.ts +35 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.d.ts.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.js +69 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.js.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.test.d.ts +2 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.test.d.ts.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.test.js +162 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.test.js.map +1 -0
- package/dist/esm/funcs/modelsList.js +1 -1
- package/dist/esm/funcs/modelsList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/models/chatgenerationparams.d.ts +16 -42
- package/dist/esm/models/chatgenerationparams.d.ts.map +1 -1
- package/dist/esm/models/chatgenerationparams.js +27 -6
- package/dist/esm/models/chatgenerationparams.js.map +1 -1
- package/dist/esm/models/chatmessagecontentitemaudio.d.ts +6 -22
- package/dist/esm/models/chatmessagecontentitemaudio.d.ts.map +1 -1
- package/dist/esm/models/chatmessagecontentitemaudio.js +10 -2
- package/dist/esm/models/chatmessagecontentitemaudio.js.map +1 -1
- package/dist/esm/models/chatmessagecontentitemimage.d.ts +6 -14
- package/dist/esm/models/chatmessagecontentitemimage.d.ts.map +1 -1
- package/dist/esm/models/chatmessagecontentitemimage.js +10 -2
- package/dist/esm/models/chatmessagecontentitemimage.js.map +1 -1
- package/dist/esm/models/chatresponsechoice.d.ts +6 -18
- package/dist/esm/models/chatresponsechoice.d.ts.map +1 -1
- package/dist/esm/models/chatresponsechoice.js +10 -2
- package/dist/esm/models/chatresponsechoice.js.map +1 -1
- package/dist/esm/models/chatstreamingchoice.d.ts +6 -18
- package/dist/esm/models/chatstreamingchoice.d.ts.map +1 -1
- package/dist/esm/models/chatstreamingchoice.js +10 -2
- package/dist/esm/models/chatstreamingchoice.js.map +1 -1
- package/dist/esm/models/completionfinishreason.d.ts +6 -14
- package/dist/esm/models/completionfinishreason.d.ts.map +1 -1
- package/dist/esm/models/completionfinishreason.js +10 -2
- package/dist/esm/models/completionfinishreason.js.map +1 -1
- package/dist/esm/models/endpointslist.d.ts +21 -269
- package/dist/esm/models/endpointslist.d.ts.map +1 -1
- package/dist/esm/models/endpointslist.js +37 -8
- package/dist/esm/models/endpointslist.js.map +1 -1
- package/dist/esm/models/errorresponse.d.ts +6 -148
- package/dist/esm/models/errorresponse.d.ts.map +1 -1
- package/dist/esm/models/errorresponse.js +10 -2
- package/dist/esm/models/errorresponse.js.map +1 -1
- package/dist/esm/models/modelslist.d.ts +26 -178
- package/dist/esm/models/modelslist.d.ts.map +1 -1
- package/dist/esm/models/modelslist.js +46 -11
- package/dist/esm/models/modelslist.js.map +1 -1
- package/dist/esm/models/operations/addcoinbasecharge.d.ts +6 -14
- package/dist/esm/models/operations/addcoinbasecharge.d.ts.map +1 -1
- package/dist/esm/models/operations/addcoinbasecharge.js +9 -2
- package/dist/esm/models/operations/addcoinbasecharge.js.map +1 -1
- package/dist/esm/models/operations/create.d.ts +6 -14
- package/dist/esm/models/operations/create.d.ts.map +1 -1
- package/dist/esm/models/operations/create.js +10 -2
- package/dist/esm/models/operations/create.js.map +1 -1
- package/dist/esm/models/operations/createauthorizationcode.d.ts +6 -12
- package/dist/esm/models/operations/createauthorizationcode.d.ts.map +1 -1
- package/dist/esm/models/operations/createauthorizationcode.js +9 -2
- package/dist/esm/models/operations/createauthorizationcode.js.map +1 -1
- package/dist/esm/models/operations/exchangeauthorizationcode.d.ts +6 -12
- package/dist/esm/models/operations/exchangeauthorizationcode.d.ts.map +1 -1
- package/dist/esm/models/operations/exchangeauthorizationcode.js +9 -2
- package/dist/esm/models/operations/exchangeauthorizationcode.js.map +1 -1
- package/dist/esm/models/operations/generate.d.ts +37 -569
- package/dist/esm/models/operations/generate.d.ts.map +1 -1
- package/dist/esm/models/operations/generate.js +55 -12
- package/dist/esm/models/operations/generate.js.map +1 -1
- package/dist/esm/models/operations/getmetadata.d.ts +6 -12
- package/dist/esm/models/operations/getmetadata.d.ts.map +1 -1
- package/dist/esm/models/operations/getmetadata.js +9 -2
- package/dist/esm/models/operations/getmetadata.js.map +1 -1
- package/dist/esm/models/operations/getparameters.d.ts +11 -189
- package/dist/esm/models/operations/getparameters.d.ts.map +1 -1
- package/dist/esm/models/operations/getparameters.js +19 -4
- package/dist/esm/models/operations/getparameters.js.map +1 -1
- package/dist/esm/models/operations/list.d.ts +21 -125
- package/dist/esm/models/operations/list.d.ts.map +1 -1
- package/dist/esm/models/operations/list.js +36 -8
- package/dist/esm/models/operations/list.js.map +1 -1
- package/dist/esm/models/operations/previewzdr.d.ts +21 -269
- package/dist/esm/models/operations/previewzdr.d.ts.map +1 -1
- package/dist/esm/models/operations/previewzdr.js +38 -9
- package/dist/esm/models/operations/previewzdr.js.map +1 -1
- package/dist/esm/models/operations/sendresponsesrequest.d.ts +57 -621
- package/dist/esm/models/operations/sendresponsesrequest.d.ts.map +1 -1
- package/dist/esm/models/operations/sendresponsesrequest.js +88 -20
- package/dist/esm/models/operations/sendresponsesrequest.js.map +1 -1
- package/dist/esm/models/operations/update.d.ts +6 -14
- package/dist/esm/models/operations/update.d.ts.map +1 -1
- package/dist/esm/models/operations/update.js +10 -2
- package/dist/esm/models/operations/update.js.map +1 -1
- package/dist/esm/models/responsefunctioncallstatus.d.ts +6 -14
- package/dist/esm/models/responsefunctioncallstatus.d.ts.map +1 -1
- package/dist/esm/models/responsefunctioncallstatus.js +10 -2
- package/dist/esm/models/responsefunctioncallstatus.js.map +1 -1
- package/dist/esm/models/responseimagegenerationcallstatus.d.ts +6 -16
- package/dist/esm/models/responseimagegenerationcallstatus.d.ts.map +1 -1
- package/dist/esm/models/responseimagegenerationcallstatus.js +10 -2
- package/dist/esm/models/responseimagegenerationcallstatus.js.map +1 -1
- package/dist/esm/models/responseincludable.d.ts +6 -18
- package/dist/esm/models/responseincludable.d.ts.map +1 -1
- package/dist/esm/models/responseincludable.js +10 -2
- package/dist/esm/models/responseincludable.js.map +1 -1
- package/dist/esm/models/responseinputimagedetail.d.ts +6 -14
- package/dist/esm/models/responseinputimagedetail.d.ts.map +1 -1
- package/dist/esm/models/responseinputimagedetail.js +10 -2
- package/dist/esm/models/responseinputimagedetail.js.map +1 -1
- package/dist/esm/models/responsereasoningconfig.d.ts +6 -16
- package/dist/esm/models/responsereasoningconfig.d.ts.map +1 -1
- package/dist/esm/models/responsereasoningconfig.js +10 -2
- package/dist/esm/models/responsereasoningconfig.js.map +1 -1
- package/dist/esm/models/responsereasoningsummarymode.d.ts +6 -14
- package/dist/esm/models/responsereasoningsummarymode.d.ts.map +1 -1
- package/dist/esm/models/responsereasoningsummarymode.js +10 -2
- package/dist/esm/models/responsereasoningsummarymode.js.map +1 -1
- package/dist/esm/models/responsesincompletedetails.d.ts +6 -12
- package/dist/esm/models/responsesincompletedetails.d.ts.map +1 -1
- package/dist/esm/models/responsesincompletedetails.js +10 -2
- package/dist/esm/models/responsesincompletedetails.js.map +1 -1
- package/dist/esm/models/responsesnonstreamingresponse.d.ts +21 -61
- package/dist/esm/models/responsesnonstreamingresponse.d.ts.map +1 -1
- package/dist/esm/models/responsesnonstreamingresponse.js +35 -8
- package/dist/esm/models/responsesnonstreamingresponse.js.map +1 -1
- package/dist/esm/models/responsesoutputitemfilesearchcall.d.ts +6 -16
- package/dist/esm/models/responsesoutputitemfilesearchcall.d.ts.map +1 -1
- package/dist/esm/models/responsesoutputitemfilesearchcall.js +9 -2
- package/dist/esm/models/responsesoutputitemfilesearchcall.js.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.d.ts +6 -16
- package/dist/esm/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.js +10 -2
- package/dist/esm/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/esm/models/responsesstreamchunkunion.d.ts +31 -81
- package/dist/esm/models/responsesstreamchunkunion.d.ts.map +1 -1
- package/dist/esm/models/responsesstreamchunkunion.js +55 -12
- package/dist/esm/models/responsesstreamchunkunion.js.map +1 -1
- package/dist/esm/models/responseswebsearchcalloutput.d.ts +6 -16
- package/dist/esm/models/responseswebsearchcalloutput.d.ts.map +1 -1
- package/dist/esm/models/responseswebsearchcalloutput.js +10 -2
- package/dist/esm/models/responseswebsearchcalloutput.js.map +1 -1
- package/dist/esm/models/responsetextverbosity.d.ts +6 -14
- package/dist/esm/models/responsetextverbosity.d.ts.map +1 -1
- package/dist/esm/models/responsetextverbosity.js +10 -2
- package/dist/esm/models/responsetextverbosity.js.map +1 -1
- package/dist/esm/sdk/oauth.d.ts +27 -0
- package/dist/esm/sdk/oauth.d.ts.map +1 -1
- package/dist/esm/sdk/oauth.js +43 -0
- package/dist/esm/sdk/oauth.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +3 -2
- package/src/funcs/betaResponsesSend.ts +1 -1
- package/src/funcs/chatSend.ts +1 -1
- package/src/funcs/custom/oAuthCreateAuthorizationUrl.test.ts +265 -0
- package/src/funcs/custom/oAuthCreateAuthorizationUrl.ts +66 -0
- package/src/funcs/custom/oAuthCreateSHA256CodeChallenge.test.ts +189 -0
- package/src/funcs/custom/oAuthCreateSHA256CodeChallenge.ts +90 -0
- package/src/funcs/modelsList.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/chatgenerationparams.ts +59 -20
- package/src/models/chatmessagecontentitemaudio.ts +23 -8
- package/src/models/chatmessagecontentitemimage.ts +16 -6
- package/src/models/chatresponsechoice.ts +23 -8
- package/src/models/chatstreamingchoice.ts +23 -8
- package/src/models/completionfinishreason.ts +23 -8
- package/src/models/endpointslist.ts +77 -25
- package/src/models/errorresponse.ts +23 -8
- package/src/models/modelslist.ts +95 -32
- package/src/models/operations/addcoinbasecharge.ts +17 -6
- package/src/models/operations/create.ts +23 -8
- package/src/models/operations/createauthorizationcode.ts +20 -6
- package/src/models/operations/exchangeauthorizationcode.ts +23 -6
- package/src/models/operations/generate.ts +114 -41
- package/src/models/operations/getmetadata.ts +17 -6
- package/src/models/operations/getparameters.ts +41 -15
- package/src/models/operations/list.ts +77 -25
- package/src/models/operations/previewzdr.ts +70 -25
- package/src/models/operations/sendresponsesrequest.ts +179 -63
- package/src/models/operations/update.ts +23 -8
- package/src/models/responsefunctioncallstatus.ts +23 -8
- package/src/models/responseimagegenerationcallstatus.ts +23 -8
- package/src/models/responseincludable.ts +23 -8
- package/src/models/responseinputimagedetail.ts +23 -8
- package/src/models/responsereasoningconfig.ts +23 -8
- package/src/models/responsereasoningsummarymode.ts +23 -8
- package/src/models/responsesincompletedetails.ts +23 -8
- package/src/models/responsesnonstreamingresponse.ts +78 -25
- package/src/models/responsesoutputitemfilesearchcall.ts +24 -8
- package/src/models/responsesoutputitemreasoning.ts +24 -8
- package/src/models/responsesstreamchunkunion.ts +114 -43
- package/src/models/responseswebsearchcalloutput.ts +24 -8
- package/src/models/responsetextverbosity.ts +23 -8
- package/src/sdk/oauth.ts +60 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { oAuthCreateSHA256CodeChallenge } from "./oAuthCreateSHA256CodeChallenge.js";
|
|
3
|
+
|
|
4
|
+
describe("oAuthCreateSHA256CodeChallenge", () => {
|
|
5
|
+
it("should generate code challenge from provided code verifier", async () => {
|
|
6
|
+
// Use RFC 7636 compliant verifier (43 chars minimum)
|
|
7
|
+
const codeVerifier = "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk";
|
|
8
|
+
const result = await oAuthCreateSHA256CodeChallenge({ codeVerifier });
|
|
9
|
+
|
|
10
|
+
expect(result.ok).toBe(true);
|
|
11
|
+
if (result.ok) {
|
|
12
|
+
expect(result.value.codeVerifier).toBe(codeVerifier);
|
|
13
|
+
expect(result.value.codeChallenge).toBeTruthy();
|
|
14
|
+
expect(typeof result.value.codeChallenge).toBe("string");
|
|
15
|
+
// Code challenge should be base64url encoded (no +, /, or = characters)
|
|
16
|
+
expect(result.value.codeChallenge).not.toMatch(/[+/=]/);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("should generate consistent code challenge for same verifier", async () => {
|
|
21
|
+
// RFC compliant verifier (43+ chars)
|
|
22
|
+
const codeVerifier = "a".repeat(43);
|
|
23
|
+
const result1 = await oAuthCreateSHA256CodeChallenge({ codeVerifier });
|
|
24
|
+
const result2 = await oAuthCreateSHA256CodeChallenge({ codeVerifier });
|
|
25
|
+
|
|
26
|
+
expect(result1.ok).toBe(true);
|
|
27
|
+
expect(result2.ok).toBe(true);
|
|
28
|
+
if (result1.ok && result2.ok) {
|
|
29
|
+
expect(result1.value.codeChallenge).toBe(result2.value.codeChallenge);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("should generate RFC 7636 compliant random code verifier when not provided", async () => {
|
|
34
|
+
const result = await oAuthCreateSHA256CodeChallenge();
|
|
35
|
+
|
|
36
|
+
expect(result.ok).toBe(true);
|
|
37
|
+
if (result.ok) {
|
|
38
|
+
expect(result.value.codeVerifier).toBeTruthy();
|
|
39
|
+
expect(result.value.codeChallenge).toBeTruthy();
|
|
40
|
+
expect(typeof result.value.codeVerifier).toBe("string");
|
|
41
|
+
// RFC 7636: verifier should be exactly 43 characters (32 bytes base64url encoded)
|
|
42
|
+
expect(result.value.codeVerifier.length).toBe(43);
|
|
43
|
+
// Should only contain base64url characters
|
|
44
|
+
expect(result.value.codeVerifier).toMatch(/^[A-Za-z0-9_-]+$/);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("should generate different code verifiers on successive calls", async () => {
|
|
49
|
+
const result1 = await oAuthCreateSHA256CodeChallenge();
|
|
50
|
+
const result2 = await oAuthCreateSHA256CodeChallenge();
|
|
51
|
+
|
|
52
|
+
expect(result1.ok).toBe(true);
|
|
53
|
+
expect(result2.ok).toBe(true);
|
|
54
|
+
if (result1.ok && result2.ok) {
|
|
55
|
+
expect(result1.value.codeVerifier).not.toBe(result2.value.codeVerifier);
|
|
56
|
+
expect(result1.value.codeChallenge).not.toBe(result2.value.codeChallenge);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("should generate base64url encoded challenge (RFC 7636)", async () => {
|
|
61
|
+
const codeVerifier = "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk";
|
|
62
|
+
const result = await oAuthCreateSHA256CodeChallenge({ codeVerifier });
|
|
63
|
+
|
|
64
|
+
expect(result.ok).toBe(true);
|
|
65
|
+
if (result.ok) {
|
|
66
|
+
// Should be base64url encoded (no standard base64 chars)
|
|
67
|
+
expect(result.value.codeChallenge).not.toMatch(/\+/);
|
|
68
|
+
expect(result.value.codeChallenge).not.toMatch(/\//);
|
|
69
|
+
expect(result.value.codeChallenge).not.toMatch(/=/);
|
|
70
|
+
// Should only contain base64url characters
|
|
71
|
+
expect(result.value.codeChallenge).toMatch(/^[A-Za-z0-9_-]+$/);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("should handle invalid input type", async () => {
|
|
76
|
+
const result = await oAuthCreateSHA256CodeChallenge({
|
|
77
|
+
codeVerifier: 123 as any,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
expect(result.ok).toBe(false);
|
|
81
|
+
if (!result.ok) {
|
|
82
|
+
expect(result.error).toBeDefined();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("should produce SHA-256 hash of correct length", async () => {
|
|
87
|
+
const codeVerifier = "a".repeat(43); // RFC compliant length
|
|
88
|
+
const result = await oAuthCreateSHA256CodeChallenge({ codeVerifier });
|
|
89
|
+
|
|
90
|
+
expect(result.ok).toBe(true);
|
|
91
|
+
if (result.ok) {
|
|
92
|
+
// SHA-256 produces 256 bits = 32 bytes
|
|
93
|
+
// Base64url encoding of 32 bytes should be 43 characters (no padding)
|
|
94
|
+
expect(result.value.codeChallenge.length).toBe(43);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it("should reject empty string code verifier (RFC 7636 violation)", async () => {
|
|
99
|
+
const result = await oAuthCreateSHA256CodeChallenge({ codeVerifier: "" });
|
|
100
|
+
|
|
101
|
+
expect(result.ok).toBe(false);
|
|
102
|
+
if (!result.ok) {
|
|
103
|
+
expect(result.error).toBeDefined();
|
|
104
|
+
expect((result.error as Error).message).toContain("at least 43 characters");
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("should reject code verifier shorter than 43 characters", async () => {
|
|
109
|
+
const result = await oAuthCreateSHA256CodeChallenge({
|
|
110
|
+
codeVerifier: "too-short",
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
expect(result.ok).toBe(false);
|
|
114
|
+
if (!result.ok) {
|
|
115
|
+
expect(result.error).toBeDefined();
|
|
116
|
+
expect((result.error as Error).message).toContain("at least 43 characters");
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("should reject code verifier longer than 128 characters (RFC 7636)", async () => {
|
|
121
|
+
const longVerifier = "a".repeat(129);
|
|
122
|
+
const result = await oAuthCreateSHA256CodeChallenge({
|
|
123
|
+
codeVerifier: longVerifier,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
expect(result.ok).toBe(false);
|
|
127
|
+
if (!result.ok) {
|
|
128
|
+
expect(result.error).toBeDefined();
|
|
129
|
+
expect((result.error as Error).message).toContain("at most 128 characters");
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it("should accept code verifier at maximum length (128 characters)", async () => {
|
|
134
|
+
const maxVerifier = "a".repeat(128);
|
|
135
|
+
const result = await oAuthCreateSHA256CodeChallenge({
|
|
136
|
+
codeVerifier: maxVerifier,
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
expect(result.ok).toBe(true);
|
|
140
|
+
if (result.ok) {
|
|
141
|
+
expect(result.value.codeVerifier).toBe(maxVerifier);
|
|
142
|
+
expect(result.value.codeChallenge).toBeTruthy();
|
|
143
|
+
// SHA-256 always produces same length output regardless of input length
|
|
144
|
+
expect(result.value.codeChallenge.length).toBe(43);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it("should accept RFC 7636 unreserved characters in code verifier", async () => {
|
|
149
|
+
// RFC 7636 allows: [A-Z] / [a-z] / [0-9] / "-" / "." / "_" / "~"
|
|
150
|
+
const validVerifier = "aZ09-._~" + "a".repeat(35); // 43 chars total
|
|
151
|
+
const result = await oAuthCreateSHA256CodeChallenge({
|
|
152
|
+
codeVerifier: validVerifier,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
expect(result.ok).toBe(true);
|
|
156
|
+
if (result.ok) {
|
|
157
|
+
expect(result.value.codeVerifier).toBe(validVerifier);
|
|
158
|
+
expect(result.value.codeChallenge).toBeTruthy();
|
|
159
|
+
expect(result.value.codeChallenge.length).toBe(43);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it("should reject code verifier with invalid characters", async () => {
|
|
164
|
+
// Contains invalid characters like ! @ # $ etc.
|
|
165
|
+
const invalidVerifier = "test!@#$%^&*()+=[]{}|;:',.<>?/`" + "a".repeat(13);
|
|
166
|
+
const result = await oAuthCreateSHA256CodeChallenge({
|
|
167
|
+
codeVerifier: invalidVerifier,
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
expect(result.ok).toBe(false);
|
|
171
|
+
if (!result.ok) {
|
|
172
|
+
expect(result.error).toBeDefined();
|
|
173
|
+
expect((result.error as Error).message).toContain("unreserved characters");
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it("should reject code verifier with spaces", async () => {
|
|
178
|
+
const verifierWithSpaces = "test verifier with spaces" + "a".repeat(18);
|
|
179
|
+
const result = await oAuthCreateSHA256CodeChallenge({
|
|
180
|
+
codeVerifier: verifierWithSpaces,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
expect(result.ok).toBe(false);
|
|
184
|
+
if (!result.ok) {
|
|
185
|
+
expect(result.error).toBeDefined();
|
|
186
|
+
expect((result.error as Error).message).toContain("unreserved characters");
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import z from "zod/v3";
|
|
2
|
+
import { Result } from "../../types/fp.js";
|
|
3
|
+
|
|
4
|
+
const CreateSHA256CodeChallengeRequestSchema = z.object({
|
|
5
|
+
/**
|
|
6
|
+
* If not provided, a random code verifier will be generated.
|
|
7
|
+
* If provided, must be 43-128 characters and contain only unreserved
|
|
8
|
+
* characters [A-Za-z0-9-._~] per RFC 7636.
|
|
9
|
+
*/
|
|
10
|
+
codeVerifier: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(43, "Code verifier must be at least 43 characters")
|
|
13
|
+
.max(128, "Code verifier must be at most 128 characters")
|
|
14
|
+
.regex(
|
|
15
|
+
/^[A-Za-z0-9\-._~]+$/,
|
|
16
|
+
"Code verifier must only contain unreserved characters: [A-Za-z0-9-._~]",
|
|
17
|
+
)
|
|
18
|
+
.optional(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type CreateSHA256CodeChallengeRequest = z.infer<
|
|
22
|
+
typeof CreateSHA256CodeChallengeRequestSchema
|
|
23
|
+
>;
|
|
24
|
+
|
|
25
|
+
export type CreateSHA256CodeChallengeResponse = {
|
|
26
|
+
codeChallenge: string;
|
|
27
|
+
codeVerifier: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Convert a Uint8Array to base64url encoding (RFC 4648)
|
|
32
|
+
*/
|
|
33
|
+
function arrayBufferToBase64Url(buffer: Uint8Array): string {
|
|
34
|
+
let binary = "";
|
|
35
|
+
for (let i = 0; i < buffer.length; i++) {
|
|
36
|
+
binary += String.fromCharCode(buffer[i]!);
|
|
37
|
+
}
|
|
38
|
+
return btoa(binary)
|
|
39
|
+
.replace(/\+/g, "-")
|
|
40
|
+
.replace(/\//g, "_")
|
|
41
|
+
.replace(/=+$/, "");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Generate a cryptographically random code verifier per RFC 7636
|
|
46
|
+
*/
|
|
47
|
+
function generateCodeVerifier(): string {
|
|
48
|
+
// RFC 7636 recommends 32 octets of random data, base64url encoded = 43 chars
|
|
49
|
+
const randomBytes = crypto.getRandomValues(new Uint8Array(32));
|
|
50
|
+
return arrayBufferToBase64Url(randomBytes);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Generate a SHA-256 code challenge for PKCE
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* Generates a SHA-256 code challenge and corresponding code verifier for use
|
|
58
|
+
* in the PKCE extension to OAuth2. If no code verifier is provided, a random
|
|
59
|
+
* one will be generated according to RFC 7636 (32 random bytes, base64url
|
|
60
|
+
* encoded). If a code verifier is provided, it must be 43-128 characters and
|
|
61
|
+
* contain only unreserved characters [A-Za-z0-9-._~].
|
|
62
|
+
*
|
|
63
|
+
* @see {@link https://openrouter.ai/docs/use-cases/oauth-pkce}
|
|
64
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc7636}
|
|
65
|
+
*/
|
|
66
|
+
export async function oAuthCreateSHA256CodeChallenge(
|
|
67
|
+
params: CreateSHA256CodeChallengeRequest = {},
|
|
68
|
+
): Promise<Result<CreateSHA256CodeChallengeResponse>> {
|
|
69
|
+
const parsedParams = CreateSHA256CodeChallengeRequestSchema.safeParse(params);
|
|
70
|
+
if (!parsedParams.success) return { ok: false, error: parsedParams.error };
|
|
71
|
+
|
|
72
|
+
const { codeVerifier = generateCodeVerifier() } = parsedParams.data;
|
|
73
|
+
|
|
74
|
+
// Generate SHA-256 hash
|
|
75
|
+
const encoder = new TextEncoder();
|
|
76
|
+
const data = encoder.encode(codeVerifier);
|
|
77
|
+
const hash = await crypto.subtle.digest("SHA-256", data);
|
|
78
|
+
|
|
79
|
+
// Convert hash to base64url
|
|
80
|
+
const hashArray = new Uint8Array(hash);
|
|
81
|
+
const codeChallenge = arrayBufferToBase64Url(hashArray);
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
ok: true,
|
|
85
|
+
value: {
|
|
86
|
+
codeChallenge,
|
|
87
|
+
codeVerifier,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
package/src/funcs/modelsList.ts
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -59,8 +59,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
59
59
|
export const SDK_METADATA = {
|
|
60
60
|
language: "typescript",
|
|
61
61
|
openapiDocVersion: "1.0.0",
|
|
62
|
-
sdkVersion: "0.0.0-beta.
|
|
63
|
-
genVersion: "2.723.
|
|
62
|
+
sdkVersion: "0.0.0-beta.39",
|
|
63
|
+
genVersion: "2.723.11",
|
|
64
64
|
userAgent:
|
|
65
|
-
"speakeasy-sdk/typescript 0.0.0-beta.
|
|
65
|
+
"speakeasy-sdk/typescript 0.0.0-beta.39 2.723.11 1.0.0 @openrouter/sdk",
|
|
66
66
|
} as const;
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
catchUnrecognizedEnum,
|
|
10
|
+
OpenEnum,
|
|
11
|
+
Unrecognized,
|
|
12
|
+
} from "../types/enums.js";
|
|
9
13
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
14
|
import {
|
|
11
15
|
ChatStreamOptions,
|
|
@@ -33,7 +37,7 @@ export const ChatGenerationParamsEffort = {
|
|
|
33
37
|
Medium: "medium",
|
|
34
38
|
High: "high",
|
|
35
39
|
} as const;
|
|
36
|
-
export type ChatGenerationParamsEffort =
|
|
40
|
+
export type ChatGenerationParamsEffort = OpenEnum<
|
|
37
41
|
typeof ChatGenerationParamsEffort
|
|
38
42
|
>;
|
|
39
43
|
|
|
@@ -42,14 +46,14 @@ export const GenerateSummary = {
|
|
|
42
46
|
Concise: "concise",
|
|
43
47
|
Detailed: "detailed",
|
|
44
48
|
} as const;
|
|
45
|
-
export type GenerateSummary =
|
|
49
|
+
export type GenerateSummary = OpenEnum<typeof GenerateSummary>;
|
|
46
50
|
|
|
47
51
|
export const SummaryEnum = {
|
|
48
52
|
Auto: "auto",
|
|
49
53
|
Concise: "concise",
|
|
50
54
|
Detailed: "detailed",
|
|
51
55
|
} as const;
|
|
52
|
-
export type SummaryEnum =
|
|
56
|
+
export type SummaryEnum = OpenEnum<typeof SummaryEnum>;
|
|
53
57
|
|
|
54
58
|
export type Reasoning = {
|
|
55
59
|
effort?: ChatGenerationParamsEffort | null | undefined;
|
|
@@ -126,14 +130,25 @@ export type ChatGenerationParams = {
|
|
|
126
130
|
};
|
|
127
131
|
|
|
128
132
|
/** @internal */
|
|
129
|
-
export const ChatGenerationParamsEffort$inboundSchema: z.
|
|
130
|
-
|
|
131
|
-
|
|
133
|
+
export const ChatGenerationParamsEffort$inboundSchema: z.ZodType<
|
|
134
|
+
ChatGenerationParamsEffort,
|
|
135
|
+
z.ZodTypeDef,
|
|
136
|
+
unknown
|
|
137
|
+
> = z
|
|
138
|
+
.union([
|
|
139
|
+
z.nativeEnum(ChatGenerationParamsEffort),
|
|
140
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
141
|
+
]);
|
|
132
142
|
|
|
133
143
|
/** @internal */
|
|
134
|
-
export const ChatGenerationParamsEffort$outboundSchema: z.
|
|
135
|
-
|
|
136
|
-
|
|
144
|
+
export const ChatGenerationParamsEffort$outboundSchema: z.ZodType<
|
|
145
|
+
ChatGenerationParamsEffort,
|
|
146
|
+
z.ZodTypeDef,
|
|
147
|
+
ChatGenerationParamsEffort
|
|
148
|
+
> = z.union([
|
|
149
|
+
z.nativeEnum(ChatGenerationParamsEffort),
|
|
150
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
151
|
+
]);
|
|
137
152
|
|
|
138
153
|
/**
|
|
139
154
|
* @internal
|
|
@@ -147,14 +162,25 @@ export namespace ChatGenerationParamsEffort$ {
|
|
|
147
162
|
}
|
|
148
163
|
|
|
149
164
|
/** @internal */
|
|
150
|
-
export const GenerateSummary$inboundSchema: z.
|
|
151
|
-
|
|
152
|
-
|
|
165
|
+
export const GenerateSummary$inboundSchema: z.ZodType<
|
|
166
|
+
GenerateSummary,
|
|
167
|
+
z.ZodTypeDef,
|
|
168
|
+
unknown
|
|
169
|
+
> = z
|
|
170
|
+
.union([
|
|
171
|
+
z.nativeEnum(GenerateSummary),
|
|
172
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
173
|
+
]);
|
|
153
174
|
|
|
154
175
|
/** @internal */
|
|
155
|
-
export const GenerateSummary$outboundSchema: z.
|
|
156
|
-
|
|
157
|
-
|
|
176
|
+
export const GenerateSummary$outboundSchema: z.ZodType<
|
|
177
|
+
GenerateSummary,
|
|
178
|
+
z.ZodTypeDef,
|
|
179
|
+
GenerateSummary
|
|
180
|
+
> = z.union([
|
|
181
|
+
z.nativeEnum(GenerateSummary),
|
|
182
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
183
|
+
]);
|
|
158
184
|
|
|
159
185
|
/**
|
|
160
186
|
* @internal
|
|
@@ -168,12 +194,25 @@ export namespace GenerateSummary$ {
|
|
|
168
194
|
}
|
|
169
195
|
|
|
170
196
|
/** @internal */
|
|
171
|
-
export const SummaryEnum$inboundSchema: z.
|
|
172
|
-
|
|
197
|
+
export const SummaryEnum$inboundSchema: z.ZodType<
|
|
198
|
+
SummaryEnum,
|
|
199
|
+
z.ZodTypeDef,
|
|
200
|
+
unknown
|
|
201
|
+
> = z
|
|
202
|
+
.union([
|
|
203
|
+
z.nativeEnum(SummaryEnum),
|
|
204
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
205
|
+
]);
|
|
173
206
|
|
|
174
207
|
/** @internal */
|
|
175
|
-
export const SummaryEnum$outboundSchema: z.
|
|
176
|
-
SummaryEnum
|
|
208
|
+
export const SummaryEnum$outboundSchema: z.ZodType<
|
|
209
|
+
SummaryEnum,
|
|
210
|
+
z.ZodTypeDef,
|
|
211
|
+
SummaryEnum
|
|
212
|
+
> = z.union([
|
|
213
|
+
z.nativeEnum(SummaryEnum),
|
|
214
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
215
|
+
]);
|
|
177
216
|
|
|
178
217
|
/**
|
|
179
218
|
* @internal
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
catchUnrecognizedEnum,
|
|
10
|
+
OpenEnum,
|
|
11
|
+
Unrecognized,
|
|
12
|
+
} from "../types/enums.js";
|
|
9
13
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
14
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
11
15
|
|
|
@@ -18,7 +22,7 @@ export const ChatMessageContentItemAudioFormat = {
|
|
|
18
22
|
Pcm16: "pcm16",
|
|
19
23
|
Pcm24: "pcm24",
|
|
20
24
|
} as const;
|
|
21
|
-
export type ChatMessageContentItemAudioFormat =
|
|
25
|
+
export type ChatMessageContentItemAudioFormat = OpenEnum<
|
|
22
26
|
typeof ChatMessageContentItemAudioFormat
|
|
23
27
|
>;
|
|
24
28
|
|
|
@@ -33,14 +37,25 @@ export type ChatMessageContentItemAudio = {
|
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
/** @internal */
|
|
36
|
-
export const ChatMessageContentItemAudioFormat$inboundSchema: z.
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
export const ChatMessageContentItemAudioFormat$inboundSchema: z.ZodType<
|
|
41
|
+
ChatMessageContentItemAudioFormat,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
unknown
|
|
44
|
+
> = z
|
|
45
|
+
.union([
|
|
46
|
+
z.nativeEnum(ChatMessageContentItemAudioFormat),
|
|
47
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
48
|
+
]);
|
|
39
49
|
|
|
40
50
|
/** @internal */
|
|
41
|
-
export const ChatMessageContentItemAudioFormat$outboundSchema: z.
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
export const ChatMessageContentItemAudioFormat$outboundSchema: z.ZodType<
|
|
52
|
+
ChatMessageContentItemAudioFormat,
|
|
53
|
+
z.ZodTypeDef,
|
|
54
|
+
ChatMessageContentItemAudioFormat
|
|
55
|
+
> = z.union([
|
|
56
|
+
z.nativeEnum(ChatMessageContentItemAudioFormat),
|
|
57
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
58
|
+
]);
|
|
44
59
|
|
|
45
60
|
/**
|
|
46
61
|
* @internal
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
catchUnrecognizedEnum,
|
|
10
|
+
OpenEnum,
|
|
11
|
+
Unrecognized,
|
|
12
|
+
} from "../types/enums.js";
|
|
9
13
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
14
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
11
15
|
|
|
@@ -14,7 +18,7 @@ export const Detail = {
|
|
|
14
18
|
Low: "low",
|
|
15
19
|
High: "high",
|
|
16
20
|
} as const;
|
|
17
|
-
export type Detail =
|
|
21
|
+
export type Detail = OpenEnum<typeof Detail>;
|
|
18
22
|
|
|
19
23
|
export type ImageUrl = {
|
|
20
24
|
url: string;
|
|
@@ -27,12 +31,18 @@ export type ChatMessageContentItemImage = {
|
|
|
27
31
|
};
|
|
28
32
|
|
|
29
33
|
/** @internal */
|
|
30
|
-
export const Detail$inboundSchema: z.
|
|
31
|
-
.
|
|
34
|
+
export const Detail$inboundSchema: z.ZodType<Detail, z.ZodTypeDef, unknown> = z
|
|
35
|
+
.union([
|
|
36
|
+
z.nativeEnum(Detail),
|
|
37
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
38
|
+
]);
|
|
32
39
|
|
|
33
40
|
/** @internal */
|
|
34
|
-
export const Detail$outboundSchema: z.
|
|
35
|
-
|
|
41
|
+
export const Detail$outboundSchema: z.ZodType<Detail, z.ZodTypeDef, Detail> = z
|
|
42
|
+
.union([
|
|
43
|
+
z.nativeEnum(Detail),
|
|
44
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
45
|
+
]);
|
|
36
46
|
|
|
37
47
|
/**
|
|
38
48
|
* @internal
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
catchUnrecognizedEnum,
|
|
10
|
+
OpenEnum,
|
|
11
|
+
Unrecognized,
|
|
12
|
+
} from "../types/enums.js";
|
|
9
13
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
14
|
import {
|
|
11
15
|
AssistantMessage,
|
|
@@ -28,7 +32,7 @@ export const ChatResponseChoiceFinishReason = {
|
|
|
28
32
|
ContentFilter: "content_filter",
|
|
29
33
|
Error: "error",
|
|
30
34
|
} as const;
|
|
31
|
-
export type ChatResponseChoiceFinishReason =
|
|
35
|
+
export type ChatResponseChoiceFinishReason = OpenEnum<
|
|
32
36
|
typeof ChatResponseChoiceFinishReason
|
|
33
37
|
>;
|
|
34
38
|
|
|
@@ -40,14 +44,25 @@ export type ChatResponseChoice = {
|
|
|
40
44
|
};
|
|
41
45
|
|
|
42
46
|
/** @internal */
|
|
43
|
-
export const ChatResponseChoiceFinishReason$inboundSchema: z.
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
export const ChatResponseChoiceFinishReason$inboundSchema: z.ZodType<
|
|
48
|
+
ChatResponseChoiceFinishReason,
|
|
49
|
+
z.ZodTypeDef,
|
|
50
|
+
unknown
|
|
51
|
+
> = z
|
|
52
|
+
.union([
|
|
53
|
+
z.nativeEnum(ChatResponseChoiceFinishReason),
|
|
54
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
55
|
+
]);
|
|
46
56
|
|
|
47
57
|
/** @internal */
|
|
48
|
-
export const ChatResponseChoiceFinishReason$outboundSchema: z.
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
export const ChatResponseChoiceFinishReason$outboundSchema: z.ZodType<
|
|
59
|
+
ChatResponseChoiceFinishReason,
|
|
60
|
+
z.ZodTypeDef,
|
|
61
|
+
ChatResponseChoiceFinishReason
|
|
62
|
+
> = z.union([
|
|
63
|
+
z.nativeEnum(ChatResponseChoiceFinishReason),
|
|
64
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
65
|
+
]);
|
|
51
66
|
|
|
52
67
|
/**
|
|
53
68
|
* @internal
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
catchUnrecognizedEnum,
|
|
10
|
+
OpenEnum,
|
|
11
|
+
Unrecognized,
|
|
12
|
+
} from "../types/enums.js";
|
|
9
13
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
14
|
import {
|
|
11
15
|
ChatMessageTokenLogprobs,
|
|
@@ -28,7 +32,7 @@ export const ChatStreamingChoiceFinishReason = {
|
|
|
28
32
|
ContentFilter: "content_filter",
|
|
29
33
|
Error: "error",
|
|
30
34
|
} as const;
|
|
31
|
-
export type ChatStreamingChoiceFinishReason =
|
|
35
|
+
export type ChatStreamingChoiceFinishReason = OpenEnum<
|
|
32
36
|
typeof ChatStreamingChoiceFinishReason
|
|
33
37
|
>;
|
|
34
38
|
|
|
@@ -40,14 +44,25 @@ export type ChatStreamingChoice = {
|
|
|
40
44
|
};
|
|
41
45
|
|
|
42
46
|
/** @internal */
|
|
43
|
-
export const ChatStreamingChoiceFinishReason$inboundSchema: z.
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
export const ChatStreamingChoiceFinishReason$inboundSchema: z.ZodType<
|
|
48
|
+
ChatStreamingChoiceFinishReason,
|
|
49
|
+
z.ZodTypeDef,
|
|
50
|
+
unknown
|
|
51
|
+
> = z
|
|
52
|
+
.union([
|
|
53
|
+
z.nativeEnum(ChatStreamingChoiceFinishReason),
|
|
54
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
55
|
+
]);
|
|
46
56
|
|
|
47
57
|
/** @internal */
|
|
48
|
-
export const ChatStreamingChoiceFinishReason$outboundSchema: z.
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
export const ChatStreamingChoiceFinishReason$outboundSchema: z.ZodType<
|
|
59
|
+
ChatStreamingChoiceFinishReason,
|
|
60
|
+
z.ZodTypeDef,
|
|
61
|
+
ChatStreamingChoiceFinishReason
|
|
62
|
+
> = z.union([
|
|
63
|
+
z.nativeEnum(ChatStreamingChoiceFinishReason),
|
|
64
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
65
|
+
]);
|
|
51
66
|
|
|
52
67
|
/**
|
|
53
68
|
* @internal
|
|
@@ -3,24 +3,39 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
catchUnrecognizedEnum,
|
|
8
|
+
OpenEnum,
|
|
9
|
+
Unrecognized,
|
|
10
|
+
} from "../types/enums.js";
|
|
7
11
|
|
|
8
12
|
export const CompletionFinishReason = {
|
|
9
13
|
Stop: "stop",
|
|
10
14
|
Length: "length",
|
|
11
15
|
ContentFilter: "content_filter",
|
|
12
16
|
} as const;
|
|
13
|
-
export type CompletionFinishReason =
|
|
17
|
+
export type CompletionFinishReason = OpenEnum<typeof CompletionFinishReason>;
|
|
14
18
|
|
|
15
19
|
/** @internal */
|
|
16
|
-
export const CompletionFinishReason$inboundSchema: z.
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
export const CompletionFinishReason$inboundSchema: z.ZodType<
|
|
21
|
+
CompletionFinishReason,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
unknown
|
|
24
|
+
> = z
|
|
25
|
+
.union([
|
|
26
|
+
z.nativeEnum(CompletionFinishReason),
|
|
27
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
28
|
+
]);
|
|
19
29
|
|
|
20
30
|
/** @internal */
|
|
21
|
-
export const CompletionFinishReason$outboundSchema: z.
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
export const CompletionFinishReason$outboundSchema: z.ZodType<
|
|
32
|
+
CompletionFinishReason,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
CompletionFinishReason
|
|
35
|
+
> = z.union([
|
|
36
|
+
z.nativeEnum(CompletionFinishReason),
|
|
37
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
38
|
+
]);
|
|
24
39
|
|
|
25
40
|
/**
|
|
26
41
|
* @internal
|