@mistralai/mistralai 2.0.0-alpha.1 → 2.1.0
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/README.md +51 -37
- package/RUNTIMES.md +1 -1
- package/esm/extra/structChat.d.ts.map +1 -1
- package/esm/extra/structChat.js +72 -5
- package/esm/extra/structChat.js.map +1 -1
- package/esm/funcs/audioSpeechComplete.d.ts +22 -0
- package/esm/funcs/audioSpeechComplete.d.ts.map +1 -0
- package/esm/funcs/audioSpeechComplete.js +88 -0
- package/esm/funcs/audioSpeechComplete.js.map +1 -0
- package/esm/funcs/audioVoicesCreate.d.ts +18 -0
- package/esm/funcs/audioVoicesCreate.d.ts.map +1 -0
- package/esm/funcs/audioVoicesCreate.js +83 -0
- package/esm/funcs/audioVoicesCreate.js.map +1 -0
- package/esm/funcs/audioVoicesDelete.d.ts +19 -0
- package/esm/funcs/audioVoicesDelete.d.ts.map +1 -0
- package/esm/funcs/audioVoicesDelete.js +90 -0
- package/esm/funcs/audioVoicesDelete.js.map +1 -0
- package/esm/funcs/audioVoicesGet.d.ts +19 -0
- package/esm/funcs/audioVoicesGet.d.ts.map +1 -0
- package/esm/funcs/audioVoicesGet.js +89 -0
- package/esm/funcs/audioVoicesGet.js.map +1 -0
- package/esm/funcs/audioVoicesGetSampleAudio.d.ts +18 -0
- package/esm/funcs/audioVoicesGetSampleAudio.d.ts.map +1 -0
- package/esm/funcs/audioVoicesGetSampleAudio.js +91 -0
- package/esm/funcs/audioVoicesGetSampleAudio.js.map +1 -0
- package/esm/funcs/audioVoicesList.d.ts +19 -0
- package/esm/funcs/audioVoicesList.d.ts.map +1 -0
- package/esm/funcs/audioVoicesList.js +89 -0
- package/esm/funcs/audioVoicesList.js.map +1 -0
- package/esm/funcs/audioVoicesUpdate.d.ts +19 -0
- package/esm/funcs/audioVoicesUpdate.d.ts.map +1 -0
- package/esm/funcs/audioVoicesUpdate.js +93 -0
- package/esm/funcs/audioVoicesUpdate.js.map +1 -0
- package/esm/funcs/betaConnectorsGetAuthUrl.d.ts +19 -0
- package/esm/funcs/betaConnectorsGetAuthUrl.d.ts.map +1 -0
- package/esm/funcs/betaConnectorsGetAuthUrl.js +90 -0
- package/esm/funcs/betaConnectorsGetAuthUrl.js.map +1 -0
- package/esm/funcs/betaObservabilityJudgesJudgeConversation.d.ts +16 -0
- package/esm/funcs/betaObservabilityJudgesJudgeConversation.d.ts.map +1 -0
- package/esm/funcs/betaObservabilityJudgesJudgeConversation.js +91 -0
- package/esm/funcs/betaObservabilityJudgesJudgeConversation.js.map +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/config.js.map +1 -1
- package/esm/models/components/agent.d.ts +28 -5
- package/esm/models/components/agent.d.ts.map +1 -1
- package/esm/models/components/agent.js +14 -13
- package/esm/models/components/agent.js.map +1 -1
- package/esm/models/components/agentconversation.d.ts +2 -3
- package/esm/models/components/agentconversation.d.ts.map +1 -1
- package/esm/models/components/agentconversation.js +2 -1
- package/esm/models/components/agentconversation.js.map +1 -1
- package/esm/models/components/agentscompletionrequest.d.ts +28 -2
- package/esm/models/components/agentscompletionrequest.d.ts.map +1 -1
- package/esm/models/components/agentscompletionrequest.js +66 -13
- package/esm/models/components/agentscompletionrequest.js.map +1 -1
- package/esm/models/components/agentscompletionstreamrequest.d.ts +28 -2
- package/esm/models/components/agentscompletionstreamrequest.d.ts.map +1 -1
- package/esm/models/components/agentscompletionstreamrequest.js +66 -13
- package/esm/models/components/agentscompletionstreamrequest.js.map +1 -1
- package/esm/models/components/authurlresponse.d.ts +11 -0
- package/esm/models/components/authurlresponse.d.ts.map +1 -0
- package/esm/models/components/authurlresponse.js +20 -0
- package/esm/models/components/authurlresponse.js.map +1 -0
- package/esm/models/components/basefielddefinition.d.ts +4 -4
- package/esm/models/components/basefielddefinition.d.ts.map +1 -1
- package/esm/models/components/basefielddefinition.js +3 -4
- package/esm/models/components/basefielddefinition.js.map +1 -1
- package/esm/models/components/basemodelcard.d.ts +6 -0
- package/esm/models/components/basemodelcard.d.ts.map +1 -1
- package/esm/models/components/basemodelcard.js.map +1 -1
- package/esm/models/components/chatcompletionrequest.d.ts +31 -2
- package/esm/models/components/chatcompletionrequest.d.ts.map +1 -1
- package/esm/models/components/chatcompletionrequest.js +67 -14
- package/esm/models/components/chatcompletionrequest.js.map +1 -1
- package/esm/models/components/chatcompletionstreamrequest.d.ts +31 -2
- package/esm/models/components/chatcompletionstreamrequest.d.ts.map +1 -1
- package/esm/models/components/chatcompletionstreamrequest.js +67 -14
- package/esm/models/components/chatcompletionstreamrequest.js.map +1 -1
- package/esm/models/components/codeinterpretertool.d.ts +11 -2
- package/esm/models/components/codeinterpretertool.d.ts.map +1 -1
- package/esm/models/components/codeinterpretertool.js +9 -2
- package/esm/models/components/codeinterpretertool.js.map +1 -1
- package/esm/models/components/completionargs.d.ts +3 -0
- package/esm/models/components/completionargs.d.ts.map +1 -1
- package/esm/models/components/completionargs.js +5 -0
- package/esm/models/components/completionargs.js.map +1 -1
- package/esm/models/components/conversationrequest.d.ts +55 -10
- package/esm/models/components/conversationrequest.d.ts.map +1 -1
- package/esm/models/components/conversationrequest.js +14 -13
- package/esm/models/components/conversationrequest.js.map +1 -1
- package/esm/models/components/conversationresponse.d.ts +3 -5
- package/esm/models/components/conversationresponse.d.ts.map +1 -1
- package/esm/models/components/conversationresponse.js +1 -7
- package/esm/models/components/conversationresponse.js.map +1 -1
- package/esm/models/components/conversationrestartrequest.d.ts +3 -6
- package/esm/models/components/conversationrestartrequest.d.ts.map +1 -1
- package/esm/models/components/conversationrestartrequest.js +2 -1
- package/esm/models/components/conversationrestartrequest.js.map +1 -1
- package/esm/models/components/conversationrestartstreamrequest.d.ts +3 -6
- package/esm/models/components/conversationrestartstreamrequest.d.ts.map +1 -1
- package/esm/models/components/conversationrestartstreamrequest.js +2 -1
- package/esm/models/components/conversationrestartstreamrequest.js.map +1 -1
- package/esm/models/components/conversationstreamrequest.d.ts +55 -10
- package/esm/models/components/conversationstreamrequest.d.ts.map +1 -1
- package/esm/models/components/conversationstreamrequest.js +14 -13
- package/esm/models/components/conversationstreamrequest.js.map +1 -1
- package/esm/models/components/createagentrequest.d.ts +55 -10
- package/esm/models/components/createagentrequest.d.ts.map +1 -1
- package/esm/models/components/createagentrequest.js +14 -13
- package/esm/models/components/createagentrequest.js.map +1 -1
- package/esm/models/components/customconnector.d.ts +11 -2
- package/esm/models/components/customconnector.d.ts.map +1 -1
- package/esm/models/components/customconnector.js +9 -2
- package/esm/models/components/customconnector.js.map +1 -1
- package/esm/models/components/documentlibrarytool.d.ts +11 -2
- package/esm/models/components/documentlibrarytool.d.ts.map +1 -1
- package/esm/models/components/documentlibrarytool.js +9 -2
- package/esm/models/components/documentlibrarytool.js.map +1 -1
- package/esm/models/components/ftmodelcard.d.ts +6 -0
- package/esm/models/components/ftmodelcard.d.ts.map +1 -1
- package/esm/models/components/ftmodelcard.js.map +1 -1
- package/esm/models/components/imagegenerationtool.d.ts +11 -2
- package/esm/models/components/imagegenerationtool.d.ts.map +1 -1
- package/esm/models/components/imagegenerationtool.js +9 -2
- package/esm/models/components/imagegenerationtool.js.map +1 -1
- package/esm/models/components/imageurlchunk.d.ts +1 -1
- package/esm/models/components/index.d.ts +20 -0
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +20 -0
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/instructrequest.d.ts +3 -0
- package/esm/models/components/instructrequest.d.ts.map +1 -1
- package/esm/models/components/instructrequest.js.map +1 -1
- package/esm/models/components/internalmetadata.d.ts +42 -0
- package/esm/models/components/internalmetadata.d.ts.map +1 -0
- package/esm/models/components/internalmetadata.js +56 -0
- package/esm/models/components/internalmetadata.js.map +1 -0
- package/esm/models/components/judgeconversationrequest.d.ts +22 -0
- package/esm/models/components/judgeconversationrequest.d.ts.map +1 -0
- package/esm/models/components/judgeconversationrequest.js +14 -0
- package/esm/models/components/judgeconversationrequest.js.map +1 -0
- package/esm/models/components/messagetokens.d.ts +17 -0
- package/esm/models/components/messagetokens.d.ts.map +1 -0
- package/esm/models/components/messagetokens.js +25 -0
- package/esm/models/components/messagetokens.js.map +1 -0
- package/esm/models/components/metadatadict.d.ts +23 -0
- package/esm/models/components/metadatadict.d.ts.map +1 -0
- package/esm/models/components/metadatadict.js +23 -0
- package/esm/models/components/metadatadict.js.map +1 -0
- package/esm/models/components/mirrorconfig.d.ts +24 -0
- package/esm/models/components/mirrorconfig.d.ts.map +1 -0
- package/esm/models/components/mirrorconfig.js +32 -0
- package/esm/models/components/mirrorconfig.js.map +1 -0
- package/esm/models/components/mirrorsource.d.ts +28 -0
- package/esm/models/components/mirrorsource.d.ts.map +1 -0
- package/esm/models/components/mirrorsource.js +43 -0
- package/esm/models/components/mirrorsource.js.map +1 -0
- package/esm/models/components/modelcapabilities.d.ts +9 -0
- package/esm/models/components/modelcapabilities.d.ts.map +1 -1
- package/esm/models/components/modelcapabilities.js +5 -0
- package/esm/models/components/modelcapabilities.js.map +1 -1
- package/esm/models/components/modelconversation.d.ts +28 -5
- package/esm/models/components/modelconversation.d.ts.map +1 -1
- package/esm/models/components/modelconversation.js +14 -13
- package/esm/models/components/modelconversation.js.map +1 -1
- package/esm/models/components/prompttokensdetails.d.ts +15 -0
- package/esm/models/components/prompttokensdetails.d.ts.map +1 -0
- package/esm/models/components/prompttokensdetails.js +21 -0
- package/esm/models/components/prompttokensdetails.js.map +1 -0
- package/esm/models/components/reasoningeffort.d.ts +12 -0
- package/esm/models/components/reasoningeffort.d.ts.map +1 -0
- package/esm/models/components/reasoningeffort.js +14 -0
- package/esm/models/components/reasoningeffort.js.map +1 -0
- package/esm/models/components/referencechunk.d.ts +11 -2
- package/esm/models/components/referencechunk.d.ts.map +1 -1
- package/esm/models/components/referencechunk.js +13 -2
- package/esm/models/components/referencechunk.js.map +1 -1
- package/esm/models/components/roles.d.ts +12 -0
- package/esm/models/components/roles.d.ts.map +1 -0
- package/esm/models/components/roles.js +15 -0
- package/esm/models/components/roles.js.map +1 -0
- package/esm/models/components/speechoutputformat.d.ts +13 -0
- package/esm/models/components/speechoutputformat.d.ts.map +1 -0
- package/esm/models/components/speechoutputformat.js +15 -0
- package/esm/models/components/speechoutputformat.js.map +1 -0
- package/esm/models/components/speechrequest.d.ts +37 -0
- package/esm/models/components/speechrequest.d.ts.map +1 -0
- package/esm/models/components/speechrequest.js +30 -0
- package/esm/models/components/speechrequest.js.map +1 -0
- package/esm/models/components/speechstreamaudiodelta.d.ts +11 -0
- package/esm/models/components/speechstreamaudiodelta.d.ts.map +1 -0
- package/esm/models/components/speechstreamaudiodelta.js +20 -0
- package/esm/models/components/speechstreamaudiodelta.js.map +1 -0
- package/esm/models/components/speechstreamdone.d.ts +12 -0
- package/esm/models/components/speechstreamdone.d.ts.map +1 -0
- package/esm/models/components/speechstreamdone.js +16 -0
- package/esm/models/components/speechstreamdone.js.map +1 -0
- package/esm/models/components/speechstreameventtypes.d.ts +10 -0
- package/esm/models/components/speechstreameventtypes.d.ts.map +1 -0
- package/esm/models/components/speechstreameventtypes.js +12 -0
- package/esm/models/components/speechstreameventtypes.js.map +1 -0
- package/esm/models/components/updateagentrequest.d.ts +55 -10
- package/esm/models/components/updateagentrequest.d.ts.map +1 -1
- package/esm/models/components/updateagentrequest.js +14 -13
- package/esm/models/components/updateagentrequest.js.map +1 -1
- package/esm/models/components/usageinfodollardefs.d.ts +18 -0
- package/esm/models/components/usageinfodollardefs.d.ts.map +1 -0
- package/esm/models/components/usageinfodollardefs.js +36 -0
- package/esm/models/components/usageinfodollardefs.js.map +1 -0
- package/esm/models/components/voicecreaterequest.d.ts +39 -0
- package/esm/models/components/voicecreaterequest.d.ts.map +1 -0
- package/esm/models/components/voicecreaterequest.js +29 -0
- package/esm/models/components/voicecreaterequest.js.map +1 -0
- package/esm/models/components/voicelistresponse.d.ts +18 -0
- package/esm/models/components/voicelistresponse.d.ts.map +1 -0
- package/esm/models/components/voicelistresponse.js +25 -0
- package/esm/models/components/voicelistresponse.js.map +1 -0
- package/esm/models/components/voiceresponse.d.ts +23 -0
- package/esm/models/components/voiceresponse.d.ts.map +1 -0
- package/esm/models/components/voiceresponse.js +32 -0
- package/esm/models/components/voiceresponse.js.map +1 -0
- package/esm/models/components/voiceupdaterequest.d.ts +23 -0
- package/esm/models/components/voiceupdaterequest.d.ts.map +1 -0
- package/esm/models/components/voiceupdaterequest.js +17 -0
- package/esm/models/components/voiceupdaterequest.js.map +1 -0
- package/esm/models/components/websearchpremiumtool.d.ts +11 -2
- package/esm/models/components/websearchpremiumtool.d.ts.map +1 -1
- package/esm/models/components/websearchpremiumtool.js +9 -2
- package/esm/models/components/websearchpremiumtool.js.map +1 -1
- package/esm/models/components/websearchtool.d.ts +11 -2
- package/esm/models/components/websearchtool.d.ts.map +1 -1
- package/esm/models/components/websearchtool.js +9 -2
- package/esm/models/components/websearchtool.js.map +1 -1
- package/esm/models/operations/connectorgetauthurlv1.d.ts +14 -0
- package/esm/models/operations/connectorgetauthurlv1.d.ts.map +1 -0
- package/esm/models/operations/connectorgetauthurlv1.js +20 -0
- package/esm/models/operations/connectorgetauthurlv1.js.map +1 -0
- package/esm/models/operations/deletevoicev1audiovoicesvoiceiddelete.d.ts +12 -0
- package/esm/models/operations/deletevoicev1audiovoicesvoiceiddelete.d.ts.map +1 -0
- package/esm/models/operations/deletevoicev1audiovoicesvoiceiddelete.js +18 -0
- package/esm/models/operations/deletevoicev1audiovoicesvoiceiddelete.js.map +1 -0
- package/esm/models/operations/getvoicesampleaudiov1audiovoicesvoiceidsampleget.d.ts +12 -0
- package/esm/models/operations/getvoicesampleaudiov1audiovoicesvoiceidsampleget.d.ts.map +1 -0
- package/esm/models/operations/getvoicesampleaudiov1audiovoicesvoiceidsampleget.js +19 -0
- package/esm/models/operations/getvoicesampleaudiov1audiovoicesvoiceidsampleget.js.map +1 -0
- package/esm/models/operations/getvoicev1audiovoicesvoiceidget.d.ts +12 -0
- package/esm/models/operations/getvoicev1audiovoicesvoiceidget.d.ts.map +1 -0
- package/esm/models/operations/getvoicev1audiovoicesvoiceidget.js +18 -0
- package/esm/models/operations/getvoicev1audiovoicesvoiceidget.js.map +1 -0
- package/esm/models/operations/index.d.ts +8 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +8 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/judgeconversationv1observabilityjudgesjudgeidlivejudgingpost.d.ts +15 -0
- package/esm/models/operations/judgeconversationv1observabilityjudgesjudgeidlivejudgingpost.d.ts.map +1 -0
- package/esm/models/operations/judgeconversationv1observabilityjudgesjudgeidlivejudgingpost.js +22 -0
- package/esm/models/operations/judgeconversationv1observabilityjudgesjudgeidlivejudgingpost.js.map +1 -0
- package/esm/models/operations/listvoicesv1audiovoicesget.d.ts +20 -0
- package/esm/models/operations/listvoicesv1audiovoicesget.d.ts.map +1 -0
- package/esm/models/operations/listvoicesv1audiovoicesget.js +14 -0
- package/esm/models/operations/listvoicesv1audiovoicesget.js.map +1 -0
- package/esm/models/operations/speechv1audiospeechpost.d.ts +37 -0
- package/esm/models/operations/speechv1audiospeechpost.d.ts.map +1 -0
- package/esm/models/operations/speechv1audiospeechpost.js +70 -0
- package/esm/models/operations/speechv1audiospeechpost.js.map +1 -0
- package/esm/models/operations/updatevoicev1audiovoicesvoiceidpatch.d.ts +15 -0
- package/esm/models/operations/updatevoicev1audiovoicesvoiceidpatch.d.ts.map +1 -0
- package/esm/models/operations/updatevoicev1audiovoicesvoiceidpatch.js +21 -0
- package/esm/models/operations/updatevoicev1audiovoicesvoiceidpatch.js.map +1 -0
- package/esm/sdk/audio.d.ts +6 -0
- package/esm/sdk/audio.d.ts.map +1 -1
- package/esm/sdk/audio.js +10 -0
- package/esm/sdk/audio.js.map +1 -1
- package/esm/sdk/connectors.d.ts +7 -0
- package/esm/sdk/connectors.d.ts.map +1 -1
- package/esm/sdk/connectors.js +10 -0
- package/esm/sdk/connectors.js.map +1 -1
- package/esm/sdk/judges.d.ts +4 -0
- package/esm/sdk/judges.d.ts.map +1 -1
- package/esm/sdk/judges.js +7 -0
- package/esm/sdk/judges.js.map +1 -1
- package/esm/sdk/sdk.d.ts +2 -2
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +4 -4
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/speech.d.ts +14 -0
- package/esm/sdk/speech.d.ts.map +1 -0
- package/esm/sdk/speech.js +17 -0
- package/esm/sdk/speech.js.map +1 -0
- package/esm/sdk/voices.d.ts +48 -0
- package/esm/sdk/voices.d.ts.map +1 -0
- package/esm/sdk/voices.js +69 -0
- package/esm/sdk/voices.js.map +1 -0
- package/examples/src/gcp/async_chat_no_streaming.ts +2 -2
- package/jsr.json +1 -1
- package/package.json +8 -3
- package/packages/mistralai-gcp/examples/chatComplete.example.ts +3 -3
- package/packages/mistralai-gcp/src/core.ts +1 -1
- package/packages/mistralai-gcp/src/funcs/chatComplete.ts +7 -7
- package/packages/mistralai-gcp/src/funcs/chatStream.ts +7 -7
- package/packages/mistralai-gcp/src/funcs/fimComplete.ts +7 -7
- package/packages/mistralai-gcp/src/funcs/fimStream.ts +7 -7
- package/packages/mistralai-gcp/src/models/errors/httpvalidationerror.ts +2 -2
- package/packages/mistralai-gcp/src/models/errors/mistralgoogleclouderror.ts +2 -2
- package/packages/mistralai-gcp/src/models/errors/responsevalidationerror.ts +2 -2
- package/packages/mistralai-gcp/src/models/errors/sdkerror.ts +2 -2
- package/packages/mistralai-gcp/src/sdk/sdk.ts +6 -5
- package/src/extra/structChat.ts +71 -5
- package/src/funcs/audioSpeechComplete.ts +175 -0
- package/src/funcs/audioVoicesCreate.ts +170 -0
- package/src/funcs/audioVoicesDelete.ts +179 -0
- package/src/funcs/audioVoicesGet.ts +180 -0
- package/src/funcs/audioVoicesGetSampleAudio.ts +180 -0
- package/src/funcs/audioVoicesList.ts +178 -0
- package/src/funcs/audioVoicesUpdate.ts +182 -0
- package/src/funcs/betaConnectorsGetAuthUrl.ts +186 -0
- package/src/funcs/betaObservabilityJudgesJudgeConversation.ts +188 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/agent.ts +51 -26
- package/src/models/components/agentconversation.ts +3 -2
- package/src/models/components/agentscompletionrequest.ts +201 -15
- package/src/models/components/agentscompletionstreamrequest.ts +201 -15
- package/src/models/components/authurlresponse.ts +38 -0
- package/src/models/components/basefielddefinition.ts +8 -6
- package/src/models/components/basemodelcard.ts +6 -0
- package/src/models/components/chatcompletionrequest.ts +205 -16
- package/src/models/components/chatcompletionstreamrequest.ts +205 -16
- package/src/models/components/codeinterpretertool.ts +21 -4
- package/src/models/components/completionargs.ts +11 -0
- package/src/models/components/conversationrequest.ts +66 -39
- package/src/models/components/conversationresponse.ts +2 -20
- package/src/models/components/conversationrestartrequest.ts +8 -3
- package/src/models/components/conversationrestartstreamrequest.ts +8 -3
- package/src/models/components/conversationstreamrequest.ts +66 -39
- package/src/models/components/createagentrequest.ts +66 -39
- package/src/models/components/customconnector.ts +19 -4
- package/src/models/components/documentlibrarytool.ts +21 -4
- package/src/models/components/ftmodelcard.ts +6 -0
- package/src/models/components/imagegenerationtool.ts +21 -4
- package/src/models/components/imageurlchunk.ts +1 -1
- package/src/models/components/index.ts +20 -0
- package/src/models/components/instructrequest.ts +3 -0
- package/src/models/components/internalmetadata.ts +126 -0
- package/src/models/components/judgeconversationrequest.ts +34 -0
- package/src/models/components/messagetokens.ts +45 -0
- package/src/models/components/metadatadict.ts +55 -0
- package/src/models/components/mirrorconfig.ts +65 -0
- package/src/models/components/mirrorsource.ts +76 -0
- package/src/models/components/modelcapabilities.ts +14 -0
- package/src/models/components/modelconversation.ts +51 -26
- package/src/models/components/prompttokensdetails.ts +42 -0
- package/src/models/components/reasoningeffort.ts +25 -0
- package/src/models/components/referencechunk.ts +32 -4
- package/src/models/components/roles.ts +20 -0
- package/src/models/components/speechoutputformat.ts +21 -0
- package/src/models/components/speechrequest.ts +74 -0
- package/src/models/components/speechstreamaudiodelta.ts +38 -0
- package/src/models/components/speechstreamdone.ts +37 -0
- package/src/models/components/speechstreameventtypes.ts +20 -0
- package/src/models/components/updateagentrequest.ts +66 -39
- package/src/models/components/usageinfodollardefs.ts +63 -0
- package/src/models/components/voicecreaterequest.ts +74 -0
- package/src/models/components/voicelistresponse.ts +49 -0
- package/src/models/components/voiceresponse.ts +59 -0
- package/src/models/components/voiceupdaterequest.ts +46 -0
- package/src/models/components/websearchpremiumtool.ts +21 -4
- package/src/models/components/websearchtool.ts +19 -4
- package/src/models/operations/connectorgetauthurlv1.ts +42 -0
- package/src/models/operations/deletevoicev1audiovoicesvoiceiddelete.ts +40 -0
- package/src/models/operations/getvoicesampleaudiov1audiovoicesvoiceidsampleget.ts +39 -0
- package/src/models/operations/getvoicev1audiovoicesvoiceidget.ts +39 -0
- package/src/models/operations/index.ts +8 -0
- package/src/models/operations/judgeconversationv1observabilityjudgesjudgeidlivejudgingpost.ts +49 -0
- package/src/models/operations/listvoicesv1audiovoicesget.ts +42 -0
- package/src/models/operations/speechv1audiospeechpost.ts +146 -0
- package/src/models/operations/updatevoicev1audiovoicesvoiceidpatch.ts +45 -0
- package/src/sdk/audio.ts +12 -0
- package/src/sdk/connectors.ts +18 -0
- package/src/sdk/judges.ts +16 -0
- package/src/sdk/sdk.ts +5 -5
- package/src/sdk/speech.ts +31 -0
- package/src/sdk/voices.ts +119 -0
|
@@ -11,6 +11,31 @@ import {
|
|
|
11
11
|
AssistantMessage$Outbound,
|
|
12
12
|
AssistantMessage$outboundSchema,
|
|
13
13
|
} from "./assistantmessage.js";
|
|
14
|
+
import {
|
|
15
|
+
CodeInterpreterTool,
|
|
16
|
+
CodeInterpreterTool$Outbound,
|
|
17
|
+
CodeInterpreterTool$outboundSchema,
|
|
18
|
+
} from "./codeinterpretertool.js";
|
|
19
|
+
import {
|
|
20
|
+
CustomConnector,
|
|
21
|
+
CustomConnector$Outbound,
|
|
22
|
+
CustomConnector$outboundSchema,
|
|
23
|
+
} from "./customconnector.js";
|
|
24
|
+
import {
|
|
25
|
+
DocumentLibraryTool,
|
|
26
|
+
DocumentLibraryTool$Outbound,
|
|
27
|
+
DocumentLibraryTool$outboundSchema,
|
|
28
|
+
} from "./documentlibrarytool.js";
|
|
29
|
+
import {
|
|
30
|
+
GuardrailConfig,
|
|
31
|
+
GuardrailConfig$Outbound,
|
|
32
|
+
GuardrailConfig$outboundSchema,
|
|
33
|
+
} from "./guardrailconfig.js";
|
|
34
|
+
import {
|
|
35
|
+
ImageGenerationTool,
|
|
36
|
+
ImageGenerationTool$Outbound,
|
|
37
|
+
ImageGenerationTool$outboundSchema,
|
|
38
|
+
} from "./imagegenerationtool.js";
|
|
14
39
|
import {
|
|
15
40
|
MistralPromptMode,
|
|
16
41
|
MistralPromptMode$outboundSchema,
|
|
@@ -20,6 +45,10 @@ import {
|
|
|
20
45
|
Prediction$Outbound,
|
|
21
46
|
Prediction$outboundSchema,
|
|
22
47
|
} from "./prediction.js";
|
|
48
|
+
import {
|
|
49
|
+
ReasoningEffort,
|
|
50
|
+
ReasoningEffort$outboundSchema,
|
|
51
|
+
} from "./reasoningeffort.js";
|
|
23
52
|
import {
|
|
24
53
|
ResponseFormat,
|
|
25
54
|
ResponseFormat$Outbound,
|
|
@@ -50,6 +79,16 @@ import {
|
|
|
50
79
|
UserMessage$Outbound,
|
|
51
80
|
UserMessage$outboundSchema,
|
|
52
81
|
} from "./usermessage.js";
|
|
82
|
+
import {
|
|
83
|
+
WebSearchPremiumTool,
|
|
84
|
+
WebSearchPremiumTool$Outbound,
|
|
85
|
+
WebSearchPremiumTool$outboundSchema,
|
|
86
|
+
} from "./websearchpremiumtool.js";
|
|
87
|
+
import {
|
|
88
|
+
WebSearchTool,
|
|
89
|
+
WebSearchTool$Outbound,
|
|
90
|
+
WebSearchTool$outboundSchema,
|
|
91
|
+
} from "./websearchtool.js";
|
|
53
92
|
|
|
54
93
|
/**
|
|
55
94
|
* Stop generation if this token is detected. Or if one of these tokens is detected when providing an array
|
|
@@ -62,6 +101,30 @@ export type ChatCompletionRequestMessage =
|
|
|
62
101
|
| ToolMessage
|
|
63
102
|
| UserMessage;
|
|
64
103
|
|
|
104
|
+
export type ChatCompletionRequestTools1 =
|
|
105
|
+
| DocumentLibraryTool
|
|
106
|
+
| CustomConnector
|
|
107
|
+
| Tool
|
|
108
|
+
| WebSearchTool
|
|
109
|
+
| WebSearchPremiumTool
|
|
110
|
+
| CodeInterpreterTool
|
|
111
|
+
| ImageGenerationTool;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.
|
|
115
|
+
*/
|
|
116
|
+
export type ChatCompletionRequestTools2 =
|
|
117
|
+
| Array<
|
|
118
|
+
| DocumentLibraryTool
|
|
119
|
+
| CustomConnector
|
|
120
|
+
| Tool
|
|
121
|
+
| WebSearchTool
|
|
122
|
+
| WebSearchPremiumTool
|
|
123
|
+
| CodeInterpreterTool
|
|
124
|
+
| ImageGenerationTool
|
|
125
|
+
>
|
|
126
|
+
| Array<string>;
|
|
127
|
+
|
|
65
128
|
/**
|
|
66
129
|
* Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool.
|
|
67
130
|
*/
|
|
@@ -113,7 +176,19 @@ export type ChatCompletionRequest = {
|
|
|
113
176
|
/**
|
|
114
177
|
* A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.
|
|
115
178
|
*/
|
|
116
|
-
tools?:
|
|
179
|
+
tools?:
|
|
180
|
+
| Array<
|
|
181
|
+
| DocumentLibraryTool
|
|
182
|
+
| CustomConnector
|
|
183
|
+
| Tool
|
|
184
|
+
| WebSearchTool
|
|
185
|
+
| WebSearchPremiumTool
|
|
186
|
+
| CodeInterpreterTool
|
|
187
|
+
| ImageGenerationTool
|
|
188
|
+
>
|
|
189
|
+
| Array<string>
|
|
190
|
+
| null
|
|
191
|
+
| undefined;
|
|
117
192
|
/**
|
|
118
193
|
* Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool.
|
|
119
194
|
*/
|
|
@@ -138,14 +213,17 @@ export type ChatCompletionRequest = {
|
|
|
138
213
|
* Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.
|
|
139
214
|
*/
|
|
140
215
|
parallelToolCalls?: boolean | undefined;
|
|
216
|
+
reasoningEffort?: ReasoningEffort | null | undefined;
|
|
141
217
|
/**
|
|
142
218
|
* Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.
|
|
143
219
|
*/
|
|
144
220
|
promptMode?: MistralPromptMode | null | undefined;
|
|
221
|
+
guardrails?: Array<GuardrailConfig> | null | undefined;
|
|
145
222
|
/**
|
|
146
223
|
* Whether to inject a safety prompt before all conversations.
|
|
147
224
|
*/
|
|
148
225
|
safePrompt?: boolean | undefined;
|
|
226
|
+
[additionalProperties: string]: unknown;
|
|
149
227
|
};
|
|
150
228
|
|
|
151
229
|
/** @internal */
|
|
@@ -195,6 +273,82 @@ export function chatCompletionRequestMessageToJSON(
|
|
|
195
273
|
);
|
|
196
274
|
}
|
|
197
275
|
|
|
276
|
+
/** @internal */
|
|
277
|
+
export type ChatCompletionRequestTools1$Outbound =
|
|
278
|
+
| DocumentLibraryTool$Outbound
|
|
279
|
+
| CustomConnector$Outbound
|
|
280
|
+
| Tool$Outbound
|
|
281
|
+
| WebSearchTool$Outbound
|
|
282
|
+
| WebSearchPremiumTool$Outbound
|
|
283
|
+
| CodeInterpreterTool$Outbound
|
|
284
|
+
| ImageGenerationTool$Outbound;
|
|
285
|
+
|
|
286
|
+
/** @internal */
|
|
287
|
+
export const ChatCompletionRequestTools1$outboundSchema: z.ZodType<
|
|
288
|
+
ChatCompletionRequestTools1$Outbound,
|
|
289
|
+
ChatCompletionRequestTools1
|
|
290
|
+
> = smartUnion([
|
|
291
|
+
DocumentLibraryTool$outboundSchema,
|
|
292
|
+
CustomConnector$outboundSchema,
|
|
293
|
+
Tool$outboundSchema,
|
|
294
|
+
WebSearchTool$outboundSchema,
|
|
295
|
+
WebSearchPremiumTool$outboundSchema,
|
|
296
|
+
CodeInterpreterTool$outboundSchema,
|
|
297
|
+
ImageGenerationTool$outboundSchema,
|
|
298
|
+
]);
|
|
299
|
+
|
|
300
|
+
export function chatCompletionRequestTools1ToJSON(
|
|
301
|
+
chatCompletionRequestTools1: ChatCompletionRequestTools1,
|
|
302
|
+
): string {
|
|
303
|
+
return JSON.stringify(
|
|
304
|
+
ChatCompletionRequestTools1$outboundSchema.parse(
|
|
305
|
+
chatCompletionRequestTools1,
|
|
306
|
+
),
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** @internal */
|
|
311
|
+
export type ChatCompletionRequestTools2$Outbound =
|
|
312
|
+
| Array<
|
|
313
|
+
| DocumentLibraryTool$Outbound
|
|
314
|
+
| CustomConnector$Outbound
|
|
315
|
+
| Tool$Outbound
|
|
316
|
+
| WebSearchTool$Outbound
|
|
317
|
+
| WebSearchPremiumTool$Outbound
|
|
318
|
+
| CodeInterpreterTool$Outbound
|
|
319
|
+
| ImageGenerationTool$Outbound
|
|
320
|
+
>
|
|
321
|
+
| Array<string>;
|
|
322
|
+
|
|
323
|
+
/** @internal */
|
|
324
|
+
export const ChatCompletionRequestTools2$outboundSchema: z.ZodType<
|
|
325
|
+
ChatCompletionRequestTools2$Outbound,
|
|
326
|
+
ChatCompletionRequestTools2
|
|
327
|
+
> = smartUnion([
|
|
328
|
+
z.array(
|
|
329
|
+
smartUnion([
|
|
330
|
+
DocumentLibraryTool$outboundSchema,
|
|
331
|
+
CustomConnector$outboundSchema,
|
|
332
|
+
Tool$outboundSchema,
|
|
333
|
+
WebSearchTool$outboundSchema,
|
|
334
|
+
WebSearchPremiumTool$outboundSchema,
|
|
335
|
+
CodeInterpreterTool$outboundSchema,
|
|
336
|
+
ImageGenerationTool$outboundSchema,
|
|
337
|
+
]),
|
|
338
|
+
),
|
|
339
|
+
z.array(z.string()),
|
|
340
|
+
]);
|
|
341
|
+
|
|
342
|
+
export function chatCompletionRequestTools2ToJSON(
|
|
343
|
+
chatCompletionRequestTools2: ChatCompletionRequestTools2,
|
|
344
|
+
): string {
|
|
345
|
+
return JSON.stringify(
|
|
346
|
+
ChatCompletionRequestTools2$outboundSchema.parse(
|
|
347
|
+
chatCompletionRequestTools2,
|
|
348
|
+
),
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
|
|
198
352
|
/** @internal */
|
|
199
353
|
export type ChatCompletionRequestToolChoice$Outbound =
|
|
200
354
|
| ToolChoice$Outbound
|
|
@@ -233,15 +387,30 @@ export type ChatCompletionRequest$Outbound = {
|
|
|
233
387
|
| UserMessage$Outbound
|
|
234
388
|
>;
|
|
235
389
|
response_format?: ResponseFormat$Outbound | undefined;
|
|
236
|
-
tools?:
|
|
390
|
+
tools?:
|
|
391
|
+
| Array<
|
|
392
|
+
| DocumentLibraryTool$Outbound
|
|
393
|
+
| CustomConnector$Outbound
|
|
394
|
+
| Tool$Outbound
|
|
395
|
+
| WebSearchTool$Outbound
|
|
396
|
+
| WebSearchPremiumTool$Outbound
|
|
397
|
+
| CodeInterpreterTool$Outbound
|
|
398
|
+
| ImageGenerationTool$Outbound
|
|
399
|
+
>
|
|
400
|
+
| Array<string>
|
|
401
|
+
| null
|
|
402
|
+
| undefined;
|
|
237
403
|
tool_choice?: ToolChoice$Outbound | string | undefined;
|
|
238
404
|
presence_penalty?: number | undefined;
|
|
239
405
|
frequency_penalty?: number | undefined;
|
|
240
406
|
n?: number | null | undefined;
|
|
241
407
|
prediction?: Prediction$Outbound | undefined;
|
|
242
408
|
parallel_tool_calls?: boolean | undefined;
|
|
409
|
+
reasoning_effort?: string | null | undefined;
|
|
243
410
|
prompt_mode?: string | null | undefined;
|
|
411
|
+
guardrails?: Array<GuardrailConfig$Outbound> | null | undefined;
|
|
244
412
|
safe_prompt?: boolean | undefined;
|
|
413
|
+
[additionalProperties: string]: unknown;
|
|
245
414
|
};
|
|
246
415
|
|
|
247
416
|
/** @internal */
|
|
@@ -268,7 +437,22 @@ export const ChatCompletionRequest$outboundSchema: z.ZodType<
|
|
|
268
437
|
]),
|
|
269
438
|
),
|
|
270
439
|
responseFormat: ResponseFormat$outboundSchema.optional(),
|
|
271
|
-
tools: z.nullable(
|
|
440
|
+
tools: z.nullable(
|
|
441
|
+
smartUnion([
|
|
442
|
+
z.array(
|
|
443
|
+
smartUnion([
|
|
444
|
+
DocumentLibraryTool$outboundSchema,
|
|
445
|
+
CustomConnector$outboundSchema,
|
|
446
|
+
Tool$outboundSchema,
|
|
447
|
+
WebSearchTool$outboundSchema,
|
|
448
|
+
WebSearchPremiumTool$outboundSchema,
|
|
449
|
+
CodeInterpreterTool$outboundSchema,
|
|
450
|
+
ImageGenerationTool$outboundSchema,
|
|
451
|
+
]),
|
|
452
|
+
),
|
|
453
|
+
z.array(z.string()),
|
|
454
|
+
]),
|
|
455
|
+
).optional(),
|
|
272
456
|
toolChoice: smartUnion([
|
|
273
457
|
ToolChoice$outboundSchema,
|
|
274
458
|
ToolChoiceEnum$outboundSchema,
|
|
@@ -278,21 +462,26 @@ export const ChatCompletionRequest$outboundSchema: z.ZodType<
|
|
|
278
462
|
n: z.nullable(z.int()).optional(),
|
|
279
463
|
prediction: Prediction$outboundSchema.optional(),
|
|
280
464
|
parallelToolCalls: z.boolean().optional(),
|
|
465
|
+
reasoningEffort: z.nullable(ReasoningEffort$outboundSchema).optional(),
|
|
281
466
|
promptMode: z.nullable(MistralPromptMode$outboundSchema).optional(),
|
|
467
|
+
guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
|
|
282
468
|
safePrompt: z.boolean().optional(),
|
|
283
|
-
}).transform((v) => {
|
|
284
|
-
return
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
469
|
+
}).catchall(z.any()).transform((v) => {
|
|
470
|
+
return {
|
|
471
|
+
...remap$(v, {
|
|
472
|
+
topP: "top_p",
|
|
473
|
+
maxTokens: "max_tokens",
|
|
474
|
+
randomSeed: "random_seed",
|
|
475
|
+
responseFormat: "response_format",
|
|
476
|
+
toolChoice: "tool_choice",
|
|
477
|
+
presencePenalty: "presence_penalty",
|
|
478
|
+
frequencyPenalty: "frequency_penalty",
|
|
479
|
+
parallelToolCalls: "parallel_tool_calls",
|
|
480
|
+
reasoningEffort: "reasoning_effort",
|
|
481
|
+
promptMode: "prompt_mode",
|
|
482
|
+
safePrompt: "safe_prompt",
|
|
483
|
+
}),
|
|
484
|
+
};
|
|
296
485
|
});
|
|
297
486
|
|
|
298
487
|
export function chatCompletionRequestToJSON(
|
|
@@ -11,6 +11,31 @@ import {
|
|
|
11
11
|
AssistantMessage$Outbound,
|
|
12
12
|
AssistantMessage$outboundSchema,
|
|
13
13
|
} from "./assistantmessage.js";
|
|
14
|
+
import {
|
|
15
|
+
CodeInterpreterTool,
|
|
16
|
+
CodeInterpreterTool$Outbound,
|
|
17
|
+
CodeInterpreterTool$outboundSchema,
|
|
18
|
+
} from "./codeinterpretertool.js";
|
|
19
|
+
import {
|
|
20
|
+
CustomConnector,
|
|
21
|
+
CustomConnector$Outbound,
|
|
22
|
+
CustomConnector$outboundSchema,
|
|
23
|
+
} from "./customconnector.js";
|
|
24
|
+
import {
|
|
25
|
+
DocumentLibraryTool,
|
|
26
|
+
DocumentLibraryTool$Outbound,
|
|
27
|
+
DocumentLibraryTool$outboundSchema,
|
|
28
|
+
} from "./documentlibrarytool.js";
|
|
29
|
+
import {
|
|
30
|
+
GuardrailConfig,
|
|
31
|
+
GuardrailConfig$Outbound,
|
|
32
|
+
GuardrailConfig$outboundSchema,
|
|
33
|
+
} from "./guardrailconfig.js";
|
|
34
|
+
import {
|
|
35
|
+
ImageGenerationTool,
|
|
36
|
+
ImageGenerationTool$Outbound,
|
|
37
|
+
ImageGenerationTool$outboundSchema,
|
|
38
|
+
} from "./imagegenerationtool.js";
|
|
14
39
|
import {
|
|
15
40
|
MistralPromptMode,
|
|
16
41
|
MistralPromptMode$outboundSchema,
|
|
@@ -20,6 +45,10 @@ import {
|
|
|
20
45
|
Prediction$Outbound,
|
|
21
46
|
Prediction$outboundSchema,
|
|
22
47
|
} from "./prediction.js";
|
|
48
|
+
import {
|
|
49
|
+
ReasoningEffort,
|
|
50
|
+
ReasoningEffort$outboundSchema,
|
|
51
|
+
} from "./reasoningeffort.js";
|
|
23
52
|
import {
|
|
24
53
|
ResponseFormat,
|
|
25
54
|
ResponseFormat$Outbound,
|
|
@@ -50,6 +79,16 @@ import {
|
|
|
50
79
|
UserMessage$Outbound,
|
|
51
80
|
UserMessage$outboundSchema,
|
|
52
81
|
} from "./usermessage.js";
|
|
82
|
+
import {
|
|
83
|
+
WebSearchPremiumTool,
|
|
84
|
+
WebSearchPremiumTool$Outbound,
|
|
85
|
+
WebSearchPremiumTool$outboundSchema,
|
|
86
|
+
} from "./websearchpremiumtool.js";
|
|
87
|
+
import {
|
|
88
|
+
WebSearchTool,
|
|
89
|
+
WebSearchTool$Outbound,
|
|
90
|
+
WebSearchTool$outboundSchema,
|
|
91
|
+
} from "./websearchtool.js";
|
|
53
92
|
|
|
54
93
|
/**
|
|
55
94
|
* Stop generation if this token is detected. Or if one of these tokens is detected when providing an array
|
|
@@ -62,6 +101,30 @@ export type ChatCompletionStreamRequestMessage =
|
|
|
62
101
|
| ToolMessage
|
|
63
102
|
| UserMessage;
|
|
64
103
|
|
|
104
|
+
export type ChatCompletionStreamRequestTools1 =
|
|
105
|
+
| DocumentLibraryTool
|
|
106
|
+
| CustomConnector
|
|
107
|
+
| Tool
|
|
108
|
+
| WebSearchTool
|
|
109
|
+
| WebSearchPremiumTool
|
|
110
|
+
| CodeInterpreterTool
|
|
111
|
+
| ImageGenerationTool;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.
|
|
115
|
+
*/
|
|
116
|
+
export type ChatCompletionStreamRequestTools2 =
|
|
117
|
+
| Array<
|
|
118
|
+
| DocumentLibraryTool
|
|
119
|
+
| CustomConnector
|
|
120
|
+
| Tool
|
|
121
|
+
| WebSearchTool
|
|
122
|
+
| WebSearchPremiumTool
|
|
123
|
+
| CodeInterpreterTool
|
|
124
|
+
| ImageGenerationTool
|
|
125
|
+
>
|
|
126
|
+
| Array<string>;
|
|
127
|
+
|
|
65
128
|
/**
|
|
66
129
|
* Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool.
|
|
67
130
|
*/
|
|
@@ -110,7 +173,19 @@ export type ChatCompletionStreamRequest = {
|
|
|
110
173
|
/**
|
|
111
174
|
* A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.
|
|
112
175
|
*/
|
|
113
|
-
tools?:
|
|
176
|
+
tools?:
|
|
177
|
+
| Array<
|
|
178
|
+
| DocumentLibraryTool
|
|
179
|
+
| CustomConnector
|
|
180
|
+
| Tool
|
|
181
|
+
| WebSearchTool
|
|
182
|
+
| WebSearchPremiumTool
|
|
183
|
+
| CodeInterpreterTool
|
|
184
|
+
| ImageGenerationTool
|
|
185
|
+
>
|
|
186
|
+
| Array<string>
|
|
187
|
+
| null
|
|
188
|
+
| undefined;
|
|
114
189
|
/**
|
|
115
190
|
* Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool.
|
|
116
191
|
*/
|
|
@@ -135,14 +210,17 @@ export type ChatCompletionStreamRequest = {
|
|
|
135
210
|
* Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.
|
|
136
211
|
*/
|
|
137
212
|
parallelToolCalls?: boolean | undefined;
|
|
213
|
+
reasoningEffort?: ReasoningEffort | null | undefined;
|
|
138
214
|
/**
|
|
139
215
|
* Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.
|
|
140
216
|
*/
|
|
141
217
|
promptMode?: MistralPromptMode | null | undefined;
|
|
218
|
+
guardrails?: Array<GuardrailConfig> | null | undefined;
|
|
142
219
|
/**
|
|
143
220
|
* Whether to inject a safety prompt before all conversations.
|
|
144
221
|
*/
|
|
145
222
|
safePrompt?: boolean | undefined;
|
|
223
|
+
[additionalProperties: string]: unknown;
|
|
146
224
|
};
|
|
147
225
|
|
|
148
226
|
/** @internal */
|
|
@@ -194,6 +272,82 @@ export function chatCompletionStreamRequestMessageToJSON(
|
|
|
194
272
|
);
|
|
195
273
|
}
|
|
196
274
|
|
|
275
|
+
/** @internal */
|
|
276
|
+
export type ChatCompletionStreamRequestTools1$Outbound =
|
|
277
|
+
| DocumentLibraryTool$Outbound
|
|
278
|
+
| CustomConnector$Outbound
|
|
279
|
+
| Tool$Outbound
|
|
280
|
+
| WebSearchTool$Outbound
|
|
281
|
+
| WebSearchPremiumTool$Outbound
|
|
282
|
+
| CodeInterpreterTool$Outbound
|
|
283
|
+
| ImageGenerationTool$Outbound;
|
|
284
|
+
|
|
285
|
+
/** @internal */
|
|
286
|
+
export const ChatCompletionStreamRequestTools1$outboundSchema: z.ZodType<
|
|
287
|
+
ChatCompletionStreamRequestTools1$Outbound,
|
|
288
|
+
ChatCompletionStreamRequestTools1
|
|
289
|
+
> = smartUnion([
|
|
290
|
+
DocumentLibraryTool$outboundSchema,
|
|
291
|
+
CustomConnector$outboundSchema,
|
|
292
|
+
Tool$outboundSchema,
|
|
293
|
+
WebSearchTool$outboundSchema,
|
|
294
|
+
WebSearchPremiumTool$outboundSchema,
|
|
295
|
+
CodeInterpreterTool$outboundSchema,
|
|
296
|
+
ImageGenerationTool$outboundSchema,
|
|
297
|
+
]);
|
|
298
|
+
|
|
299
|
+
export function chatCompletionStreamRequestTools1ToJSON(
|
|
300
|
+
chatCompletionStreamRequestTools1: ChatCompletionStreamRequestTools1,
|
|
301
|
+
): string {
|
|
302
|
+
return JSON.stringify(
|
|
303
|
+
ChatCompletionStreamRequestTools1$outboundSchema.parse(
|
|
304
|
+
chatCompletionStreamRequestTools1,
|
|
305
|
+
),
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/** @internal */
|
|
310
|
+
export type ChatCompletionStreamRequestTools2$Outbound =
|
|
311
|
+
| Array<
|
|
312
|
+
| DocumentLibraryTool$Outbound
|
|
313
|
+
| CustomConnector$Outbound
|
|
314
|
+
| Tool$Outbound
|
|
315
|
+
| WebSearchTool$Outbound
|
|
316
|
+
| WebSearchPremiumTool$Outbound
|
|
317
|
+
| CodeInterpreterTool$Outbound
|
|
318
|
+
| ImageGenerationTool$Outbound
|
|
319
|
+
>
|
|
320
|
+
| Array<string>;
|
|
321
|
+
|
|
322
|
+
/** @internal */
|
|
323
|
+
export const ChatCompletionStreamRequestTools2$outboundSchema: z.ZodType<
|
|
324
|
+
ChatCompletionStreamRequestTools2$Outbound,
|
|
325
|
+
ChatCompletionStreamRequestTools2
|
|
326
|
+
> = smartUnion([
|
|
327
|
+
z.array(
|
|
328
|
+
smartUnion([
|
|
329
|
+
DocumentLibraryTool$outboundSchema,
|
|
330
|
+
CustomConnector$outboundSchema,
|
|
331
|
+
Tool$outboundSchema,
|
|
332
|
+
WebSearchTool$outboundSchema,
|
|
333
|
+
WebSearchPremiumTool$outboundSchema,
|
|
334
|
+
CodeInterpreterTool$outboundSchema,
|
|
335
|
+
ImageGenerationTool$outboundSchema,
|
|
336
|
+
]),
|
|
337
|
+
),
|
|
338
|
+
z.array(z.string()),
|
|
339
|
+
]);
|
|
340
|
+
|
|
341
|
+
export function chatCompletionStreamRequestTools2ToJSON(
|
|
342
|
+
chatCompletionStreamRequestTools2: ChatCompletionStreamRequestTools2,
|
|
343
|
+
): string {
|
|
344
|
+
return JSON.stringify(
|
|
345
|
+
ChatCompletionStreamRequestTools2$outboundSchema.parse(
|
|
346
|
+
chatCompletionStreamRequestTools2,
|
|
347
|
+
),
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
|
|
197
351
|
/** @internal */
|
|
198
352
|
export type ChatCompletionStreamRequestToolChoice$Outbound =
|
|
199
353
|
| ToolChoice$Outbound
|
|
@@ -232,15 +386,30 @@ export type ChatCompletionStreamRequest$Outbound = {
|
|
|
232
386
|
| UserMessage$Outbound
|
|
233
387
|
>;
|
|
234
388
|
response_format?: ResponseFormat$Outbound | undefined;
|
|
235
|
-
tools?:
|
|
389
|
+
tools?:
|
|
390
|
+
| Array<
|
|
391
|
+
| DocumentLibraryTool$Outbound
|
|
392
|
+
| CustomConnector$Outbound
|
|
393
|
+
| Tool$Outbound
|
|
394
|
+
| WebSearchTool$Outbound
|
|
395
|
+
| WebSearchPremiumTool$Outbound
|
|
396
|
+
| CodeInterpreterTool$Outbound
|
|
397
|
+
| ImageGenerationTool$Outbound
|
|
398
|
+
>
|
|
399
|
+
| Array<string>
|
|
400
|
+
| null
|
|
401
|
+
| undefined;
|
|
236
402
|
tool_choice?: ToolChoice$Outbound | string | undefined;
|
|
237
403
|
presence_penalty?: number | undefined;
|
|
238
404
|
frequency_penalty?: number | undefined;
|
|
239
405
|
n?: number | null | undefined;
|
|
240
406
|
prediction?: Prediction$Outbound | undefined;
|
|
241
407
|
parallel_tool_calls?: boolean | undefined;
|
|
408
|
+
reasoning_effort?: string | null | undefined;
|
|
242
409
|
prompt_mode?: string | null | undefined;
|
|
410
|
+
guardrails?: Array<GuardrailConfig$Outbound> | null | undefined;
|
|
243
411
|
safe_prompt?: boolean | undefined;
|
|
412
|
+
[additionalProperties: string]: unknown;
|
|
244
413
|
};
|
|
245
414
|
|
|
246
415
|
/** @internal */
|
|
@@ -267,7 +436,22 @@ export const ChatCompletionStreamRequest$outboundSchema: z.ZodType<
|
|
|
267
436
|
]),
|
|
268
437
|
),
|
|
269
438
|
responseFormat: ResponseFormat$outboundSchema.optional(),
|
|
270
|
-
tools: z.nullable(
|
|
439
|
+
tools: z.nullable(
|
|
440
|
+
smartUnion([
|
|
441
|
+
z.array(
|
|
442
|
+
smartUnion([
|
|
443
|
+
DocumentLibraryTool$outboundSchema,
|
|
444
|
+
CustomConnector$outboundSchema,
|
|
445
|
+
Tool$outboundSchema,
|
|
446
|
+
WebSearchTool$outboundSchema,
|
|
447
|
+
WebSearchPremiumTool$outboundSchema,
|
|
448
|
+
CodeInterpreterTool$outboundSchema,
|
|
449
|
+
ImageGenerationTool$outboundSchema,
|
|
450
|
+
]),
|
|
451
|
+
),
|
|
452
|
+
z.array(z.string()),
|
|
453
|
+
]),
|
|
454
|
+
).optional(),
|
|
271
455
|
toolChoice: smartUnion([
|
|
272
456
|
ToolChoice$outboundSchema,
|
|
273
457
|
ToolChoiceEnum$outboundSchema,
|
|
@@ -277,21 +461,26 @@ export const ChatCompletionStreamRequest$outboundSchema: z.ZodType<
|
|
|
277
461
|
n: z.nullable(z.int()).optional(),
|
|
278
462
|
prediction: Prediction$outboundSchema.optional(),
|
|
279
463
|
parallelToolCalls: z.boolean().optional(),
|
|
464
|
+
reasoningEffort: z.nullable(ReasoningEffort$outboundSchema).optional(),
|
|
280
465
|
promptMode: z.nullable(MistralPromptMode$outboundSchema).optional(),
|
|
466
|
+
guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
|
|
281
467
|
safePrompt: z.boolean().optional(),
|
|
282
|
-
}).transform((v) => {
|
|
283
|
-
return
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
468
|
+
}).catchall(z.any()).transform((v) => {
|
|
469
|
+
return {
|
|
470
|
+
...remap$(v, {
|
|
471
|
+
topP: "top_p",
|
|
472
|
+
maxTokens: "max_tokens",
|
|
473
|
+
randomSeed: "random_seed",
|
|
474
|
+
responseFormat: "response_format",
|
|
475
|
+
toolChoice: "tool_choice",
|
|
476
|
+
presencePenalty: "presence_penalty",
|
|
477
|
+
frequencyPenalty: "frequency_penalty",
|
|
478
|
+
parallelToolCalls: "parallel_tool_calls",
|
|
479
|
+
reasoningEffort: "reasoning_effort",
|
|
480
|
+
promptMode: "prompt_mode",
|
|
481
|
+
safePrompt: "safe_prompt",
|
|
482
|
+
}),
|
|
483
|
+
};
|
|
295
484
|
});
|
|
296
485
|
|
|
297
486
|
export function chatCompletionStreamRequestToJSON(
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import * as z from "zod/v4";
|
|
7
7
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
8
|
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
10
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
12
|
import {
|
|
@@ -15,18 +16,34 @@ import {
|
|
|
15
16
|
ToolConfiguration$outboundSchema,
|
|
16
17
|
} from "./toolconfiguration.js";
|
|
17
18
|
|
|
19
|
+
export const CodeInterpreterToolType = {
|
|
20
|
+
CodeInterpreter: "code_interpreter",
|
|
21
|
+
} as const;
|
|
22
|
+
export type CodeInterpreterToolType = ClosedEnum<
|
|
23
|
+
typeof CodeInterpreterToolType
|
|
24
|
+
>;
|
|
25
|
+
|
|
18
26
|
export type CodeInterpreterTool = {
|
|
19
27
|
toolConfiguration?: ToolConfiguration | null | undefined;
|
|
20
|
-
type
|
|
28
|
+
type?: CodeInterpreterToolType | undefined;
|
|
21
29
|
};
|
|
22
30
|
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const CodeInterpreterToolType$inboundSchema: z.ZodEnum<
|
|
33
|
+
typeof CodeInterpreterToolType
|
|
34
|
+
> = z.enum(CodeInterpreterToolType);
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const CodeInterpreterToolType$outboundSchema: z.ZodEnum<
|
|
37
|
+
typeof CodeInterpreterToolType
|
|
38
|
+
> = CodeInterpreterToolType$inboundSchema;
|
|
39
|
+
|
|
23
40
|
/** @internal */
|
|
24
41
|
export const CodeInterpreterTool$inboundSchema: z.ZodType<
|
|
25
42
|
CodeInterpreterTool,
|
|
26
43
|
unknown
|
|
27
44
|
> = z.object({
|
|
28
45
|
tool_configuration: z.nullable(ToolConfiguration$inboundSchema).optional(),
|
|
29
|
-
type:
|
|
46
|
+
type: CodeInterpreterToolType$inboundSchema.default("code_interpreter"),
|
|
30
47
|
}).transform((v) => {
|
|
31
48
|
return remap$(v, {
|
|
32
49
|
"tool_configuration": "toolConfiguration",
|
|
@@ -35,7 +52,7 @@ export const CodeInterpreterTool$inboundSchema: z.ZodType<
|
|
|
35
52
|
/** @internal */
|
|
36
53
|
export type CodeInterpreterTool$Outbound = {
|
|
37
54
|
tool_configuration?: ToolConfiguration$Outbound | null | undefined;
|
|
38
|
-
type:
|
|
55
|
+
type: string;
|
|
39
56
|
};
|
|
40
57
|
|
|
41
58
|
/** @internal */
|
|
@@ -44,7 +61,7 @@ export const CodeInterpreterTool$outboundSchema: z.ZodType<
|
|
|
44
61
|
CodeInterpreterTool
|
|
45
62
|
> = z.object({
|
|
46
63
|
toolConfiguration: z.nullable(ToolConfiguration$outboundSchema).optional(),
|
|
47
|
-
type:
|
|
64
|
+
type: CodeInterpreterToolType$outboundSchema.default("code_interpreter"),
|
|
48
65
|
}).transform((v) => {
|
|
49
66
|
return remap$(v, {
|
|
50
67
|
toolConfiguration: "tool_configuration",
|