@openrouter/sdk 0.0.0-beta.5 → 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 +14 -10
- package/README.md +44 -66
- 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/{esm/funcs/embeddingsGenerate.d.ts → commonjs/funcs/embeddingsPostEmbeddings.d.ts} +2 -2
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.d.ts.map +1 -0
- package/dist/commonjs/funcs/{embeddingsGenerate.js → embeddingsPostEmbeddings.js} +5 -6
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.js.map +1 -0
- 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/{esm/funcs/providersGetProviders.d.ts → commonjs/funcs/getProviders.d.ts} +2 -5
- package/dist/commonjs/funcs/getProviders.d.ts.map +1 -0
- package/dist/commonjs/funcs/{providersGetProviders.js → getProviders.js} +5 -9
- package/dist/commonjs/funcs/getProviders.js.map +1 -0
- 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/{esm/funcs/modelGetParametersAuthorSlug.d.ts → commonjs/funcs/parametersGetParametersAuthorSlug.d.ts} +2 -2
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/commonjs/funcs/{modelGetParametersAuthorSlug.js → parametersGetParametersAuthorSlug.js} +9 -14
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.js.map +1 -0
- package/dist/{esm/funcs/creditsPostCreditsCoinbase.d.ts → commonjs/funcs/postCreditsCoinbase.d.ts} +2 -2
- package/dist/commonjs/funcs/postCreditsCoinbase.d.ts.map +1 -0
- package/dist/commonjs/funcs/{creditsPostCreditsCoinbase.js → postCreditsCoinbase.js} +9 -14
- package/dist/commonjs/funcs/postCreditsCoinbase.js.map +1 -0
- 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/index.d.ts +0 -2
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +0 -2
- package/dist/commonjs/models/operations/index.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/embeddingsPostEmbeddings.d.ts +23 -0
- package/dist/commonjs/react-query/embeddingsPostEmbeddings.d.ts.map +1 -0
- package/dist/commonjs/react-query/{embeddingsGenerate.js → embeddingsPostEmbeddings.js} +13 -13
- package/dist/commonjs/react-query/embeddingsPostEmbeddings.js.map +1 -0
- package/dist/commonjs/react-query/getProviders.d.ts +17 -0
- package/dist/commonjs/react-query/getProviders.d.ts.map +1 -0
- package/dist/commonjs/react-query/getProviders.js +63 -0
- package/dist/commonjs/react-query/getProviders.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +5 -7
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +5 -7
- 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 +38 -0
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js +88 -0
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js.map +1 -0
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts +20 -0
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts.map +1 -0
- package/dist/commonjs/react-query/postCreditsCoinbase.js +44 -0
- package/dist/commonjs/react-query/postCreditsCoinbase.js.map +1 -0
- 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/embeddings.d.ts +1 -1
- package/dist/commonjs/sdk/embeddings.d.ts.map +1 -1
- package/dist/commonjs/sdk/embeddings.js +3 -3
- package/dist/commonjs/sdk/embeddings.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 +9 -0
- package/dist/commonjs/sdk/parameters.d.ts.map +1 -0
- package/dist/commonjs/sdk/parameters.js +19 -0
- package/dist/commonjs/sdk/parameters.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +8 -12
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +14 -15
- 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/{commonjs/funcs/embeddingsGenerate.d.ts → esm/funcs/embeddingsPostEmbeddings.d.ts} +2 -2
- package/dist/esm/funcs/embeddingsPostEmbeddings.d.ts.map +1 -0
- package/dist/esm/funcs/{embeddingsGenerate.js → embeddingsPostEmbeddings.js} +4 -5
- package/dist/esm/funcs/embeddingsPostEmbeddings.js.map +1 -0
- 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/{commonjs/funcs/providersGetProviders.d.ts → esm/funcs/getProviders.d.ts} +2 -5
- package/dist/esm/funcs/getProviders.d.ts.map +1 -0
- package/dist/esm/funcs/{providersGetProviders.js → getProviders.js} +4 -8
- package/dist/esm/funcs/getProviders.js.map +1 -0
- 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/{commonjs/funcs/modelGetParametersAuthorSlug.d.ts → esm/funcs/parametersGetParametersAuthorSlug.d.ts} +2 -2
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/esm/funcs/{modelGetParametersAuthorSlug.js → parametersGetParametersAuthorSlug.js} +9 -14
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.js.map +1 -0
- package/dist/{commonjs/funcs/creditsPostCreditsCoinbase.d.ts → esm/funcs/postCreditsCoinbase.d.ts} +2 -2
- package/dist/esm/funcs/postCreditsCoinbase.d.ts.map +1 -0
- package/dist/esm/funcs/{creditsPostCreditsCoinbase.js → postCreditsCoinbase.js} +9 -14
- package/dist/esm/funcs/postCreditsCoinbase.js.map +1 -0
- 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/index.d.ts +0 -2
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +0 -2
- package/dist/esm/models/operations/index.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/embeddingsPostEmbeddings.d.ts +23 -0
- package/dist/esm/react-query/embeddingsPostEmbeddings.d.ts.map +1 -0
- package/dist/esm/react-query/{embeddingsGenerate.js → embeddingsPostEmbeddings.js} +10 -10
- package/dist/esm/react-query/embeddingsPostEmbeddings.js.map +1 -0
- package/dist/esm/react-query/getProviders.d.ts +17 -0
- package/dist/esm/react-query/getProviders.d.ts.map +1 -0
- package/dist/esm/react-query/getProviders.js +54 -0
- package/dist/esm/react-query/getProviders.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +5 -7
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +5 -7
- 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 +38 -0
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js +78 -0
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js.map +1 -0
- package/dist/esm/react-query/postCreditsCoinbase.d.ts +20 -0
- package/dist/esm/react-query/postCreditsCoinbase.d.ts.map +1 -0
- package/dist/esm/react-query/{creditsPostCreditsCoinbase.js → postCreditsCoinbase.js} +10 -10
- package/dist/esm/react-query/postCreditsCoinbase.js.map +1 -0
- 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/embeddings.d.ts +1 -1
- package/dist/esm/sdk/embeddings.d.ts.map +1 -1
- package/dist/esm/sdk/embeddings.js +3 -3
- package/dist/esm/sdk/embeddings.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 +9 -0
- package/dist/esm/sdk/parameters.d.ts.map +1 -0
- package/dist/esm/sdk/parameters.js +15 -0
- package/dist/esm/sdk/parameters.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +8 -12
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +14 -15
- 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 +14 -10
- 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 +196 -2
- package/docs/sdks/{model → parameters}/README.md +22 -19
- 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/{embeddingsGenerate.ts → embeddingsPostEmbeddings.ts} +3 -4
- 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/{providersGetProviders.ts → getProviders.ts} +3 -7
- package/src/funcs/modelsGetModels.ts +2 -3
- package/src/funcs/modelsGetModelsCount.ts +2 -3
- package/src/funcs/modelsGetModelsUser.ts +5 -15
- package/src/funcs/{modelGetParametersAuthorSlug.ts → parametersGetParametersAuthorSlug.ts} +6 -16
- package/src/funcs/{creditsPostCreditsCoinbase.ts → postCreditsCoinbase.ts} +6 -16
- 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/index.ts +0 -2
- 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/{embeddingsGenerate.ts → embeddingsPostEmbeddings.ts} +19 -18
- package/src/react-query/{providersGetProviders.ts → getProviders.ts} +27 -35
- package/src/react-query/index.ts +5 -7
- package/src/react-query/modelsGetModelsUser.ts +0 -8
- package/src/react-query/{modelGetParametersAuthorSlug.ts → parametersGetParametersAuthorSlug.ts} +34 -37
- package/src/react-query/{creditsPostCreditsCoinbase.ts → postCreditsCoinbase.ts} +18 -21
- package/src/sdk/chat.ts +11 -6
- package/src/sdk/embeddings.ts +3 -3
- package/src/sdk/models.ts +0 -2
- package/src/sdk/{model.ts → parameters.ts} +3 -5
- package/src/sdk/sdk.ts +29 -22
- package/dist/commonjs/funcs/chatSend.d.ts.map +0 -1
- package/dist/commonjs/funcs/chatSend.js.map +0 -1
- package/dist/commonjs/funcs/creditsPostCreditsCoinbase.d.ts.map +0 -1
- package/dist/commonjs/funcs/creditsPostCreditsCoinbase.js.map +0 -1
- package/dist/commonjs/funcs/embeddingsGenerate.d.ts.map +0 -1
- package/dist/commonjs/funcs/embeddingsGenerate.js.map +0 -1
- package/dist/commonjs/funcs/modelGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/commonjs/funcs/modelGetParametersAuthorSlug.js.map +0 -1
- package/dist/commonjs/funcs/oAuthPostAuthKeys.d.ts +0 -17
- package/dist/commonjs/funcs/oAuthPostAuthKeys.d.ts.map +0 -1
- package/dist/commonjs/funcs/oAuthPostAuthKeys.js +0 -116
- package/dist/commonjs/funcs/oAuthPostAuthKeys.js.map +0 -1
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.d.ts +0 -17
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.d.ts.map +0 -1
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.js +0 -116
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.js.map +0 -1
- package/dist/commonjs/funcs/providersGetProviders.d.ts.map +0 -1
- package/dist/commonjs/funcs/providersGetProviders.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/operations/postauthkeys.d.ts +0 -132
- package/dist/commonjs/models/operations/postauthkeys.d.ts.map +0 -1
- package/dist/commonjs/models/operations/postauthkeys.js +0 -175
- package/dist/commonjs/models/operations/postauthkeys.js.map +0 -1
- package/dist/commonjs/models/operations/postauthkeyscode.d.ts +0 -167
- package/dist/commonjs/models/operations/postauthkeyscode.d.ts.map +0 -1
- package/dist/commonjs/models/operations/postauthkeyscode.js +0 -210
- package/dist/commonjs/models/operations/postauthkeyscode.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/commonjs/react-query/creditsPostCreditsCoinbase.d.ts +0 -21
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.d.ts.map +0 -1
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.js +0 -44
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.js.map +0 -1
- package/dist/commonjs/react-query/embeddingsGenerate.d.ts +0 -23
- package/dist/commonjs/react-query/embeddingsGenerate.d.ts.map +0 -1
- package/dist/commonjs/react-query/embeddingsGenerate.js.map +0 -1
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.d.ts +0 -38
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.js +0 -88
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.js.map +0 -1
- package/dist/commonjs/react-query/oAuthPostAuthKeys.d.ts +0 -23
- package/dist/commonjs/react-query/oAuthPostAuthKeys.d.ts.map +0 -1
- package/dist/commonjs/react-query/oAuthPostAuthKeys.js +0 -47
- package/dist/commonjs/react-query/oAuthPostAuthKeys.js.map +0 -1
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.d.ts +0 -23
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.d.ts.map +0 -1
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.js +0 -47
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.js.map +0 -1
- package/dist/commonjs/react-query/providersGetProviders.d.ts +0 -23
- package/dist/commonjs/react-query/providersGetProviders.d.ts.map +0 -1
- package/dist/commonjs/react-query/providersGetProviders.js +0 -69
- package/dist/commonjs/react-query/providersGetProviders.js.map +0 -1
- package/dist/commonjs/sdk/credits.d.ts +0 -9
- package/dist/commonjs/sdk/credits.d.ts.map +0 -1
- package/dist/commonjs/sdk/credits.js +0 -19
- package/dist/commonjs/sdk/credits.js.map +0 -1
- package/dist/commonjs/sdk/model.d.ts +0 -9
- package/dist/commonjs/sdk/model.d.ts.map +0 -1
- package/dist/commonjs/sdk/model.js +0 -19
- package/dist/commonjs/sdk/model.js.map +0 -1
- package/dist/commonjs/sdk/oauth.d.ts +0 -19
- package/dist/commonjs/sdk/oauth.d.ts.map +0 -1
- package/dist/commonjs/sdk/oauth.js +0 -32
- package/dist/commonjs/sdk/oauth.js.map +0 -1
- package/dist/commonjs/sdk/providers.d.ts +0 -9
- package/dist/commonjs/sdk/providers.d.ts.map +0 -1
- package/dist/commonjs/sdk/providers.js +0 -19
- package/dist/commonjs/sdk/providers.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/funcs/creditsPostCreditsCoinbase.d.ts.map +0 -1
- package/dist/esm/funcs/creditsPostCreditsCoinbase.js.map +0 -1
- package/dist/esm/funcs/embeddingsGenerate.d.ts.map +0 -1
- package/dist/esm/funcs/embeddingsGenerate.js.map +0 -1
- package/dist/esm/funcs/modelGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/esm/funcs/modelGetParametersAuthorSlug.js.map +0 -1
- package/dist/esm/funcs/oAuthPostAuthKeys.d.ts +0 -17
- package/dist/esm/funcs/oAuthPostAuthKeys.d.ts.map +0 -1
- package/dist/esm/funcs/oAuthPostAuthKeys.js +0 -80
- package/dist/esm/funcs/oAuthPostAuthKeys.js.map +0 -1
- package/dist/esm/funcs/oAuthPostAuthKeysCode.d.ts +0 -17
- package/dist/esm/funcs/oAuthPostAuthKeysCode.d.ts.map +0 -1
- package/dist/esm/funcs/oAuthPostAuthKeysCode.js +0 -80
- package/dist/esm/funcs/oAuthPostAuthKeysCode.js.map +0 -1
- package/dist/esm/funcs/providersGetProviders.d.ts.map +0 -1
- package/dist/esm/funcs/providersGetProviders.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/operations/postauthkeys.d.ts +0 -132
- package/dist/esm/models/operations/postauthkeys.d.ts.map +0 -1
- package/dist/esm/models/operations/postauthkeys.js +0 -133
- package/dist/esm/models/operations/postauthkeys.js.map +0 -1
- package/dist/esm/models/operations/postauthkeyscode.d.ts +0 -167
- package/dist/esm/models/operations/postauthkeyscode.d.ts.map +0 -1
- package/dist/esm/models/operations/postauthkeyscode.js +0 -166
- package/dist/esm/models/operations/postauthkeyscode.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/dist/esm/react-query/creditsPostCreditsCoinbase.d.ts +0 -21
- package/dist/esm/react-query/creditsPostCreditsCoinbase.d.ts.map +0 -1
- package/dist/esm/react-query/creditsPostCreditsCoinbase.js.map +0 -1
- package/dist/esm/react-query/embeddingsGenerate.d.ts +0 -23
- package/dist/esm/react-query/embeddingsGenerate.d.ts.map +0 -1
- package/dist/esm/react-query/embeddingsGenerate.js.map +0 -1
- package/dist/esm/react-query/modelGetParametersAuthorSlug.d.ts +0 -38
- package/dist/esm/react-query/modelGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/esm/react-query/modelGetParametersAuthorSlug.js +0 -78
- package/dist/esm/react-query/modelGetParametersAuthorSlug.js.map +0 -1
- package/dist/esm/react-query/oAuthPostAuthKeys.d.ts +0 -23
- package/dist/esm/react-query/oAuthPostAuthKeys.d.ts.map +0 -1
- package/dist/esm/react-query/oAuthPostAuthKeys.js +0 -42
- package/dist/esm/react-query/oAuthPostAuthKeys.js.map +0 -1
- package/dist/esm/react-query/oAuthPostAuthKeysCode.d.ts +0 -23
- package/dist/esm/react-query/oAuthPostAuthKeysCode.d.ts.map +0 -1
- package/dist/esm/react-query/oAuthPostAuthKeysCode.js +0 -42
- package/dist/esm/react-query/oAuthPostAuthKeysCode.js.map +0 -1
- package/dist/esm/react-query/providersGetProviders.d.ts +0 -23
- package/dist/esm/react-query/providersGetProviders.d.ts.map +0 -1
- package/dist/esm/react-query/providersGetProviders.js +0 -60
- package/dist/esm/react-query/providersGetProviders.js.map +0 -1
- package/dist/esm/sdk/credits.d.ts +0 -9
- package/dist/esm/sdk/credits.d.ts.map +0 -1
- package/dist/esm/sdk/credits.js +0 -15
- package/dist/esm/sdk/credits.js.map +0 -1
- package/dist/esm/sdk/model.d.ts +0 -9
- package/dist/esm/sdk/model.d.ts.map +0 -1
- package/dist/esm/sdk/model.js +0 -15
- package/dist/esm/sdk/model.js.map +0 -1
- package/dist/esm/sdk/oauth.d.ts +0 -19
- package/dist/esm/sdk/oauth.d.ts.map +0 -1
- package/dist/esm/sdk/oauth.js +0 -28
- package/dist/esm/sdk/oauth.js.map +0 -1
- package/dist/esm/sdk/providers.d.ts +0 -9
- package/dist/esm/sdk/providers.d.ts.map +0 -1
- package/dist/esm/sdk/providers.js +0 -15
- package/dist/esm/sdk/providers.js.map +0 -1
- package/docs/sdks/credits/README.md +0 -95
- package/docs/sdks/oauth/README.md +0 -199
- package/docs/sdks/providers/README.md +0 -104
- package/src/funcs/oAuthPostAuthKeys.ts +0 -164
- package/src/funcs/oAuthPostAuthKeysCode.ts +0 -164
- 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/operations/postauthkeys.ts +0 -272
- package/src/models/operations/postauthkeyscode.ts +0 -352
- package/src/models/toolresponsemessage.ts +0 -144
- package/src/react-query/oAuthPostAuthKeys.ts +0 -88
- package/src/react-query/oAuthPostAuthKeysCode.ts +0 -89
- package/src/sdk/credits.ts +0 -26
- package/src/sdk/oauth.ts +0 -45
- package/src/sdk/providers.ts +0 -22
|
@@ -101,8 +101,7 @@ async function $do(
|
|
|
101
101
|
Accept: "application/json",
|
|
102
102
|
}));
|
|
103
103
|
|
|
104
|
-
const
|
|
105
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
104
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
106
105
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
107
106
|
|
|
108
107
|
const context = {
|
|
@@ -113,7 +112,7 @@ async function $do(
|
|
|
113
112
|
|
|
114
113
|
resolvedSecurity: requestSecurity,
|
|
115
114
|
|
|
116
|
-
securitySource: client._options.
|
|
115
|
+
securitySource: client._options.security,
|
|
117
116
|
retryConfig: options?.retries
|
|
118
117
|
|| client._options.retryConfig
|
|
119
118
|
|| { strategy: "none" },
|
|
@@ -92,8 +92,7 @@ async function $do(
|
|
|
92
92
|
Accept: "application/json",
|
|
93
93
|
}));
|
|
94
94
|
|
|
95
|
-
const
|
|
96
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
95
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
97
96
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
98
97
|
|
|
99
98
|
const context = {
|
|
@@ -104,7 +103,7 @@ async function $do(
|
|
|
104
103
|
|
|
105
104
|
resolvedSecurity: requestSecurity,
|
|
106
105
|
|
|
107
|
-
securitySource: client._options.
|
|
106
|
+
securitySource: client._options.security,
|
|
108
107
|
retryConfig: options?.retries
|
|
109
108
|
|| client._options.retryConfig
|
|
110
109
|
|| { strategy: "none" },
|
package/src/funcs/getCredits.ts
CHANGED
|
@@ -72,8 +72,7 @@ async function $do(
|
|
|
72
72
|
Accept: "application/json",
|
|
73
73
|
}));
|
|
74
74
|
|
|
75
|
-
const
|
|
76
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
75
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
77
76
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
78
77
|
|
|
79
78
|
const context = {
|
|
@@ -84,7 +83,7 @@ async function $do(
|
|
|
84
83
|
|
|
85
84
|
resolvedSecurity: requestSecurity,
|
|
86
85
|
|
|
87
|
-
securitySource: client._options.
|
|
86
|
+
securitySource: client._options.security,
|
|
88
87
|
retryConfig: options?.retries
|
|
89
88
|
|| client._options.retryConfig
|
|
90
89
|
|| { strategy: "none" },
|
|
@@ -23,10 +23,7 @@ import * as operations from "../models/operations/index.js";
|
|
|
23
23
|
import { APICall, APIPromise } from "../types/async.js";
|
|
24
24
|
import { Result } from "../types/fp.js";
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
* List all available model providers
|
|
28
|
-
*/
|
|
29
|
-
export function providersGetProviders(
|
|
26
|
+
export function getProviders(
|
|
30
27
|
client: OpenRouterCore,
|
|
31
28
|
options?: RequestOptions,
|
|
32
29
|
): APIPromise<
|
|
@@ -75,8 +72,7 @@ async function $do(
|
|
|
75
72
|
Accept: "application/json",
|
|
76
73
|
}));
|
|
77
74
|
|
|
78
|
-
const
|
|
79
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
75
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
80
76
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
81
77
|
|
|
82
78
|
const context = {
|
|
@@ -87,7 +83,7 @@ async function $do(
|
|
|
87
83
|
|
|
88
84
|
resolvedSecurity: requestSecurity,
|
|
89
85
|
|
|
90
|
-
securitySource: client._options.
|
|
86
|
+
securitySource: client._options.security,
|
|
91
87
|
retryConfig: options?.retries
|
|
92
88
|
|| client._options.retryConfig
|
|
93
89
|
|| { strategy: "none" },
|
|
@@ -102,8 +102,7 @@ async function $do(
|
|
|
102
102
|
|| "application/json;q=1, application/rss+xml;q=0",
|
|
103
103
|
}));
|
|
104
104
|
|
|
105
|
-
const
|
|
106
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
105
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
107
106
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
108
107
|
|
|
109
108
|
const context = {
|
|
@@ -114,7 +113,7 @@ async function $do(
|
|
|
114
113
|
|
|
115
114
|
resolvedSecurity: requestSecurity,
|
|
116
115
|
|
|
117
|
-
securitySource: client._options.
|
|
116
|
+
securitySource: client._options.security,
|
|
118
117
|
retryConfig: options?.retries
|
|
119
118
|
|| client._options.retryConfig
|
|
120
119
|
|| { strategy: "none" },
|
|
@@ -72,8 +72,7 @@ async function $do(
|
|
|
72
72
|
Accept: "application/json",
|
|
73
73
|
}));
|
|
74
74
|
|
|
75
|
-
const
|
|
76
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
75
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
77
76
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
78
77
|
|
|
79
78
|
const context = {
|
|
@@ -84,7 +83,7 @@ async function $do(
|
|
|
84
83
|
|
|
85
84
|
resolvedSecurity: requestSecurity,
|
|
86
85
|
|
|
87
|
-
securitySource: client._options.
|
|
86
|
+
securitySource: client._options.security,
|
|
88
87
|
retryConfig: options?.retries
|
|
89
88
|
|| client._options.retryConfig
|
|
90
89
|
|| { strategy: "none" },
|
|
@@ -6,7 +6,7 @@ import { OpenRouterCore } from "../core.js";
|
|
|
6
6
|
import * as M from "../lib/matchers.js";
|
|
7
7
|
import { compactMap } from "../lib/primitives.js";
|
|
8
8
|
import { RequestOptions } from "../lib/sdks.js";
|
|
9
|
-
import {
|
|
9
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
10
10
|
import { pathToFunc } from "../lib/url.js";
|
|
11
11
|
import {
|
|
12
12
|
ConnectionError,
|
|
@@ -27,7 +27,6 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
*/
|
|
28
28
|
export function modelsGetModelsUser(
|
|
29
29
|
client: OpenRouterCore,
|
|
30
|
-
security: operations.GetModelsUserSecurity,
|
|
31
30
|
options?: RequestOptions,
|
|
32
31
|
): APIPromise<
|
|
33
32
|
Result<
|
|
@@ -44,14 +43,12 @@ export function modelsGetModelsUser(
|
|
|
44
43
|
> {
|
|
45
44
|
return new APIPromise($do(
|
|
46
45
|
client,
|
|
47
|
-
security,
|
|
48
46
|
options,
|
|
49
47
|
));
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
async function $do(
|
|
53
51
|
client: OpenRouterCore,
|
|
54
|
-
security: operations.GetModelsUserSecurity,
|
|
55
52
|
options?: RequestOptions,
|
|
56
53
|
): Promise<
|
|
57
54
|
[
|
|
@@ -75,25 +72,18 @@ async function $do(
|
|
|
75
72
|
Accept: "application/json",
|
|
76
73
|
}));
|
|
77
74
|
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
{
|
|
81
|
-
fieldName: "Authorization",
|
|
82
|
-
type: "apiKey:header",
|
|
83
|
-
value: security?.bearer,
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
);
|
|
75
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
76
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
87
77
|
|
|
88
78
|
const context = {
|
|
89
79
|
options: client._options,
|
|
90
80
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
91
81
|
operationID: "get_/models/user",
|
|
92
|
-
oAuth2Scopes:
|
|
82
|
+
oAuth2Scopes: [],
|
|
93
83
|
|
|
94
84
|
resolvedSecurity: requestSecurity,
|
|
95
85
|
|
|
96
|
-
securitySource: security,
|
|
86
|
+
securitySource: client._options.security,
|
|
97
87
|
retryConfig: options?.retries
|
|
98
88
|
|| client._options.retryConfig
|
|
99
89
|
|| { strategy: "none" },
|
|
@@ -8,7 +8,7 @@ import * as M from "../lib/matchers.js";
|
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import {
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
12
|
import { pathToFunc } from "../lib/url.js";
|
|
13
13
|
import {
|
|
14
14
|
ConnectionError,
|
|
@@ -27,9 +27,8 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
/**
|
|
28
28
|
* Get a model's supported parameters and data about which are most popular
|
|
29
29
|
*/
|
|
30
|
-
export function
|
|
30
|
+
export function parametersGetParametersAuthorSlug(
|
|
31
31
|
client: OpenRouterCore,
|
|
32
|
-
security: operations.GetParametersAuthorSlugSecurity,
|
|
33
32
|
request: operations.GetParametersAuthorSlugRequest,
|
|
34
33
|
options?: RequestOptions,
|
|
35
34
|
): APIPromise<
|
|
@@ -47,7 +46,6 @@ export function modelGetParametersAuthorSlug(
|
|
|
47
46
|
> {
|
|
48
47
|
return new APIPromise($do(
|
|
49
48
|
client,
|
|
50
|
-
security,
|
|
51
49
|
request,
|
|
52
50
|
options,
|
|
53
51
|
));
|
|
@@ -55,7 +53,6 @@ export function modelGetParametersAuthorSlug(
|
|
|
55
53
|
|
|
56
54
|
async function $do(
|
|
57
55
|
client: OpenRouterCore,
|
|
58
|
-
security: operations.GetParametersAuthorSlugSecurity,
|
|
59
56
|
request: operations.GetParametersAuthorSlugRequest,
|
|
60
57
|
options?: RequestOptions,
|
|
61
58
|
): Promise<
|
|
@@ -107,25 +104,18 @@ async function $do(
|
|
|
107
104
|
Accept: "application/json",
|
|
108
105
|
}));
|
|
109
106
|
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
{
|
|
113
|
-
fieldName: "Authorization",
|
|
114
|
-
type: "apiKey:header",
|
|
115
|
-
value: security?.bearer,
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
);
|
|
107
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
108
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
119
109
|
|
|
120
110
|
const context = {
|
|
121
111
|
options: client._options,
|
|
122
112
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
123
113
|
operationID: "get_/parameters/{author}/{slug}",
|
|
124
|
-
oAuth2Scopes:
|
|
114
|
+
oAuth2Scopes: [],
|
|
125
115
|
|
|
126
116
|
resolvedSecurity: requestSecurity,
|
|
127
117
|
|
|
128
|
-
securitySource: security,
|
|
118
|
+
securitySource: client._options.security,
|
|
129
119
|
retryConfig: options?.retries
|
|
130
120
|
|| client._options.retryConfig
|
|
131
121
|
|| { strategy: "none" },
|
|
@@ -8,7 +8,7 @@ import * as M from "../lib/matchers.js";
|
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import {
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
12
|
import { pathToFunc } from "../lib/url.js";
|
|
13
13
|
import {
|
|
14
14
|
ConnectionError,
|
|
@@ -27,9 +27,8 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
/**
|
|
28
28
|
* Create a Coinbase charge for crypto payment
|
|
29
29
|
*/
|
|
30
|
-
export function
|
|
30
|
+
export function postCreditsCoinbase(
|
|
31
31
|
client: OpenRouterCore,
|
|
32
|
-
security: operations.PostCreditsCoinbaseSecurity,
|
|
33
32
|
request?: operations.PostCreditsCoinbaseRequest | undefined,
|
|
34
33
|
options?: RequestOptions,
|
|
35
34
|
): APIPromise<
|
|
@@ -47,7 +46,6 @@ export function creditsPostCreditsCoinbase(
|
|
|
47
46
|
> {
|
|
48
47
|
return new APIPromise($do(
|
|
49
48
|
client,
|
|
50
|
-
security,
|
|
51
49
|
request,
|
|
52
50
|
options,
|
|
53
51
|
));
|
|
@@ -55,7 +53,6 @@ export function creditsPostCreditsCoinbase(
|
|
|
55
53
|
|
|
56
54
|
async function $do(
|
|
57
55
|
client: OpenRouterCore,
|
|
58
|
-
security: operations.PostCreditsCoinbaseSecurity,
|
|
59
56
|
request?: operations.PostCreditsCoinbaseRequest | undefined,
|
|
60
57
|
options?: RequestOptions,
|
|
61
58
|
): Promise<
|
|
@@ -97,25 +94,18 @@ async function $do(
|
|
|
97
94
|
Accept: "application/json",
|
|
98
95
|
}));
|
|
99
96
|
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
{
|
|
103
|
-
fieldName: "Authorization",
|
|
104
|
-
type: "apiKey:header",
|
|
105
|
-
value: security?.bearer,
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
);
|
|
97
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
98
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
109
99
|
|
|
110
100
|
const context = {
|
|
111
101
|
options: client._options,
|
|
112
102
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
103
|
operationID: "post_/credits/coinbase",
|
|
114
|
-
oAuth2Scopes:
|
|
104
|
+
oAuth2Scopes: [],
|
|
115
105
|
|
|
116
106
|
resolvedSecurity: requestSecurity,
|
|
117
107
|
|
|
118
|
-
securitySource: security,
|
|
108
|
+
securitySource: client._options.security,
|
|
119
109
|
retryConfig: options?.retries
|
|
120
110
|
|| client._options.retryConfig
|
|
121
111
|
|| { strategy: "none" },
|
package/src/lib/config.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import * as models from "../models/index.js";
|
|
5
6
|
import { HTTPClient } from "./http.js";
|
|
6
7
|
import { Logger } from "./logger.js";
|
|
7
8
|
import { RetryConfig } from "./retries.js";
|
|
@@ -19,7 +20,10 @@ export const ServerList = {
|
|
|
19
20
|
} as const;
|
|
20
21
|
|
|
21
22
|
export type SDKOptions = {
|
|
22
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The security details required to authenticate the SDK
|
|
25
|
+
*/
|
|
26
|
+
security?: models.Security | (() => Promise<models.Security>) | undefined;
|
|
23
27
|
|
|
24
28
|
httpClient?: HTTPClient;
|
|
25
29
|
/**
|
|
@@ -59,8 +63,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
59
63
|
export const SDK_METADATA = {
|
|
60
64
|
language: "typescript",
|
|
61
65
|
openapiDocVersion: "1.0.0",
|
|
62
|
-
sdkVersion: "0.0.0-beta.
|
|
63
|
-
genVersion: "2.
|
|
66
|
+
sdkVersion: "0.0.0-beta.7",
|
|
67
|
+
genVersion: "2.715.0",
|
|
64
68
|
userAgent:
|
|
65
|
-
"speakeasy-sdk/typescript 0.0.0-beta.
|
|
69
|
+
"speakeasy-sdk/typescript 0.0.0-beta.7 2.715.0 1.0.0 @openrouter/sdk",
|
|
66
70
|
} as const;
|
package/src/lib/env.ts
CHANGED
|
@@ -7,13 +7,15 @@ import { dlv } from "./dlv.js";
|
|
|
7
7
|
import * as z from "zod";
|
|
8
8
|
|
|
9
9
|
export interface Env {
|
|
10
|
-
|
|
10
|
+
OPENROUTER_API_KEY_AUTH?: string | undefined;
|
|
11
|
+
OPENROUTER_BEARER_AUTH?: string | undefined;
|
|
11
12
|
|
|
12
13
|
OPENROUTER_DEBUG?: boolean | undefined;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export const envSchema: z.ZodType<Env, z.ZodTypeDef, unknown> = z.object({
|
|
16
|
-
|
|
17
|
+
OPENROUTER_API_KEY_AUTH: z.string().optional(),
|
|
18
|
+
OPENROUTER_BEARER_AUTH: z.string().optional(),
|
|
17
19
|
|
|
18
20
|
OPENROUTER_DEBUG: z.coerce.boolean().optional(),
|
|
19
21
|
});
|
package/src/lib/security.ts
CHANGED
|
@@ -243,11 +243,18 @@ export function resolveGlobalSecurity(
|
|
|
243
243
|
security: Partial<models.Security> | null | undefined,
|
|
244
244
|
): SecurityState | null {
|
|
245
245
|
return resolveSecurity(
|
|
246
|
+
[
|
|
247
|
+
{
|
|
248
|
+
fieldName: "Authorization",
|
|
249
|
+
type: "apiKey:header",
|
|
250
|
+
value: security?.apiKeyAuth ?? env().OPENROUTER_API_KEY_AUTH,
|
|
251
|
+
},
|
|
252
|
+
],
|
|
246
253
|
[
|
|
247
254
|
{
|
|
248
255
|
fieldName: "Authorization",
|
|
249
256
|
type: "http:bearer",
|
|
250
|
-
value: security?.
|
|
257
|
+
value: security?.bearerAuth ?? env().OPENROUTER_BEARER_AUTH,
|
|
251
258
|
},
|
|
252
259
|
],
|
|
253
260
|
);
|
|
@@ -6,42 +6,42 @@ import * as z from "zod";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
+
import {
|
|
10
|
+
ChatCompletionChoice,
|
|
11
|
+
ChatCompletionChoice$inboundSchema,
|
|
12
|
+
ChatCompletionChoice$Outbound,
|
|
13
|
+
ChatCompletionChoice$outboundSchema,
|
|
14
|
+
} from "./chatcompletionchoice.js";
|
|
9
15
|
import {
|
|
10
16
|
ChatGenerationTokenUsage,
|
|
11
17
|
ChatGenerationTokenUsage$inboundSchema,
|
|
12
18
|
ChatGenerationTokenUsage$Outbound,
|
|
13
19
|
ChatGenerationTokenUsage$outboundSchema,
|
|
14
20
|
} from "./chatgenerationtokenusage.js";
|
|
15
|
-
import {
|
|
16
|
-
ChatResponseChoice,
|
|
17
|
-
ChatResponseChoice$inboundSchema,
|
|
18
|
-
ChatResponseChoice$Outbound,
|
|
19
|
-
ChatResponseChoice$outboundSchema,
|
|
20
|
-
} from "./chatresponsechoice.js";
|
|
21
21
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
22
22
|
|
|
23
|
-
export type
|
|
23
|
+
export type ChatCompletion = {
|
|
24
24
|
id: string;
|
|
25
|
-
choices: Array<
|
|
25
|
+
choices: Array<ChatCompletionChoice>;
|
|
26
26
|
created: number;
|
|
27
27
|
model: string;
|
|
28
28
|
object: "chat.completion";
|
|
29
|
-
systemFingerprint?: string |
|
|
29
|
+
systemFingerprint?: string | undefined;
|
|
30
30
|
usage?: ChatGenerationTokenUsage | undefined;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
/** @internal */
|
|
34
|
-
export const
|
|
35
|
-
|
|
34
|
+
export const ChatCompletion$inboundSchema: z.ZodType<
|
|
35
|
+
ChatCompletion,
|
|
36
36
|
z.ZodTypeDef,
|
|
37
37
|
unknown
|
|
38
38
|
> = z.object({
|
|
39
39
|
id: z.string(),
|
|
40
|
-
choices: z.array(
|
|
40
|
+
choices: z.array(ChatCompletionChoice$inboundSchema),
|
|
41
41
|
created: z.number(),
|
|
42
42
|
model: z.string(),
|
|
43
43
|
object: z.literal("chat.completion"),
|
|
44
|
-
system_fingerprint: z.
|
|
44
|
+
system_fingerprint: z.string().optional(),
|
|
45
45
|
usage: ChatGenerationTokenUsage$inboundSchema.optional(),
|
|
46
46
|
}).transform((v) => {
|
|
47
47
|
return remap$(v, {
|
|
@@ -50,28 +50,28 @@ export const ChatResponse$inboundSchema: z.ZodType<
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
/** @internal */
|
|
53
|
-
export type
|
|
53
|
+
export type ChatCompletion$Outbound = {
|
|
54
54
|
id: string;
|
|
55
|
-
choices: Array<
|
|
55
|
+
choices: Array<ChatCompletionChoice$Outbound>;
|
|
56
56
|
created: number;
|
|
57
57
|
model: string;
|
|
58
58
|
object: "chat.completion";
|
|
59
|
-
system_fingerprint?: string |
|
|
59
|
+
system_fingerprint?: string | undefined;
|
|
60
60
|
usage?: ChatGenerationTokenUsage$Outbound | undefined;
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
/** @internal */
|
|
64
|
-
export const
|
|
65
|
-
|
|
64
|
+
export const ChatCompletion$outboundSchema: z.ZodType<
|
|
65
|
+
ChatCompletion$Outbound,
|
|
66
66
|
z.ZodTypeDef,
|
|
67
|
-
|
|
67
|
+
ChatCompletion
|
|
68
68
|
> = z.object({
|
|
69
69
|
id: z.string(),
|
|
70
|
-
choices: z.array(
|
|
70
|
+
choices: z.array(ChatCompletionChoice$outboundSchema),
|
|
71
71
|
created: z.number(),
|
|
72
72
|
model: z.string(),
|
|
73
73
|
object: z.literal("chat.completion"),
|
|
74
|
-
systemFingerprint: z.
|
|
74
|
+
systemFingerprint: z.string().optional(),
|
|
75
75
|
usage: ChatGenerationTokenUsage$outboundSchema.optional(),
|
|
76
76
|
}).transform((v) => {
|
|
77
77
|
return remap$(v, {
|
|
@@ -83,25 +83,25 @@ export const ChatResponse$outboundSchema: z.ZodType<
|
|
|
83
83
|
* @internal
|
|
84
84
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
85
85
|
*/
|
|
86
|
-
export namespace
|
|
87
|
-
/** @deprecated use `
|
|
88
|
-
export const inboundSchema =
|
|
89
|
-
/** @deprecated use `
|
|
90
|
-
export const outboundSchema =
|
|
91
|
-
/** @deprecated use `
|
|
92
|
-
export type Outbound =
|
|
86
|
+
export namespace ChatCompletion$ {
|
|
87
|
+
/** @deprecated use `ChatCompletion$inboundSchema` instead. */
|
|
88
|
+
export const inboundSchema = ChatCompletion$inboundSchema;
|
|
89
|
+
/** @deprecated use `ChatCompletion$outboundSchema` instead. */
|
|
90
|
+
export const outboundSchema = ChatCompletion$outboundSchema;
|
|
91
|
+
/** @deprecated use `ChatCompletion$Outbound` instead. */
|
|
92
|
+
export type Outbound = ChatCompletion$Outbound;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
export function
|
|
96
|
-
return JSON.stringify(
|
|
95
|
+
export function chatCompletionToJSON(chatCompletion: ChatCompletion): string {
|
|
96
|
+
return JSON.stringify(ChatCompletion$outboundSchema.parse(chatCompletion));
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
export function
|
|
99
|
+
export function chatCompletionFromJSON(
|
|
100
100
|
jsonString: string,
|
|
101
|
-
): SafeParseResult<
|
|
101
|
+
): SafeParseResult<ChatCompletion, SDKValidationError> {
|
|
102
102
|
return safeParse(
|
|
103
103
|
jsonString,
|
|
104
|
-
(x) =>
|
|
105
|
-
`Failed to parse '
|
|
104
|
+
(x) => ChatCompletion$inboundSchema.parse(JSON.parse(x)),
|
|
105
|
+
`Failed to parse 'ChatCompletion' from JSON`,
|
|
106
106
|
);
|
|
107
107
|
}
|
|
@@ -0,0 +1,132 @@
|
|
|
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 { ClosedEnum } from "../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
|
+
import {
|
|
11
|
+
ChatCompletionMessage,
|
|
12
|
+
ChatCompletionMessage$inboundSchema,
|
|
13
|
+
ChatCompletionMessage$Outbound,
|
|
14
|
+
ChatCompletionMessage$outboundSchema,
|
|
15
|
+
} from "./chatcompletionmessage.js";
|
|
16
|
+
import {
|
|
17
|
+
ChatMessageTokenLogprobs,
|
|
18
|
+
ChatMessageTokenLogprobs$inboundSchema,
|
|
19
|
+
ChatMessageTokenLogprobs$Outbound,
|
|
20
|
+
ChatMessageTokenLogprobs$outboundSchema,
|
|
21
|
+
} from "./chatmessagetokenlogprobs.js";
|
|
22
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
23
|
+
|
|
24
|
+
export const ChatCompletionChoiceFinishReason = {
|
|
25
|
+
ToolCalls: "tool_calls",
|
|
26
|
+
Stop: "stop",
|
|
27
|
+
Length: "length",
|
|
28
|
+
ContentFilter: "content_filter",
|
|
29
|
+
Error: "error",
|
|
30
|
+
} as const;
|
|
31
|
+
export type ChatCompletionChoiceFinishReason = ClosedEnum<
|
|
32
|
+
typeof ChatCompletionChoiceFinishReason
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
export type ChatCompletionChoice = {
|
|
36
|
+
finishReason: ChatCompletionChoiceFinishReason | null;
|
|
37
|
+
index: number;
|
|
38
|
+
message: ChatCompletionMessage;
|
|
39
|
+
logprobs?: ChatMessageTokenLogprobs | null | undefined;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const ChatCompletionChoiceFinishReason$inboundSchema: z.ZodNativeEnum<
|
|
44
|
+
typeof ChatCompletionChoiceFinishReason
|
|
45
|
+
> = z.nativeEnum(ChatCompletionChoiceFinishReason);
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const ChatCompletionChoiceFinishReason$outboundSchema: z.ZodNativeEnum<
|
|
49
|
+
typeof ChatCompletionChoiceFinishReason
|
|
50
|
+
> = ChatCompletionChoiceFinishReason$inboundSchema;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
55
|
+
*/
|
|
56
|
+
export namespace ChatCompletionChoiceFinishReason$ {
|
|
57
|
+
/** @deprecated use `ChatCompletionChoiceFinishReason$inboundSchema` instead. */
|
|
58
|
+
export const inboundSchema = ChatCompletionChoiceFinishReason$inboundSchema;
|
|
59
|
+
/** @deprecated use `ChatCompletionChoiceFinishReason$outboundSchema` instead. */
|
|
60
|
+
export const outboundSchema = ChatCompletionChoiceFinishReason$outboundSchema;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** @internal */
|
|
64
|
+
export const ChatCompletionChoice$inboundSchema: z.ZodType<
|
|
65
|
+
ChatCompletionChoice,
|
|
66
|
+
z.ZodTypeDef,
|
|
67
|
+
unknown
|
|
68
|
+
> = z.object({
|
|
69
|
+
finish_reason: z.nullable(ChatCompletionChoiceFinishReason$inboundSchema),
|
|
70
|
+
index: z.number(),
|
|
71
|
+
message: ChatCompletionMessage$inboundSchema,
|
|
72
|
+
logprobs: z.nullable(ChatMessageTokenLogprobs$inboundSchema).optional(),
|
|
73
|
+
}).transform((v) => {
|
|
74
|
+
return remap$(v, {
|
|
75
|
+
"finish_reason": "finishReason",
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export type ChatCompletionChoice$Outbound = {
|
|
81
|
+
finish_reason: string | null;
|
|
82
|
+
index: number;
|
|
83
|
+
message: ChatCompletionMessage$Outbound;
|
|
84
|
+
logprobs?: ChatMessageTokenLogprobs$Outbound | null | undefined;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const ChatCompletionChoice$outboundSchema: z.ZodType<
|
|
89
|
+
ChatCompletionChoice$Outbound,
|
|
90
|
+
z.ZodTypeDef,
|
|
91
|
+
ChatCompletionChoice
|
|
92
|
+
> = z.object({
|
|
93
|
+
finishReason: z.nullable(ChatCompletionChoiceFinishReason$outboundSchema),
|
|
94
|
+
index: z.number(),
|
|
95
|
+
message: ChatCompletionMessage$outboundSchema,
|
|
96
|
+
logprobs: z.nullable(ChatMessageTokenLogprobs$outboundSchema).optional(),
|
|
97
|
+
}).transform((v) => {
|
|
98
|
+
return remap$(v, {
|
|
99
|
+
finishReason: "finish_reason",
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
106
|
+
*/
|
|
107
|
+
export namespace ChatCompletionChoice$ {
|
|
108
|
+
/** @deprecated use `ChatCompletionChoice$inboundSchema` instead. */
|
|
109
|
+
export const inboundSchema = ChatCompletionChoice$inboundSchema;
|
|
110
|
+
/** @deprecated use `ChatCompletionChoice$outboundSchema` instead. */
|
|
111
|
+
export const outboundSchema = ChatCompletionChoice$outboundSchema;
|
|
112
|
+
/** @deprecated use `ChatCompletionChoice$Outbound` instead. */
|
|
113
|
+
export type Outbound = ChatCompletionChoice$Outbound;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function chatCompletionChoiceToJSON(
|
|
117
|
+
chatCompletionChoice: ChatCompletionChoice,
|
|
118
|
+
): string {
|
|
119
|
+
return JSON.stringify(
|
|
120
|
+
ChatCompletionChoice$outboundSchema.parse(chatCompletionChoice),
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function chatCompletionChoiceFromJSON(
|
|
125
|
+
jsonString: string,
|
|
126
|
+
): SafeParseResult<ChatCompletionChoice, SDKValidationError> {
|
|
127
|
+
return safeParse(
|
|
128
|
+
jsonString,
|
|
129
|
+
(x) => ChatCompletionChoice$inboundSchema.parse(JSON.parse(x)),
|
|
130
|
+
`Failed to parse 'ChatCompletionChoice' from JSON`,
|
|
131
|
+
);
|
|
132
|
+
}
|