@openrouter/sdk 0.0.0-beta.4 → 0.0.0-beta.7
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 +3 -1
- package/REACT_QUERY.md +10 -6
- package/README.md +29 -36
- package/dist/commonjs/funcs/analyticsGetActivity.js +2 -3
- package/dist/commonjs/funcs/analyticsGetActivity.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysDeleteKeysHash.js +2 -3
- package/dist/commonjs/funcs/apiKeysDeleteKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetAuthKey.js +2 -3
- package/dist/commonjs/funcs/apiKeysGetAuthKey.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKey.js +2 -3
- package/dist/commonjs/funcs/apiKeysGetKey.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKeys.js +2 -3
- package/dist/commonjs/funcs/apiKeysGetKeys.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysGetKeysHash.js +2 -3
- package/dist/commonjs/funcs/apiKeysGetKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysPatchKeysHash.js +2 -3
- package/dist/commonjs/funcs/apiKeysPatchKeysHash.js.map +1 -1
- package/dist/commonjs/funcs/apiKeysPostKeys.js +2 -3
- package/dist/commonjs/funcs/apiKeysPostKeys.js.map +1 -1
- package/dist/commonjs/funcs/{chatSend.d.ts → chatGenerateResponse.d.ts} +6 -6
- package/dist/commonjs/funcs/chatGenerateResponse.d.ts.map +1 -0
- package/dist/commonjs/funcs/{chatSend.js → chatGenerateResponse.js} +13 -14
- package/dist/commonjs/funcs/chatGenerateResponse.js.map +1 -0
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.js +2 -3
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.js.map +1 -1
- package/dist/commonjs/funcs/endpointsGetEndpointsZdr.js +2 -3
- package/dist/commonjs/funcs/endpointsGetEndpointsZdr.js.map +1 -1
- package/dist/commonjs/funcs/endpointsGetModelsAuthorSlugEndpoints.js +2 -3
- package/dist/commonjs/funcs/endpointsGetModelsAuthorSlugEndpoints.js.map +1 -1
- package/dist/commonjs/funcs/generationsGetGeneration.js +2 -3
- package/dist/commonjs/funcs/generationsGetGeneration.js.map +1 -1
- package/dist/commonjs/funcs/getCredits.js +2 -3
- package/dist/commonjs/funcs/getCredits.js.map +1 -1
- package/dist/commonjs/funcs/getProviders.js +2 -3
- package/dist/commonjs/funcs/getProviders.js.map +1 -1
- package/dist/commonjs/funcs/modelsGetModels.js +2 -3
- package/dist/commonjs/funcs/modelsGetModels.js.map +1 -1
- package/dist/commonjs/funcs/modelsGetModelsCount.js +2 -3
- package/dist/commonjs/funcs/modelsGetModelsCount.js.map +1 -1
- package/dist/commonjs/funcs/modelsGetModelsUser.d.ts +1 -1
- package/dist/commonjs/funcs/modelsGetModelsUser.d.ts.map +1 -1
- package/dist/commonjs/funcs/modelsGetModelsUser.js +7 -12
- package/dist/commonjs/funcs/modelsGetModelsUser.js.map +1 -1
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.d.ts +1 -1
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.d.ts.map +1 -1
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.js +7 -12
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.js.map +1 -1
- package/dist/commonjs/funcs/postCreditsCoinbase.d.ts +1 -1
- package/dist/commonjs/funcs/postCreditsCoinbase.d.ts.map +1 -1
- package/dist/commonjs/funcs/postCreditsCoinbase.js +7 -12
- package/dist/commonjs/funcs/postCreditsCoinbase.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +8 -4
- package/dist/commonjs/lib/config.d.ts.map +1 -1
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/env.d.ts +2 -1
- package/dist/commonjs/lib/env.d.ts.map +1 -1
- package/dist/commonjs/lib/env.js +2 -1
- package/dist/commonjs/lib/env.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +7 -1
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/models/chatcompletion.d.ts +43 -0
- package/dist/commonjs/models/chatcompletion.d.ts.map +1 -0
- package/dist/commonjs/models/{chatresponse.js → chatcompletion.js} +22 -22
- package/dist/commonjs/models/chatcompletion.js.map +1 -0
- package/dist/commonjs/models/chatcompletionchoice.d.ts +72 -0
- package/dist/commonjs/models/chatcompletionchoice.d.ts.map +1 -0
- package/dist/commonjs/models/{chatstreamingchoice.js → chatcompletionchoice.js} +32 -32
- package/dist/commonjs/models/chatcompletionchoice.js.map +1 -0
- package/dist/commonjs/models/chatcompletionchunk.d.ts +68 -0
- package/dist/commonjs/models/chatcompletionchunk.d.ts.map +1 -0
- package/dist/commonjs/models/{chatstreamingresponsechunk.js → chatcompletionchunk.js} +22 -55
- package/dist/commonjs/models/chatcompletionchunk.js.map +1 -0
- package/dist/commonjs/models/chatcompletionchunkchoice.d.ts +72 -0
- package/dist/commonjs/models/chatcompletionchunkchoice.d.ts.map +1 -0
- package/dist/commonjs/models/chatcompletionchunkchoice.js +108 -0
- package/dist/commonjs/models/chatcompletionchunkchoice.js.map +1 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedelta.d.ts +61 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedelta.d.ts.map +1 -0
- package/dist/commonjs/models/{chatstreamingmessagechunk.js → chatcompletionchunkchoicedelta.js} +22 -20
- package/dist/commonjs/models/chatcompletionchunkchoicedelta.js.map +1 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedeltatoolcall.d.ts +62 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedeltatoolcall.d.ts.map +1 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedeltatoolcall.js +104 -0
- package/dist/commonjs/models/chatcompletionchunkchoicedeltatoolcall.js.map +1 -0
- package/dist/commonjs/models/chatcompletionerror.d.ts +35 -0
- package/dist/commonjs/models/chatcompletionerror.d.ts.map +1 -0
- package/dist/commonjs/models/chatcompletionerror.js +75 -0
- package/dist/commonjs/models/chatcompletionerror.js.map +1 -0
- package/dist/commonjs/models/chatcompletionmessage.d.ts +62 -0
- package/dist/commonjs/models/chatcompletionmessage.d.ts.map +1 -0
- package/dist/commonjs/models/chatcompletionmessage.js +113 -0
- package/dist/commonjs/models/chatcompletionmessage.js.map +1 -0
- package/dist/commonjs/models/errorresponse.d.ts +8 -8
- package/dist/commonjs/models/errorresponse.d.ts.map +1 -1
- package/dist/commonjs/models/errorresponse.js +13 -14
- package/dist/commonjs/models/errorresponse.js.map +1 -1
- package/dist/commonjs/models/errors/chatcompletionerror.d.ts +37 -0
- package/dist/commonjs/models/errors/chatcompletionerror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/{chaterror.js → chatcompletionerror.js} +17 -17
- package/dist/commonjs/models/errors/chatcompletionerror.js.map +1 -0
- package/dist/commonjs/models/errors/index.d.ts +1 -1
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -1
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +9 -8
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +9 -8
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/message.d.ts +19 -54
- package/dist/commonjs/models/message.d.ts.map +1 -1
- package/dist/commonjs/models/message.js +22 -73
- package/dist/commonjs/models/message.js.map +1 -1
- package/dist/commonjs/models/operations/getmodelsuser.d.ts +0 -25
- package/dist/commonjs/models/operations/getmodelsuser.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getmodelsuser.js +2 -29
- package/dist/commonjs/models/operations/getmodelsuser.js.map +1 -1
- package/dist/commonjs/models/operations/getparametersauthorslug.d.ts +0 -25
- package/dist/commonjs/models/operations/getparametersauthorslug.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getparametersauthorslug.js +1 -28
- package/dist/commonjs/models/operations/getparametersauthorslug.js.map +1 -1
- package/dist/commonjs/models/operations/postchatcompletions.d.ts +3 -3
- package/dist/commonjs/models/operations/postchatcompletions.d.ts.map +1 -1
- package/dist/commonjs/models/operations/postchatcompletions.js +3 -3
- package/dist/commonjs/models/operations/postchatcompletions.js.map +1 -1
- package/dist/commonjs/models/operations/postcreditscoinbase.d.ts +0 -25
- package/dist/commonjs/models/operations/postcreditscoinbase.d.ts.map +1 -1
- package/dist/commonjs/models/operations/postcreditscoinbase.js +1 -28
- package/dist/commonjs/models/operations/postcreditscoinbase.js.map +1 -1
- package/dist/commonjs/models/security.d.ts +4 -2
- package/dist/commonjs/models/security.d.ts.map +1 -1
- package/dist/commonjs/models/security.js +4 -2
- package/dist/commonjs/models/security.js.map +1 -1
- package/dist/commonjs/models/toolmessage.d.ts +55 -0
- package/dist/commonjs/models/toolmessage.d.ts.map +1 -0
- package/dist/commonjs/models/{toolresponsemessage.js → toolmessage.js} +32 -32
- package/dist/commonjs/models/toolmessage.js.map +1 -0
- package/dist/commonjs/react-query/chatGenerateResponse.d.ts +28 -0
- package/dist/commonjs/react-query/chatGenerateResponse.d.ts.map +1 -0
- package/dist/commonjs/react-query/chatGenerateResponse.js +50 -0
- package/dist/commonjs/react-query/chatGenerateResponse.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +1 -1
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -1
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/modelsGetModelsUser.d.ts +4 -4
- package/dist/commonjs/react-query/modelsGetModelsUser.d.ts.map +1 -1
- package/dist/commonjs/react-query/modelsGetModelsUser.js +8 -8
- package/dist/commonjs/react-query/modelsGetModelsUser.js.map +1 -1
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.d.ts +4 -4
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.d.ts.map +1 -1
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js +8 -8
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js.map +1 -1
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts +0 -1
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts.map +1 -1
- package/dist/commonjs/react-query/postCreditsCoinbase.js +2 -2
- package/dist/commonjs/react-query/postCreditsCoinbase.js.map +1 -1
- package/dist/commonjs/sdk/chat.d.ts +5 -5
- package/dist/commonjs/sdk/chat.d.ts.map +1 -1
- package/dist/commonjs/sdk/chat.js +7 -7
- package/dist/commonjs/sdk/chat.js.map +1 -1
- package/dist/commonjs/sdk/models.d.ts +1 -1
- package/dist/commonjs/sdk/models.d.ts.map +1 -1
- package/dist/commonjs/sdk/models.js +2 -2
- package/dist/commonjs/sdk/models.js.map +1 -1
- package/dist/commonjs/sdk/parameters.d.ts +1 -1
- package/dist/commonjs/sdk/parameters.d.ts.map +1 -1
- package/dist/commonjs/sdk/parameters.js +2 -2
- package/dist/commonjs/sdk/parameters.js.map +1 -1
- package/dist/commonjs/sdk/sdk.d.ts +1 -1
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +2 -2
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/analyticsGetActivity.js +2 -3
- package/dist/esm/funcs/analyticsGetActivity.js.map +1 -1
- package/dist/esm/funcs/apiKeysDeleteKeysHash.js +2 -3
- package/dist/esm/funcs/apiKeysDeleteKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetAuthKey.js +2 -3
- package/dist/esm/funcs/apiKeysGetAuthKey.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKey.js +2 -3
- package/dist/esm/funcs/apiKeysGetKey.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKeys.js +2 -3
- package/dist/esm/funcs/apiKeysGetKeys.js.map +1 -1
- package/dist/esm/funcs/apiKeysGetKeysHash.js +2 -3
- package/dist/esm/funcs/apiKeysGetKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysPatchKeysHash.js +2 -3
- package/dist/esm/funcs/apiKeysPatchKeysHash.js.map +1 -1
- package/dist/esm/funcs/apiKeysPostKeys.js +2 -3
- package/dist/esm/funcs/apiKeysPostKeys.js.map +1 -1
- package/dist/esm/funcs/{chatSend.d.ts → chatGenerateResponse.d.ts} +6 -6
- package/dist/esm/funcs/chatGenerateResponse.d.ts.map +1 -0
- package/dist/esm/funcs/{chatSend.js → chatGenerateResponse.js} +11 -12
- package/dist/esm/funcs/chatGenerateResponse.js.map +1 -0
- package/dist/esm/funcs/embeddingsPostEmbeddings.js +2 -3
- package/dist/esm/funcs/embeddingsPostEmbeddings.js.map +1 -1
- package/dist/esm/funcs/endpointsGetEndpointsZdr.js +2 -3
- package/dist/esm/funcs/endpointsGetEndpointsZdr.js.map +1 -1
- package/dist/esm/funcs/endpointsGetModelsAuthorSlugEndpoints.js +2 -3
- package/dist/esm/funcs/endpointsGetModelsAuthorSlugEndpoints.js.map +1 -1
- package/dist/esm/funcs/generationsGetGeneration.js +2 -3
- package/dist/esm/funcs/generationsGetGeneration.js.map +1 -1
- package/dist/esm/funcs/getCredits.js +2 -3
- package/dist/esm/funcs/getCredits.js.map +1 -1
- package/dist/esm/funcs/getProviders.js +2 -3
- package/dist/esm/funcs/getProviders.js.map +1 -1
- package/dist/esm/funcs/modelsGetModels.js +2 -3
- package/dist/esm/funcs/modelsGetModels.js.map +1 -1
- package/dist/esm/funcs/modelsGetModelsCount.js +2 -3
- package/dist/esm/funcs/modelsGetModelsCount.js.map +1 -1
- package/dist/esm/funcs/modelsGetModelsUser.d.ts +1 -1
- package/dist/esm/funcs/modelsGetModelsUser.d.ts.map +1 -1
- package/dist/esm/funcs/modelsGetModelsUser.js +8 -13
- package/dist/esm/funcs/modelsGetModelsUser.js.map +1 -1
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.d.ts +1 -1
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.d.ts.map +1 -1
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.js +8 -13
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.js.map +1 -1
- package/dist/esm/funcs/postCreditsCoinbase.d.ts +1 -1
- package/dist/esm/funcs/postCreditsCoinbase.d.ts.map +1 -1
- package/dist/esm/funcs/postCreditsCoinbase.js +8 -13
- package/dist/esm/funcs/postCreditsCoinbase.js.map +1 -1
- package/dist/esm/lib/config.d.ts +8 -4
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/env.d.ts +2 -1
- package/dist/esm/lib/env.d.ts.map +1 -1
- package/dist/esm/lib/env.js +2 -1
- package/dist/esm/lib/env.js.map +1 -1
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +7 -1
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/models/chatcompletion.d.ts +43 -0
- package/dist/esm/models/chatcompletion.d.ts.map +1 -0
- package/dist/esm/models/chatcompletion.js +54 -0
- package/dist/esm/models/chatcompletion.js.map +1 -0
- package/dist/esm/models/chatcompletionchoice.d.ts +72 -0
- package/dist/esm/models/chatcompletionchoice.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionchoice.js +70 -0
- package/dist/esm/models/chatcompletionchoice.js.map +1 -0
- package/dist/esm/models/chatcompletionchunk.d.ts +68 -0
- package/dist/esm/models/chatcompletionchunk.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionchunk.js +91 -0
- package/dist/esm/models/chatcompletionchunk.js.map +1 -0
- package/dist/esm/models/chatcompletionchunkchoice.d.ts +72 -0
- package/dist/esm/models/chatcompletionchunkchoice.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionchunkchoice.js +70 -0
- package/dist/esm/models/chatcompletionchunkchoice.js.map +1 -0
- package/dist/esm/models/chatcompletionchunkchoicedelta.d.ts +61 -0
- package/dist/esm/models/chatcompletionchunkchoicedelta.d.ts.map +1 -0
- package/dist/esm/models/{chatstreamingmessagechunk.js → chatcompletionchunkchoicedelta.js} +19 -17
- package/dist/esm/models/chatcompletionchunkchoicedelta.js.map +1 -0
- package/dist/esm/models/chatcompletionchunkchoicedeltatoolcall.d.ts +62 -0
- package/dist/esm/models/chatcompletionchunkchoicedeltatoolcall.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionchunkchoicedeltatoolcall.js +64 -0
- package/dist/esm/models/chatcompletionchunkchoicedeltatoolcall.js.map +1 -0
- package/dist/esm/models/chatcompletionerror.d.ts +35 -0
- package/dist/esm/models/chatcompletionerror.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionerror.js +37 -0
- package/dist/esm/models/chatcompletionerror.js.map +1 -0
- package/dist/esm/models/chatcompletionmessage.d.ts +62 -0
- package/dist/esm/models/chatcompletionmessage.d.ts.map +1 -0
- package/dist/esm/models/chatcompletionmessage.js +73 -0
- package/dist/esm/models/chatcompletionmessage.js.map +1 -0
- package/dist/esm/models/errorresponse.d.ts +8 -8
- package/dist/esm/models/errorresponse.d.ts.map +1 -1
- package/dist/esm/models/errorresponse.js +12 -13
- package/dist/esm/models/errorresponse.js.map +1 -1
- package/dist/esm/models/errors/chatcompletionerror.d.ts +37 -0
- package/dist/esm/models/errors/chatcompletionerror.d.ts.map +1 -0
- package/dist/esm/models/errors/chatcompletionerror.js +48 -0
- package/dist/esm/models/errors/chatcompletionerror.js.map +1 -0
- package/dist/esm/models/errors/index.d.ts +1 -1
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -1
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/index.d.ts +9 -8
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +9 -8
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/message.d.ts +19 -54
- package/dist/esm/models/message.d.ts.map +1 -1
- package/dist/esm/models/message.js +21 -68
- package/dist/esm/models/message.js.map +1 -1
- package/dist/esm/models/operations/getmodelsuser.d.ts +0 -25
- package/dist/esm/models/operations/getmodelsuser.d.ts.map +1 -1
- package/dist/esm/models/operations/getmodelsuser.js +0 -25
- package/dist/esm/models/operations/getmodelsuser.js.map +1 -1
- package/dist/esm/models/operations/getparametersauthorslug.d.ts +0 -25
- package/dist/esm/models/operations/getparametersauthorslug.d.ts.map +1 -1
- package/dist/esm/models/operations/getparametersauthorslug.js +0 -25
- package/dist/esm/models/operations/getparametersauthorslug.js.map +1 -1
- package/dist/esm/models/operations/postchatcompletions.d.ts +3 -3
- package/dist/esm/models/operations/postchatcompletions.d.ts.map +1 -1
- package/dist/esm/models/operations/postchatcompletions.js +3 -3
- package/dist/esm/models/operations/postchatcompletions.js.map +1 -1
- package/dist/esm/models/operations/postcreditscoinbase.d.ts +0 -25
- package/dist/esm/models/operations/postcreditscoinbase.d.ts.map +1 -1
- package/dist/esm/models/operations/postcreditscoinbase.js +0 -25
- package/dist/esm/models/operations/postcreditscoinbase.js.map +1 -1
- package/dist/esm/models/security.d.ts +4 -2
- package/dist/esm/models/security.d.ts.map +1 -1
- package/dist/esm/models/security.js +4 -2
- package/dist/esm/models/security.js.map +1 -1
- package/dist/esm/models/toolmessage.d.ts +55 -0
- package/dist/esm/models/toolmessage.d.ts.map +1 -0
- package/dist/esm/models/toolmessage.js +69 -0
- package/dist/esm/models/toolmessage.js.map +1 -0
- package/dist/esm/react-query/chatGenerateResponse.d.ts +28 -0
- package/dist/esm/react-query/chatGenerateResponse.d.ts.map +1 -0
- package/dist/esm/react-query/chatGenerateResponse.js +43 -0
- package/dist/esm/react-query/chatGenerateResponse.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +1 -1
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -1
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/modelsGetModelsUser.d.ts +4 -4
- package/dist/esm/react-query/modelsGetModelsUser.d.ts.map +1 -1
- package/dist/esm/react-query/modelsGetModelsUser.js +8 -8
- package/dist/esm/react-query/modelsGetModelsUser.js.map +1 -1
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.d.ts +4 -4
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.d.ts.map +1 -1
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js +8 -8
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js.map +1 -1
- package/dist/esm/react-query/postCreditsCoinbase.d.ts +0 -1
- package/dist/esm/react-query/postCreditsCoinbase.d.ts.map +1 -1
- package/dist/esm/react-query/postCreditsCoinbase.js +2 -2
- package/dist/esm/react-query/postCreditsCoinbase.js.map +1 -1
- package/dist/esm/sdk/chat.d.ts +5 -5
- package/dist/esm/sdk/chat.d.ts.map +1 -1
- package/dist/esm/sdk/chat.js +5 -5
- package/dist/esm/sdk/chat.js.map +1 -1
- package/dist/esm/sdk/models.d.ts +1 -1
- package/dist/esm/sdk/models.d.ts.map +1 -1
- package/dist/esm/sdk/models.js +2 -2
- package/dist/esm/sdk/models.js.map +1 -1
- package/dist/esm/sdk/parameters.d.ts +1 -1
- package/dist/esm/sdk/parameters.d.ts.map +1 -1
- package/dist/esm/sdk/parameters.js +2 -2
- package/dist/esm/sdk/parameters.js.map +1 -1
- package/dist/esm/sdk/sdk.d.ts +1 -1
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +2 -2
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/analytics/README.md +6 -2
- package/docs/sdks/apikeys/README.md +42 -14
- package/docs/sdks/chat/README.md +17 -13
- package/docs/sdks/embeddings/README.md +6 -2
- package/docs/sdks/endpoints/README.md +12 -4
- package/docs/sdks/generations/README.md +6 -2
- package/docs/sdks/models/README.md +24 -13
- package/docs/sdks/openrouter/README.md +24 -13
- package/docs/sdks/parameters/README.md +10 -7
- package/examples/getCredits.example.ts +3 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/analyticsGetActivity.ts +2 -3
- package/src/funcs/apiKeysDeleteKeysHash.ts +2 -3
- package/src/funcs/apiKeysGetAuthKey.ts +2 -3
- package/src/funcs/apiKeysGetKey.ts +2 -3
- package/src/funcs/apiKeysGetKeys.ts +2 -3
- package/src/funcs/apiKeysGetKeysHash.ts +2 -3
- package/src/funcs/apiKeysPatchKeysHash.ts +2 -3
- package/src/funcs/apiKeysPostKeys.ts +2 -3
- package/src/funcs/{chatSend.ts → chatGenerateResponse.ts} +16 -13
- package/src/funcs/embeddingsPostEmbeddings.ts +2 -3
- package/src/funcs/endpointsGetEndpointsZdr.ts +2 -3
- package/src/funcs/endpointsGetModelsAuthorSlugEndpoints.ts +2 -3
- package/src/funcs/generationsGetGeneration.ts +2 -3
- package/src/funcs/getCredits.ts +2 -3
- package/src/funcs/getProviders.ts +2 -3
- package/src/funcs/modelsGetModels.ts +2 -3
- package/src/funcs/modelsGetModelsCount.ts +2 -3
- package/src/funcs/modelsGetModelsUser.ts +5 -15
- package/src/funcs/parametersGetParametersAuthorSlug.ts +5 -15
- package/src/funcs/postCreditsCoinbase.ts +5 -15
- package/src/lib/config.ts +8 -4
- package/src/lib/env.ts +4 -2
- package/src/lib/security.ts +8 -1
- package/src/models/{chatresponse.ts → chatcompletion.ts} +34 -34
- package/src/models/chatcompletionchoice.ts +132 -0
- package/src/models/chatcompletionchunk.ts +169 -0
- package/src/models/chatcompletionchunkchoice.ts +139 -0
- package/src/models/{chatstreamingmessagechunk.ts → chatcompletionchunkchoicedelta.ts} +36 -30
- package/src/models/chatcompletionchunkchoicedeltatoolcall.ts +166 -0
- package/src/models/chatcompletionerror.ts +78 -0
- package/src/models/chatcompletionmessage.ts +167 -0
- package/src/models/errorresponse.ts +15 -14
- package/src/models/errors/chatcompletionerror.ts +79 -0
- package/src/models/errors/index.ts +1 -1
- package/src/models/index.ts +9 -8
- package/src/models/message.ts +49 -151
- package/src/models/operations/getmodelsuser.ts +0 -58
- package/src/models/operations/getparametersauthorslug.ts +0 -60
- package/src/models/operations/postchatcompletions.ts +6 -8
- package/src/models/operations/postcreditscoinbase.ts +0 -60
- package/src/models/security.ts +8 -4
- package/src/models/toolmessage.ts +140 -0
- package/src/react-query/{chatSend.ts → chatGenerateResponse.ts} +30 -20
- package/src/react-query/index.ts +1 -1
- package/src/react-query/modelsGetModelsUser.ts +0 -8
- package/src/react-query/parametersGetParametersAuthorSlug.ts +0 -8
- package/src/react-query/postCreditsCoinbase.ts +0 -3
- package/src/sdk/chat.ts +11 -6
- package/src/sdk/models.ts +0 -2
- package/src/sdk/parameters.ts +0 -2
- package/src/sdk/sdk.ts +0 -2
- package/dist/commonjs/funcs/chatSend.d.ts.map +0 -1
- package/dist/commonjs/funcs/chatSend.js.map +0 -1
- package/dist/commonjs/models/chaterror.d.ts +0 -56
- package/dist/commonjs/models/chaterror.d.ts.map +0 -1
- package/dist/commonjs/models/chaterror.js +0 -99
- package/dist/commonjs/models/chaterror.js.map +0 -1
- package/dist/commonjs/models/chatresponse.d.ts +0 -43
- package/dist/commonjs/models/chatresponse.d.ts.map +0 -1
- package/dist/commonjs/models/chatresponse.js.map +0 -1
- package/dist/commonjs/models/chatresponsechoice.d.ts +0 -72
- package/dist/commonjs/models/chatresponsechoice.d.ts.map +0 -1
- package/dist/commonjs/models/chatresponsechoice.js +0 -108
- package/dist/commonjs/models/chatresponsechoice.js.map +0 -1
- package/dist/commonjs/models/chatstreamingchoice.d.ts +0 -72
- package/dist/commonjs/models/chatstreamingchoice.d.ts.map +0 -1
- package/dist/commonjs/models/chatstreamingchoice.js.map +0 -1
- package/dist/commonjs/models/chatstreamingmessagechunk.d.ts +0 -61
- package/dist/commonjs/models/chatstreamingmessagechunk.d.ts.map +0 -1
- package/dist/commonjs/models/chatstreamingmessagechunk.js.map +0 -1
- package/dist/commonjs/models/chatstreamingmessagetoolcall.d.ts +0 -62
- package/dist/commonjs/models/chatstreamingmessagetoolcall.d.ts.map +0 -1
- package/dist/commonjs/models/chatstreamingmessagetoolcall.js +0 -106
- package/dist/commonjs/models/chatstreamingmessagetoolcall.js.map +0 -1
- package/dist/commonjs/models/chatstreamingresponsechunk.d.ts +0 -97
- package/dist/commonjs/models/chatstreamingresponsechunk.d.ts.map +0 -1
- package/dist/commonjs/models/chatstreamingresponsechunk.js.map +0 -1
- package/dist/commonjs/models/errors/chaterror.d.ts +0 -37
- package/dist/commonjs/models/errors/chaterror.d.ts.map +0 -1
- package/dist/commonjs/models/errors/chaterror.js.map +0 -1
- package/dist/commonjs/models/toolresponsemessage.d.ts +0 -55
- package/dist/commonjs/models/toolresponsemessage.d.ts.map +0 -1
- package/dist/commonjs/models/toolresponsemessage.js.map +0 -1
- package/dist/commonjs/react-query/chatSend.d.ts +0 -28
- package/dist/commonjs/react-query/chatSend.d.ts.map +0 -1
- package/dist/commonjs/react-query/chatSend.js +0 -50
- package/dist/commonjs/react-query/chatSend.js.map +0 -1
- package/dist/esm/funcs/chatSend.d.ts.map +0 -1
- package/dist/esm/funcs/chatSend.js.map +0 -1
- package/dist/esm/models/chaterror.d.ts +0 -56
- package/dist/esm/models/chaterror.d.ts.map +0 -1
- package/dist/esm/models/chaterror.js +0 -59
- package/dist/esm/models/chaterror.js.map +0 -1
- package/dist/esm/models/chatresponse.d.ts +0 -43
- package/dist/esm/models/chatresponse.d.ts.map +0 -1
- package/dist/esm/models/chatresponse.js +0 -54
- package/dist/esm/models/chatresponse.js.map +0 -1
- package/dist/esm/models/chatresponsechoice.d.ts +0 -72
- package/dist/esm/models/chatresponsechoice.d.ts.map +0 -1
- package/dist/esm/models/chatresponsechoice.js +0 -70
- package/dist/esm/models/chatresponsechoice.js.map +0 -1
- package/dist/esm/models/chatstreamingchoice.d.ts +0 -72
- package/dist/esm/models/chatstreamingchoice.d.ts.map +0 -1
- package/dist/esm/models/chatstreamingchoice.js +0 -70
- package/dist/esm/models/chatstreamingchoice.js.map +0 -1
- package/dist/esm/models/chatstreamingmessagechunk.d.ts +0 -61
- package/dist/esm/models/chatstreamingmessagechunk.d.ts.map +0 -1
- package/dist/esm/models/chatstreamingmessagechunk.js.map +0 -1
- package/dist/esm/models/chatstreamingmessagetoolcall.d.ts +0 -62
- package/dist/esm/models/chatstreamingmessagetoolcall.d.ts.map +0 -1
- package/dist/esm/models/chatstreamingmessagetoolcall.js +0 -66
- package/dist/esm/models/chatstreamingmessagetoolcall.js.map +0 -1
- package/dist/esm/models/chatstreamingresponsechunk.d.ts +0 -97
- package/dist/esm/models/chatstreamingresponsechunk.d.ts.map +0 -1
- package/dist/esm/models/chatstreamingresponsechunk.js +0 -122
- package/dist/esm/models/chatstreamingresponsechunk.js.map +0 -1
- package/dist/esm/models/errors/chaterror.d.ts +0 -37
- package/dist/esm/models/errors/chaterror.d.ts.map +0 -1
- package/dist/esm/models/errors/chaterror.js +0 -48
- package/dist/esm/models/errors/chaterror.js.map +0 -1
- package/dist/esm/models/toolresponsemessage.d.ts +0 -55
- package/dist/esm/models/toolresponsemessage.d.ts.map +0 -1
- package/dist/esm/models/toolresponsemessage.js +0 -69
- package/dist/esm/models/toolresponsemessage.js.map +0 -1
- package/dist/esm/react-query/chatSend.d.ts +0 -28
- package/dist/esm/react-query/chatSend.d.ts.map +0 -1
- package/dist/esm/react-query/chatSend.js +0 -43
- package/dist/esm/react-query/chatSend.js.map +0 -1
- package/src/models/chaterror.ts +0 -114
- package/src/models/chatresponsechoice.ts +0 -132
- package/src/models/chatstreamingchoice.ts +0 -132
- package/src/models/chatstreamingmessagetoolcall.ts +0 -149
- package/src/models/chatstreamingresponsechunk.ts +0 -239
- package/src/models/errors/chaterror.ts +0 -79
- package/src/models/toolresponsemessage.ts +0 -144
|
@@ -8,11 +8,11 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
8
8
|
import { ClosedEnum } from "../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "./
|
|
11
|
+
ChatCompletionChunkChoiceDeltaToolCall,
|
|
12
|
+
ChatCompletionChunkChoiceDeltaToolCall$inboundSchema,
|
|
13
|
+
ChatCompletionChunkChoiceDeltaToolCall$Outbound,
|
|
14
|
+
ChatCompletionChunkChoiceDeltaToolCall$outboundSchema,
|
|
15
|
+
} from "./chatcompletionchunkchoicedeltatoolcall.js";
|
|
16
16
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
17
17
|
|
|
18
18
|
export const Role = {
|
|
@@ -20,12 +20,12 @@ export const Role = {
|
|
|
20
20
|
} as const;
|
|
21
21
|
export type Role = ClosedEnum<typeof Role>;
|
|
22
22
|
|
|
23
|
-
export type
|
|
23
|
+
export type ChatCompletionChunkChoiceDelta = {
|
|
24
24
|
role?: Role | undefined;
|
|
25
25
|
content?: string | null | undefined;
|
|
26
26
|
reasoning?: string | null | undefined;
|
|
27
27
|
refusal?: string | null | undefined;
|
|
28
|
-
toolCalls?: Array<
|
|
28
|
+
toolCalls?: Array<ChatCompletionChunkChoiceDeltaToolCall> | undefined;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/** @internal */
|
|
@@ -49,8 +49,8 @@ export namespace Role$ {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/** @internal */
|
|
52
|
-
export const
|
|
53
|
-
|
|
52
|
+
export const ChatCompletionChunkChoiceDelta$inboundSchema: z.ZodType<
|
|
53
|
+
ChatCompletionChunkChoiceDelta,
|
|
54
54
|
z.ZodTypeDef,
|
|
55
55
|
unknown
|
|
56
56
|
> = z.object({
|
|
@@ -58,7 +58,8 @@ export const ChatStreamingMessageChunk$inboundSchema: z.ZodType<
|
|
|
58
58
|
content: z.nullable(z.string()).optional(),
|
|
59
59
|
reasoning: z.nullable(z.string()).optional(),
|
|
60
60
|
refusal: z.nullable(z.string()).optional(),
|
|
61
|
-
tool_calls: z.array(
|
|
61
|
+
tool_calls: z.array(ChatCompletionChunkChoiceDeltaToolCall$inboundSchema)
|
|
62
|
+
.optional(),
|
|
62
63
|
}).transform((v) => {
|
|
63
64
|
return remap$(v, {
|
|
64
65
|
"tool_calls": "toolCalls",
|
|
@@ -66,25 +67,28 @@ export const ChatStreamingMessageChunk$inboundSchema: z.ZodType<
|
|
|
66
67
|
});
|
|
67
68
|
|
|
68
69
|
/** @internal */
|
|
69
|
-
export type
|
|
70
|
+
export type ChatCompletionChunkChoiceDelta$Outbound = {
|
|
70
71
|
role?: string | undefined;
|
|
71
72
|
content?: string | null | undefined;
|
|
72
73
|
reasoning?: string | null | undefined;
|
|
73
74
|
refusal?: string | null | undefined;
|
|
74
|
-
tool_calls?:
|
|
75
|
+
tool_calls?:
|
|
76
|
+
| Array<ChatCompletionChunkChoiceDeltaToolCall$Outbound>
|
|
77
|
+
| undefined;
|
|
75
78
|
};
|
|
76
79
|
|
|
77
80
|
/** @internal */
|
|
78
|
-
export const
|
|
79
|
-
|
|
81
|
+
export const ChatCompletionChunkChoiceDelta$outboundSchema: z.ZodType<
|
|
82
|
+
ChatCompletionChunkChoiceDelta$Outbound,
|
|
80
83
|
z.ZodTypeDef,
|
|
81
|
-
|
|
84
|
+
ChatCompletionChunkChoiceDelta
|
|
82
85
|
> = z.object({
|
|
83
86
|
role: Role$outboundSchema.optional(),
|
|
84
87
|
content: z.nullable(z.string()).optional(),
|
|
85
88
|
reasoning: z.nullable(z.string()).optional(),
|
|
86
89
|
refusal: z.nullable(z.string()).optional(),
|
|
87
|
-
toolCalls: z.array(
|
|
90
|
+
toolCalls: z.array(ChatCompletionChunkChoiceDeltaToolCall$outboundSchema)
|
|
91
|
+
.optional(),
|
|
88
92
|
}).transform((v) => {
|
|
89
93
|
return remap$(v, {
|
|
90
94
|
toolCalls: "tool_calls",
|
|
@@ -95,29 +99,31 @@ export const ChatStreamingMessageChunk$outboundSchema: z.ZodType<
|
|
|
95
99
|
* @internal
|
|
96
100
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
97
101
|
*/
|
|
98
|
-
export namespace
|
|
99
|
-
/** @deprecated use `
|
|
100
|
-
export const inboundSchema =
|
|
101
|
-
/** @deprecated use `
|
|
102
|
-
export const outboundSchema =
|
|
103
|
-
/** @deprecated use `
|
|
104
|
-
export type Outbound =
|
|
102
|
+
export namespace ChatCompletionChunkChoiceDelta$ {
|
|
103
|
+
/** @deprecated use `ChatCompletionChunkChoiceDelta$inboundSchema` instead. */
|
|
104
|
+
export const inboundSchema = ChatCompletionChunkChoiceDelta$inboundSchema;
|
|
105
|
+
/** @deprecated use `ChatCompletionChunkChoiceDelta$outboundSchema` instead. */
|
|
106
|
+
export const outboundSchema = ChatCompletionChunkChoiceDelta$outboundSchema;
|
|
107
|
+
/** @deprecated use `ChatCompletionChunkChoiceDelta$Outbound` instead. */
|
|
108
|
+
export type Outbound = ChatCompletionChunkChoiceDelta$Outbound;
|
|
105
109
|
}
|
|
106
110
|
|
|
107
|
-
export function
|
|
108
|
-
|
|
111
|
+
export function chatCompletionChunkChoiceDeltaToJSON(
|
|
112
|
+
chatCompletionChunkChoiceDelta: ChatCompletionChunkChoiceDelta,
|
|
109
113
|
): string {
|
|
110
114
|
return JSON.stringify(
|
|
111
|
-
|
|
115
|
+
ChatCompletionChunkChoiceDelta$outboundSchema.parse(
|
|
116
|
+
chatCompletionChunkChoiceDelta,
|
|
117
|
+
),
|
|
112
118
|
);
|
|
113
119
|
}
|
|
114
120
|
|
|
115
|
-
export function
|
|
121
|
+
export function chatCompletionChunkChoiceDeltaFromJSON(
|
|
116
122
|
jsonString: string,
|
|
117
|
-
): SafeParseResult<
|
|
123
|
+
): SafeParseResult<ChatCompletionChunkChoiceDelta, SDKValidationError> {
|
|
118
124
|
return safeParse(
|
|
119
125
|
jsonString,
|
|
120
|
-
(x) =>
|
|
121
|
-
`Failed to parse '
|
|
126
|
+
(x) => ChatCompletionChunkChoiceDelta$inboundSchema.parse(JSON.parse(x)),
|
|
127
|
+
`Failed to parse 'ChatCompletionChunkChoiceDelta' from JSON`,
|
|
122
128
|
);
|
|
123
129
|
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type ChatCompletionChunkChoiceDeltaToolCallFunction = {
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
arguments?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type ChatCompletionChunkChoiceDeltaToolCall = {
|
|
16
|
+
index: number;
|
|
17
|
+
id?: string | undefined;
|
|
18
|
+
type?: "function" | undefined;
|
|
19
|
+
function?: ChatCompletionChunkChoiceDeltaToolCallFunction | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const ChatCompletionChunkChoiceDeltaToolCallFunction$inboundSchema:
|
|
24
|
+
z.ZodType<
|
|
25
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction,
|
|
26
|
+
z.ZodTypeDef,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
name: z.string().optional(),
|
|
30
|
+
arguments: z.string().optional(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export type ChatCompletionChunkChoiceDeltaToolCallFunction$Outbound = {
|
|
35
|
+
name?: string | undefined;
|
|
36
|
+
arguments?: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const ChatCompletionChunkChoiceDeltaToolCallFunction$outboundSchema:
|
|
41
|
+
z.ZodType<
|
|
42
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction$Outbound,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction
|
|
45
|
+
> = z.object({
|
|
46
|
+
name: z.string().optional(),
|
|
47
|
+
arguments: z.string().optional(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
53
|
+
*/
|
|
54
|
+
export namespace ChatCompletionChunkChoiceDeltaToolCallFunction$ {
|
|
55
|
+
/** @deprecated use `ChatCompletionChunkChoiceDeltaToolCallFunction$inboundSchema` instead. */
|
|
56
|
+
export const inboundSchema =
|
|
57
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction$inboundSchema;
|
|
58
|
+
/** @deprecated use `ChatCompletionChunkChoiceDeltaToolCallFunction$outboundSchema` instead. */
|
|
59
|
+
export const outboundSchema =
|
|
60
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction$outboundSchema;
|
|
61
|
+
/** @deprecated use `ChatCompletionChunkChoiceDeltaToolCallFunction$Outbound` instead. */
|
|
62
|
+
export type Outbound =
|
|
63
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction$Outbound;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function chatCompletionChunkChoiceDeltaToolCallFunctionToJSON(
|
|
67
|
+
chatCompletionChunkChoiceDeltaToolCallFunction:
|
|
68
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction,
|
|
69
|
+
): string {
|
|
70
|
+
return JSON.stringify(
|
|
71
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction$outboundSchema.parse(
|
|
72
|
+
chatCompletionChunkChoiceDeltaToolCallFunction,
|
|
73
|
+
),
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function chatCompletionChunkChoiceDeltaToolCallFunctionFromJSON(
|
|
78
|
+
jsonString: string,
|
|
79
|
+
): SafeParseResult<
|
|
80
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction,
|
|
81
|
+
SDKValidationError
|
|
82
|
+
> {
|
|
83
|
+
return safeParse(
|
|
84
|
+
jsonString,
|
|
85
|
+
(x) =>
|
|
86
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction$inboundSchema.parse(
|
|
87
|
+
JSON.parse(x),
|
|
88
|
+
),
|
|
89
|
+
`Failed to parse 'ChatCompletionChunkChoiceDeltaToolCallFunction' from JSON`,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** @internal */
|
|
94
|
+
export const ChatCompletionChunkChoiceDeltaToolCall$inboundSchema: z.ZodType<
|
|
95
|
+
ChatCompletionChunkChoiceDeltaToolCall,
|
|
96
|
+
z.ZodTypeDef,
|
|
97
|
+
unknown
|
|
98
|
+
> = z.object({
|
|
99
|
+
index: z.number(),
|
|
100
|
+
id: z.string().optional(),
|
|
101
|
+
type: z.literal("function").optional(),
|
|
102
|
+
function: z.lazy(() =>
|
|
103
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction$inboundSchema
|
|
104
|
+
).optional(),
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
/** @internal */
|
|
108
|
+
export type ChatCompletionChunkChoiceDeltaToolCall$Outbound = {
|
|
109
|
+
index: number;
|
|
110
|
+
id?: string | undefined;
|
|
111
|
+
type?: "function" | undefined;
|
|
112
|
+
function?:
|
|
113
|
+
| ChatCompletionChunkChoiceDeltaToolCallFunction$Outbound
|
|
114
|
+
| undefined;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/** @internal */
|
|
118
|
+
export const ChatCompletionChunkChoiceDeltaToolCall$outboundSchema: z.ZodType<
|
|
119
|
+
ChatCompletionChunkChoiceDeltaToolCall$Outbound,
|
|
120
|
+
z.ZodTypeDef,
|
|
121
|
+
ChatCompletionChunkChoiceDeltaToolCall
|
|
122
|
+
> = z.object({
|
|
123
|
+
index: z.number(),
|
|
124
|
+
id: z.string().optional(),
|
|
125
|
+
type: z.literal("function").optional(),
|
|
126
|
+
function: z.lazy(() =>
|
|
127
|
+
ChatCompletionChunkChoiceDeltaToolCallFunction$outboundSchema
|
|
128
|
+
).optional(),
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* @internal
|
|
133
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
134
|
+
*/
|
|
135
|
+
export namespace ChatCompletionChunkChoiceDeltaToolCall$ {
|
|
136
|
+
/** @deprecated use `ChatCompletionChunkChoiceDeltaToolCall$inboundSchema` instead. */
|
|
137
|
+
export const inboundSchema =
|
|
138
|
+
ChatCompletionChunkChoiceDeltaToolCall$inboundSchema;
|
|
139
|
+
/** @deprecated use `ChatCompletionChunkChoiceDeltaToolCall$outboundSchema` instead. */
|
|
140
|
+
export const outboundSchema =
|
|
141
|
+
ChatCompletionChunkChoiceDeltaToolCall$outboundSchema;
|
|
142
|
+
/** @deprecated use `ChatCompletionChunkChoiceDeltaToolCall$Outbound` instead. */
|
|
143
|
+
export type Outbound = ChatCompletionChunkChoiceDeltaToolCall$Outbound;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function chatCompletionChunkChoiceDeltaToolCallToJSON(
|
|
147
|
+
chatCompletionChunkChoiceDeltaToolCall:
|
|
148
|
+
ChatCompletionChunkChoiceDeltaToolCall,
|
|
149
|
+
): string {
|
|
150
|
+
return JSON.stringify(
|
|
151
|
+
ChatCompletionChunkChoiceDeltaToolCall$outboundSchema.parse(
|
|
152
|
+
chatCompletionChunkChoiceDeltaToolCall,
|
|
153
|
+
),
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function chatCompletionChunkChoiceDeltaToolCallFromJSON(
|
|
158
|
+
jsonString: string,
|
|
159
|
+
): SafeParseResult<ChatCompletionChunkChoiceDeltaToolCall, SDKValidationError> {
|
|
160
|
+
return safeParse(
|
|
161
|
+
jsonString,
|
|
162
|
+
(x) =>
|
|
163
|
+
ChatCompletionChunkChoiceDeltaToolCall$inboundSchema.parse(JSON.parse(x)),
|
|
164
|
+
`Failed to parse 'ChatCompletionChunkChoiceDeltaToolCall' from JSON`,
|
|
165
|
+
);
|
|
166
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type ChatCompletionErrorError = {
|
|
11
|
+
code: string | null;
|
|
12
|
+
message: string;
|
|
13
|
+
param: string | null;
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ChatCompletionErrorError$inboundSchema: z.ZodType<
|
|
19
|
+
ChatCompletionErrorError,
|
|
20
|
+
z.ZodTypeDef,
|
|
21
|
+
unknown
|
|
22
|
+
> = z.object({
|
|
23
|
+
code: z.nullable(z.string()),
|
|
24
|
+
message: z.string(),
|
|
25
|
+
param: z.nullable(z.string()),
|
|
26
|
+
type: z.string(),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type ChatCompletionErrorError$Outbound = {
|
|
31
|
+
code: string | null;
|
|
32
|
+
message: string;
|
|
33
|
+
param: string | null;
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const ChatCompletionErrorError$outboundSchema: z.ZodType<
|
|
39
|
+
ChatCompletionErrorError$Outbound,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
ChatCompletionErrorError
|
|
42
|
+
> = z.object({
|
|
43
|
+
code: z.nullable(z.string()),
|
|
44
|
+
message: z.string(),
|
|
45
|
+
param: z.nullable(z.string()),
|
|
46
|
+
type: z.string(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
52
|
+
*/
|
|
53
|
+
export namespace ChatCompletionErrorError$ {
|
|
54
|
+
/** @deprecated use `ChatCompletionErrorError$inboundSchema` instead. */
|
|
55
|
+
export const inboundSchema = ChatCompletionErrorError$inboundSchema;
|
|
56
|
+
/** @deprecated use `ChatCompletionErrorError$outboundSchema` instead. */
|
|
57
|
+
export const outboundSchema = ChatCompletionErrorError$outboundSchema;
|
|
58
|
+
/** @deprecated use `ChatCompletionErrorError$Outbound` instead. */
|
|
59
|
+
export type Outbound = ChatCompletionErrorError$Outbound;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function chatCompletionErrorErrorToJSON(
|
|
63
|
+
chatCompletionErrorError: ChatCompletionErrorError,
|
|
64
|
+
): string {
|
|
65
|
+
return JSON.stringify(
|
|
66
|
+
ChatCompletionErrorError$outboundSchema.parse(chatCompletionErrorError),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function chatCompletionErrorErrorFromJSON(
|
|
71
|
+
jsonString: string,
|
|
72
|
+
): SafeParseResult<ChatCompletionErrorError, SDKValidationError> {
|
|
73
|
+
return safeParse(
|
|
74
|
+
jsonString,
|
|
75
|
+
(x) => ChatCompletionErrorError$inboundSchema.parse(JSON.parse(x)),
|
|
76
|
+
`Failed to parse 'ChatCompletionErrorError' from JSON`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
+
import {
|
|
10
|
+
ChatMessageContentItem,
|
|
11
|
+
ChatMessageContentItem$inboundSchema,
|
|
12
|
+
ChatMessageContentItem$Outbound,
|
|
13
|
+
ChatMessageContentItem$outboundSchema,
|
|
14
|
+
} from "./chatmessagecontentitem.js";
|
|
15
|
+
import {
|
|
16
|
+
ChatMessageToolCall,
|
|
17
|
+
ChatMessageToolCall$inboundSchema,
|
|
18
|
+
ChatMessageToolCall$Outbound,
|
|
19
|
+
ChatMessageToolCall$outboundSchema,
|
|
20
|
+
} from "./chatmessagetoolcall.js";
|
|
21
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
22
|
+
|
|
23
|
+
export type ChatCompletionMessageContent =
|
|
24
|
+
| string
|
|
25
|
+
| Array<ChatMessageContentItem>;
|
|
26
|
+
|
|
27
|
+
export type ChatCompletionMessage = {
|
|
28
|
+
role: "assistant";
|
|
29
|
+
content?: string | Array<ChatMessageContentItem> | null | undefined;
|
|
30
|
+
name?: string | undefined;
|
|
31
|
+
toolCalls?: Array<ChatMessageToolCall> | undefined;
|
|
32
|
+
refusal?: string | null | undefined;
|
|
33
|
+
reasoning?: string | null | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const ChatCompletionMessageContent$inboundSchema: z.ZodType<
|
|
38
|
+
ChatCompletionMessageContent,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
unknown
|
|
41
|
+
> = z.union([z.string(), z.array(ChatMessageContentItem$inboundSchema)]);
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export type ChatCompletionMessageContent$Outbound =
|
|
45
|
+
| string
|
|
46
|
+
| Array<ChatMessageContentItem$Outbound>;
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const ChatCompletionMessageContent$outboundSchema: z.ZodType<
|
|
50
|
+
ChatCompletionMessageContent$Outbound,
|
|
51
|
+
z.ZodTypeDef,
|
|
52
|
+
ChatCompletionMessageContent
|
|
53
|
+
> = z.union([z.string(), z.array(ChatMessageContentItem$outboundSchema)]);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
58
|
+
*/
|
|
59
|
+
export namespace ChatCompletionMessageContent$ {
|
|
60
|
+
/** @deprecated use `ChatCompletionMessageContent$inboundSchema` instead. */
|
|
61
|
+
export const inboundSchema = ChatCompletionMessageContent$inboundSchema;
|
|
62
|
+
/** @deprecated use `ChatCompletionMessageContent$outboundSchema` instead. */
|
|
63
|
+
export const outboundSchema = ChatCompletionMessageContent$outboundSchema;
|
|
64
|
+
/** @deprecated use `ChatCompletionMessageContent$Outbound` instead. */
|
|
65
|
+
export type Outbound = ChatCompletionMessageContent$Outbound;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function chatCompletionMessageContentToJSON(
|
|
69
|
+
chatCompletionMessageContent: ChatCompletionMessageContent,
|
|
70
|
+
): string {
|
|
71
|
+
return JSON.stringify(
|
|
72
|
+
ChatCompletionMessageContent$outboundSchema.parse(
|
|
73
|
+
chatCompletionMessageContent,
|
|
74
|
+
),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function chatCompletionMessageContentFromJSON(
|
|
79
|
+
jsonString: string,
|
|
80
|
+
): SafeParseResult<ChatCompletionMessageContent, SDKValidationError> {
|
|
81
|
+
return safeParse(
|
|
82
|
+
jsonString,
|
|
83
|
+
(x) => ChatCompletionMessageContent$inboundSchema.parse(JSON.parse(x)),
|
|
84
|
+
`Failed to parse 'ChatCompletionMessageContent' from JSON`,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export const ChatCompletionMessage$inboundSchema: z.ZodType<
|
|
90
|
+
ChatCompletionMessage,
|
|
91
|
+
z.ZodTypeDef,
|
|
92
|
+
unknown
|
|
93
|
+
> = z.object({
|
|
94
|
+
role: z.literal("assistant"),
|
|
95
|
+
content: z.nullable(
|
|
96
|
+
z.union([z.string(), z.array(ChatMessageContentItem$inboundSchema)]),
|
|
97
|
+
).optional(),
|
|
98
|
+
name: z.string().optional(),
|
|
99
|
+
tool_calls: z.array(ChatMessageToolCall$inboundSchema).optional(),
|
|
100
|
+
refusal: z.nullable(z.string()).optional(),
|
|
101
|
+
reasoning: z.nullable(z.string()).optional(),
|
|
102
|
+
}).transform((v) => {
|
|
103
|
+
return remap$(v, {
|
|
104
|
+
"tool_calls": "toolCalls",
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
/** @internal */
|
|
109
|
+
export type ChatCompletionMessage$Outbound = {
|
|
110
|
+
role: "assistant";
|
|
111
|
+
content?: string | Array<ChatMessageContentItem$Outbound> | null | undefined;
|
|
112
|
+
name?: string | undefined;
|
|
113
|
+
tool_calls?: Array<ChatMessageToolCall$Outbound> | undefined;
|
|
114
|
+
refusal?: string | null | undefined;
|
|
115
|
+
reasoning?: string | null | undefined;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/** @internal */
|
|
119
|
+
export const ChatCompletionMessage$outboundSchema: z.ZodType<
|
|
120
|
+
ChatCompletionMessage$Outbound,
|
|
121
|
+
z.ZodTypeDef,
|
|
122
|
+
ChatCompletionMessage
|
|
123
|
+
> = z.object({
|
|
124
|
+
role: z.literal("assistant"),
|
|
125
|
+
content: z.nullable(
|
|
126
|
+
z.union([z.string(), z.array(ChatMessageContentItem$outboundSchema)]),
|
|
127
|
+
).optional(),
|
|
128
|
+
name: z.string().optional(),
|
|
129
|
+
toolCalls: z.array(ChatMessageToolCall$outboundSchema).optional(),
|
|
130
|
+
refusal: z.nullable(z.string()).optional(),
|
|
131
|
+
reasoning: z.nullable(z.string()).optional(),
|
|
132
|
+
}).transform((v) => {
|
|
133
|
+
return remap$(v, {
|
|
134
|
+
toolCalls: "tool_calls",
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @internal
|
|
140
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
141
|
+
*/
|
|
142
|
+
export namespace ChatCompletionMessage$ {
|
|
143
|
+
/** @deprecated use `ChatCompletionMessage$inboundSchema` instead. */
|
|
144
|
+
export const inboundSchema = ChatCompletionMessage$inboundSchema;
|
|
145
|
+
/** @deprecated use `ChatCompletionMessage$outboundSchema` instead. */
|
|
146
|
+
export const outboundSchema = ChatCompletionMessage$outboundSchema;
|
|
147
|
+
/** @deprecated use `ChatCompletionMessage$Outbound` instead. */
|
|
148
|
+
export type Outbound = ChatCompletionMessage$Outbound;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function chatCompletionMessageToJSON(
|
|
152
|
+
chatCompletionMessage: ChatCompletionMessage,
|
|
153
|
+
): string {
|
|
154
|
+
return JSON.stringify(
|
|
155
|
+
ChatCompletionMessage$outboundSchema.parse(chatCompletionMessage),
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function chatCompletionMessageFromJSON(
|
|
160
|
+
jsonString: string,
|
|
161
|
+
): SafeParseResult<ChatCompletionMessage, SDKValidationError> {
|
|
162
|
+
return safeParse(
|
|
163
|
+
jsonString,
|
|
164
|
+
(x) => ChatCompletionMessage$inboundSchema.parse(JSON.parse(x)),
|
|
165
|
+
`Failed to parse 'ChatCompletionMessage' from JSON`,
|
|
166
|
+
);
|
|
167
|
+
}
|
|
@@ -9,7 +9,7 @@ import { ClosedEnum } from "../types/enums.js";
|
|
|
9
9
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
|
-
export const
|
|
12
|
+
export const Code = {
|
|
13
13
|
OneHundred: 100,
|
|
14
14
|
OneHundredAndOne: 101,
|
|
15
15
|
OneHundredAndTwo: 102,
|
|
@@ -81,10 +81,10 @@ export const CodeEnum = {
|
|
|
81
81
|
FiveHundredAndTwentyNine: 529,
|
|
82
82
|
FiveHundredAndThirty: 530,
|
|
83
83
|
} as const;
|
|
84
|
-
export type
|
|
84
|
+
export type Code = ClosedEnum<typeof Code>;
|
|
85
85
|
|
|
86
86
|
export type ErrorResponseError = {
|
|
87
|
-
code:
|
|
87
|
+
code: Code;
|
|
88
88
|
message: string;
|
|
89
89
|
metadata?: { [k: string]: any | null } | null | undefined;
|
|
90
90
|
};
|
|
@@ -98,22 +98,23 @@ export type ErrorResponse = {
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
/** @internal */
|
|
101
|
-
export const
|
|
102
|
-
|
|
101
|
+
export const Code$inboundSchema: z.ZodNativeEnum<typeof Code> = z.nativeEnum(
|
|
102
|
+
Code,
|
|
103
|
+
);
|
|
103
104
|
|
|
104
105
|
/** @internal */
|
|
105
|
-
export const
|
|
106
|
-
|
|
106
|
+
export const Code$outboundSchema: z.ZodNativeEnum<typeof Code> =
|
|
107
|
+
Code$inboundSchema;
|
|
107
108
|
|
|
108
109
|
/**
|
|
109
110
|
* @internal
|
|
110
111
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
111
112
|
*/
|
|
112
|
-
export namespace
|
|
113
|
-
/** @deprecated use `
|
|
114
|
-
export const inboundSchema =
|
|
115
|
-
/** @deprecated use `
|
|
116
|
-
export const outboundSchema =
|
|
113
|
+
export namespace Code$ {
|
|
114
|
+
/** @deprecated use `Code$inboundSchema` instead. */
|
|
115
|
+
export const inboundSchema = Code$inboundSchema;
|
|
116
|
+
/** @deprecated use `Code$outboundSchema` instead. */
|
|
117
|
+
export const outboundSchema = Code$outboundSchema;
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
/** @internal */
|
|
@@ -122,7 +123,7 @@ export const ErrorResponseError$inboundSchema: z.ZodType<
|
|
|
122
123
|
z.ZodTypeDef,
|
|
123
124
|
unknown
|
|
124
125
|
> = z.object({
|
|
125
|
-
code:
|
|
126
|
+
code: Code$inboundSchema,
|
|
126
127
|
message: z.string(),
|
|
127
128
|
metadata: z.nullable(z.record(z.nullable(z.any()))).optional(),
|
|
128
129
|
});
|
|
@@ -140,7 +141,7 @@ export const ErrorResponseError$outboundSchema: z.ZodType<
|
|
|
140
141
|
z.ZodTypeDef,
|
|
141
142
|
ErrorResponseError
|
|
142
143
|
> = z.object({
|
|
143
|
-
code:
|
|
144
|
+
code: Code$outboundSchema,
|
|
144
145
|
message: z.string(),
|
|
145
146
|
metadata: z.nullable(z.record(z.nullable(z.any()))).optional(),
|
|
146
147
|
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import * as models from "../index.js";
|
|
7
|
+
import { OpenRouterError } from "./openroutererror.js";
|
|
8
|
+
|
|
9
|
+
export type ChatCompletionErrorData = {
|
|
10
|
+
error: models.ChatCompletionErrorError;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export class ChatCompletionError extends OpenRouterError {
|
|
14
|
+
error: models.ChatCompletionErrorError;
|
|
15
|
+
|
|
16
|
+
/** The original data that was passed to this error instance. */
|
|
17
|
+
data$: ChatCompletionErrorData;
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
err: ChatCompletionErrorData,
|
|
21
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
22
|
+
) {
|
|
23
|
+
const message = err.error?.message
|
|
24
|
+
|| `API error occurred: ${JSON.stringify(err)}`;
|
|
25
|
+
super(message, httpMeta);
|
|
26
|
+
this.data$ = err;
|
|
27
|
+
this.error = err.error;
|
|
28
|
+
|
|
29
|
+
this.name = "ChatCompletionError";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const ChatCompletionError$inboundSchema: z.ZodType<
|
|
35
|
+
ChatCompletionError,
|
|
36
|
+
z.ZodTypeDef,
|
|
37
|
+
unknown
|
|
38
|
+
> = z.object({
|
|
39
|
+
error: z.lazy(() => models.ChatCompletionErrorError$inboundSchema),
|
|
40
|
+
request$: z.instanceof(Request),
|
|
41
|
+
response$: z.instanceof(Response),
|
|
42
|
+
body$: z.string(),
|
|
43
|
+
})
|
|
44
|
+
.transform((v) => {
|
|
45
|
+
return new ChatCompletionError(v, {
|
|
46
|
+
request: v.request$,
|
|
47
|
+
response: v.response$,
|
|
48
|
+
body: v.body$,
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export type ChatCompletionError$Outbound = {
|
|
54
|
+
error: models.ChatCompletionErrorError$Outbound;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const ChatCompletionError$outboundSchema: z.ZodType<
|
|
59
|
+
ChatCompletionError$Outbound,
|
|
60
|
+
z.ZodTypeDef,
|
|
61
|
+
ChatCompletionError
|
|
62
|
+
> = z.instanceof(ChatCompletionError)
|
|
63
|
+
.transform(v => v.data$)
|
|
64
|
+
.pipe(z.object({
|
|
65
|
+
error: z.lazy(() => models.ChatCompletionErrorError$outboundSchema),
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
71
|
+
*/
|
|
72
|
+
export namespace ChatCompletionError$ {
|
|
73
|
+
/** @deprecated use `ChatCompletionError$inboundSchema` instead. */
|
|
74
|
+
export const inboundSchema = ChatCompletionError$inboundSchema;
|
|
75
|
+
/** @deprecated use `ChatCompletionError$outboundSchema` instead. */
|
|
76
|
+
export const outboundSchema = ChatCompletionError$outboundSchema;
|
|
77
|
+
/** @deprecated use `ChatCompletionError$Outbound` instead. */
|
|
78
|
+
export type Outbound = ChatCompletionError$Outbound;
|
|
79
|
+
}
|