@mistralai/mistralai 2.0.0 → 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 +45 -33
- package/RUNTIMES.md +1 -1
- package/esm/extra/structChat.js +1 -1
- 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/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- 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 +22 -2
- package/esm/models/components/agentscompletionrequest.d.ts.map +1 -1
- package/esm/models/components/agentscompletionrequest.js +62 -14
- package/esm/models/components/agentscompletionrequest.js.map +1 -1
- package/esm/models/components/agentscompletionstreamrequest.d.ts +22 -2
- package/esm/models/components/agentscompletionstreamrequest.d.ts.map +1 -1
- package/esm/models/components/agentscompletionstreamrequest.js +62 -14
- package/esm/models/components/agentscompletionstreamrequest.js.map +1 -1
- 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/chatcompletionrequest.d.ts +25 -2
- package/esm/models/components/chatcompletionrequest.d.ts.map +1 -1
- package/esm/models/components/chatcompletionrequest.js +63 -15
- package/esm/models/components/chatcompletionrequest.js.map +1 -1
- package/esm/models/components/chatcompletionstreamrequest.d.ts +25 -2
- package/esm/models/components/chatcompletionstreamrequest.d.ts.map +1 -1
- package/esm/models/components/chatcompletionstreamrequest.js +63 -15
- 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/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/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/index.d.ts +17 -0
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +17 -0
- package/esm/models/components/index.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/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 +1 -0
- package/esm/models/components/modelcapabilities.d.ts.map +1 -1
- package/esm/models/components/modelcapabilities.js +1 -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 +5 -3
- package/esm/models/components/reasoningeffort.d.ts.map +1 -1
- package/esm/models/components/reasoningeffort.js +4 -2
- package/esm/models/components/reasoningeffort.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/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 +6 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +6 -0
- package/esm/models/operations/index.js.map +1 -1
- 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/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/jsr.json +1 -1
- package/package.json +1 -1
- package/src/extra/structChat.ts +2 -2
- 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/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 +186 -16
- package/src/models/components/agentscompletionstreamrequest.ts +186 -16
- package/src/models/components/basefielddefinition.ts +8 -6
- package/src/models/components/chatcompletionrequest.ts +190 -17
- package/src/models/components/chatcompletionstreamrequest.ts +190 -17
- 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/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/imagegenerationtool.ts +21 -4
- package/src/models/components/index.ts +17 -0
- package/src/models/components/internalmetadata.ts +126 -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 +2 -0
- package/src/models/components/modelconversation.ts +51 -26
- package/src/models/components/prompttokensdetails.ts +42 -0
- package/src/models/components/reasoningeffort.ts +12 -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/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 +6 -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/sdk.ts +5 -5
- package/src/sdk/speech.ts +31 -0
- package/src/sdk/voices.ts +119 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: de3a1697ae28
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { MistralCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { MistralError } from "../models/errors/mistralerror.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Update voice metadata
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Update voice metadata (name, gender, languages, age, tags).
|
|
35
|
+
*/
|
|
36
|
+
export function audioVoicesUpdate(
|
|
37
|
+
client: MistralCore,
|
|
38
|
+
request: operations.UpdateVoiceV1AudioVoicesVoiceIdPatchRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
components.VoiceResponse,
|
|
43
|
+
| errors.HTTPValidationError
|
|
44
|
+
| MistralError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client: MistralCore,
|
|
63
|
+
request: operations.UpdateVoiceV1AudioVoicesVoiceIdPatchRequest,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<
|
|
66
|
+
[
|
|
67
|
+
Result<
|
|
68
|
+
components.VoiceResponse,
|
|
69
|
+
| errors.HTTPValidationError
|
|
70
|
+
| MistralError
|
|
71
|
+
| ResponseValidationError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
| RequestAbortedError
|
|
74
|
+
| RequestTimeoutError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| UnexpectedClientError
|
|
77
|
+
| SDKValidationError
|
|
78
|
+
>,
|
|
79
|
+
APICall,
|
|
80
|
+
]
|
|
81
|
+
> {
|
|
82
|
+
const parsed = safeParse(
|
|
83
|
+
request,
|
|
84
|
+
(value) =>
|
|
85
|
+
operations.UpdateVoiceV1AudioVoicesVoiceIdPatchRequest$outboundSchema
|
|
86
|
+
.parse(value),
|
|
87
|
+
"Input validation failed",
|
|
88
|
+
);
|
|
89
|
+
if (!parsed.ok) {
|
|
90
|
+
return [parsed, { status: "invalid" }];
|
|
91
|
+
}
|
|
92
|
+
const payload = parsed.value;
|
|
93
|
+
const body = encodeJSON("body", payload.VoiceUpdateRequest, {
|
|
94
|
+
explode: true,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const pathParams = {
|
|
98
|
+
voice_id: encodeSimple("voice_id", payload.voice_id, {
|
|
99
|
+
explode: false,
|
|
100
|
+
charEncoding: "percent",
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const path = pathToFunc("/v1/audio/voices/{voice_id}")(pathParams);
|
|
105
|
+
|
|
106
|
+
const headers = new Headers(compactMap({
|
|
107
|
+
"Content-Type": "application/json",
|
|
108
|
+
Accept: "application/json",
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
112
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
113
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
options: client._options,
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "update_voice_v1_audio_voices__voice_id__patch",
|
|
119
|
+
oAuth2Scopes: null,
|
|
120
|
+
|
|
121
|
+
resolvedSecurity: requestSecurity,
|
|
122
|
+
|
|
123
|
+
securitySource: client._options.apiKey,
|
|
124
|
+
retryConfig: options?.retries
|
|
125
|
+
|| client._options.retryConfig
|
|
126
|
+
|| { strategy: "none" },
|
|
127
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const requestRes = client._createRequest(context, {
|
|
131
|
+
security: requestSecurity,
|
|
132
|
+
method: "PATCH",
|
|
133
|
+
baseURL: options?.serverURL,
|
|
134
|
+
path: path,
|
|
135
|
+
headers: headers,
|
|
136
|
+
body: body,
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
148
|
+
retryConfig: context.retryConfig,
|
|
149
|
+
retryCodes: context.retryCodes,
|
|
150
|
+
});
|
|
151
|
+
if (!doResult.ok) {
|
|
152
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
|
+
}
|
|
154
|
+
const response = doResult.value;
|
|
155
|
+
|
|
156
|
+
const responseFields = {
|
|
157
|
+
HttpMeta: { Response: response, Request: req },
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const [result] = await M.match<
|
|
161
|
+
components.VoiceResponse,
|
|
162
|
+
| errors.HTTPValidationError
|
|
163
|
+
| MistralError
|
|
164
|
+
| ResponseValidationError
|
|
165
|
+
| ConnectionError
|
|
166
|
+
| RequestAbortedError
|
|
167
|
+
| RequestTimeoutError
|
|
168
|
+
| InvalidRequestError
|
|
169
|
+
| UnexpectedClientError
|
|
170
|
+
| SDKValidationError
|
|
171
|
+
>(
|
|
172
|
+
M.json(200, components.VoiceResponse$inboundSchema),
|
|
173
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
174
|
+
M.fail("4XX"),
|
|
175
|
+
M.fail("5XX"),
|
|
176
|
+
)(response, req, { extraFields: responseFields });
|
|
177
|
+
if (!result.ok) {
|
|
178
|
+
return [result, { status: "complete", request: req, response }];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -60,8 +60,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
60
60
|
export const SDK_METADATA = {
|
|
61
61
|
language: "typescript",
|
|
62
62
|
openapiDocVersion: "1.0.0",
|
|
63
|
-
sdkVersion: "2.
|
|
63
|
+
sdkVersion: "2.1.0",
|
|
64
64
|
genVersion: "2.859.0",
|
|
65
65
|
userAgent:
|
|
66
|
-
"speakeasy-sdk/typescript 2.
|
|
66
|
+
"speakeasy-sdk/typescript 2.1.0 2.859.0 1.0.0 @mistralai/mistralai",
|
|
67
67
|
} as const;
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
ImageGenerationTool,
|
|
36
36
|
ImageGenerationTool$inboundSchema,
|
|
37
37
|
} from "./imagegenerationtool.js";
|
|
38
|
+
import { MetadataDict, MetadataDict$inboundSchema } from "./metadatadict.js";
|
|
38
39
|
import {
|
|
39
40
|
WebSearchPremiumTool,
|
|
40
41
|
WebSearchPremiumTool$inboundSchema,
|
|
@@ -42,13 +43,13 @@ import {
|
|
|
42
43
|
import { WebSearchTool, WebSearchTool$inboundSchema } from "./websearchtool.js";
|
|
43
44
|
|
|
44
45
|
export type AgentTool =
|
|
45
|
-
| CodeInterpreterTool
|
|
46
|
-
| CustomConnector
|
|
47
|
-
| DocumentLibraryTool
|
|
46
|
+
| (CodeInterpreterTool & { type: "code_interpreter" })
|
|
47
|
+
| (CustomConnector & { type: "connector" })
|
|
48
|
+
| (DocumentLibraryTool & { type: "document_library" })
|
|
48
49
|
| FunctionTool
|
|
49
|
-
| ImageGenerationTool
|
|
50
|
-
| WebSearchTool
|
|
51
|
-
| WebSearchPremiumTool
|
|
50
|
+
| (ImageGenerationTool & { type: "image_generation" })
|
|
51
|
+
| (WebSearchTool & { type: "web_search" })
|
|
52
|
+
| (WebSearchPremiumTool & { type: "web_search_premium" })
|
|
52
53
|
| discriminatedUnionTypes.Unknown<"type">;
|
|
53
54
|
|
|
54
55
|
export type Agent = {
|
|
@@ -61,13 +62,13 @@ export type Agent = {
|
|
|
61
62
|
*/
|
|
62
63
|
tools?:
|
|
63
64
|
| Array<
|
|
64
|
-
| CodeInterpreterTool
|
|
65
|
-
| CustomConnector
|
|
66
|
-
| DocumentLibraryTool
|
|
65
|
+
| (CodeInterpreterTool & { type: "code_interpreter" })
|
|
66
|
+
| (CustomConnector & { type: "connector" })
|
|
67
|
+
| (DocumentLibraryTool & { type: "document_library" })
|
|
67
68
|
| FunctionTool
|
|
68
|
-
| ImageGenerationTool
|
|
69
|
-
| WebSearchTool
|
|
70
|
-
| WebSearchPremiumTool
|
|
69
|
+
| (ImageGenerationTool & { type: "image_generation" })
|
|
70
|
+
| (WebSearchTool & { type: "web_search" })
|
|
71
|
+
| (WebSearchPremiumTool & { type: "web_search_premium" })
|
|
71
72
|
| discriminatedUnionTypes.Unknown<"type">
|
|
72
73
|
>
|
|
73
74
|
| undefined;
|
|
@@ -80,7 +81,7 @@ export type Agent = {
|
|
|
80
81
|
name: string;
|
|
81
82
|
description?: string | null | undefined;
|
|
82
83
|
handoffs?: Array<string> | null | undefined;
|
|
83
|
-
metadata?:
|
|
84
|
+
metadata?: MetadataDict | null | undefined;
|
|
84
85
|
object: "agent";
|
|
85
86
|
id: string;
|
|
86
87
|
version: number;
|
|
@@ -95,13 +96,25 @@ export type Agent = {
|
|
|
95
96
|
/** @internal */
|
|
96
97
|
export const AgentTool$inboundSchema: z.ZodType<AgentTool, unknown> =
|
|
97
98
|
discriminatedUnion("type", {
|
|
98
|
-
code_interpreter: CodeInterpreterTool$inboundSchema
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
code_interpreter: CodeInterpreterTool$inboundSchema.and(
|
|
100
|
+
z.object({ type: z.literal("code_interpreter") }),
|
|
101
|
+
),
|
|
102
|
+
connector: CustomConnector$inboundSchema.and(
|
|
103
|
+
z.object({ type: z.literal("connector") }),
|
|
104
|
+
),
|
|
105
|
+
document_library: DocumentLibraryTool$inboundSchema.and(
|
|
106
|
+
z.object({ type: z.literal("document_library") }),
|
|
107
|
+
),
|
|
101
108
|
function: FunctionTool$inboundSchema,
|
|
102
|
-
image_generation: ImageGenerationTool$inboundSchema
|
|
103
|
-
|
|
104
|
-
|
|
109
|
+
image_generation: ImageGenerationTool$inboundSchema.and(
|
|
110
|
+
z.object({ type: z.literal("image_generation") }),
|
|
111
|
+
),
|
|
112
|
+
web_search: WebSearchTool$inboundSchema.and(
|
|
113
|
+
z.object({ type: z.literal("web_search") }),
|
|
114
|
+
),
|
|
115
|
+
web_search_premium: WebSearchPremiumTool$inboundSchema.and(
|
|
116
|
+
z.object({ type: z.literal("web_search_premium") }),
|
|
117
|
+
),
|
|
105
118
|
});
|
|
106
119
|
|
|
107
120
|
export function agentToolFromJSON(
|
|
@@ -118,13 +131,25 @@ export function agentToolFromJSON(
|
|
|
118
131
|
export const Agent$inboundSchema: z.ZodType<Agent, unknown> = z.object({
|
|
119
132
|
instructions: z.nullable(z.string()).optional(),
|
|
120
133
|
tools: z.array(discriminatedUnion("type", {
|
|
121
|
-
code_interpreter: CodeInterpreterTool$inboundSchema
|
|
122
|
-
|
|
123
|
-
|
|
134
|
+
code_interpreter: CodeInterpreterTool$inboundSchema.and(
|
|
135
|
+
z.object({ type: z.literal("code_interpreter") }),
|
|
136
|
+
),
|
|
137
|
+
connector: CustomConnector$inboundSchema.and(
|
|
138
|
+
z.object({ type: z.literal("connector") }),
|
|
139
|
+
),
|
|
140
|
+
document_library: DocumentLibraryTool$inboundSchema.and(
|
|
141
|
+
z.object({ type: z.literal("document_library") }),
|
|
142
|
+
),
|
|
124
143
|
function: FunctionTool$inboundSchema,
|
|
125
|
-
image_generation: ImageGenerationTool$inboundSchema
|
|
126
|
-
|
|
127
|
-
|
|
144
|
+
image_generation: ImageGenerationTool$inboundSchema.and(
|
|
145
|
+
z.object({ type: z.literal("image_generation") }),
|
|
146
|
+
),
|
|
147
|
+
web_search: WebSearchTool$inboundSchema.and(
|
|
148
|
+
z.object({ type: z.literal("web_search") }),
|
|
149
|
+
),
|
|
150
|
+
web_search_premium: WebSearchPremiumTool$inboundSchema.and(
|
|
151
|
+
z.object({ type: z.literal("web_search_premium") }),
|
|
152
|
+
),
|
|
128
153
|
})).optional(),
|
|
129
154
|
completion_args: CompletionArgs$inboundSchema.optional(),
|
|
130
155
|
guardrails: z.nullable(z.array(GuardrailConfig$inboundSchema)).optional(),
|
|
@@ -132,7 +157,7 @@ export const Agent$inboundSchema: z.ZodType<Agent, unknown> = z.object({
|
|
|
132
157
|
name: z.string(),
|
|
133
158
|
description: z.nullable(z.string()).optional(),
|
|
134
159
|
handoffs: z.nullable(z.array(z.string())).optional(),
|
|
135
|
-
metadata: z.nullable(
|
|
160
|
+
metadata: z.nullable(MetadataDict$inboundSchema).optional(),
|
|
136
161
|
object: z.literal("agent").default("agent"),
|
|
137
162
|
id: z.string(),
|
|
138
163
|
version: z.int(),
|
|
@@ -9,6 +9,7 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { smartUnion } from "../../types/smartUnion.js";
|
|
11
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
import { MetadataDict, MetadataDict$inboundSchema } from "./metadatadict.js";
|
|
12
13
|
|
|
13
14
|
export type AgentConversationAgentVersion = string | number;
|
|
14
15
|
|
|
@@ -24,7 +25,7 @@ export type AgentConversation = {
|
|
|
24
25
|
/**
|
|
25
26
|
* Custom metadata for the conversation.
|
|
26
27
|
*/
|
|
27
|
-
metadata?:
|
|
28
|
+
metadata?: MetadataDict | null | undefined;
|
|
28
29
|
object: "conversation";
|
|
29
30
|
id: string;
|
|
30
31
|
createdAt: Date;
|
|
@@ -56,7 +57,7 @@ export const AgentConversation$inboundSchema: z.ZodType<
|
|
|
56
57
|
> = z.object({
|
|
57
58
|
name: z.nullable(z.string()).optional(),
|
|
58
59
|
description: z.nullable(z.string()).optional(),
|
|
59
|
-
metadata: z.nullable(
|
|
60
|
+
metadata: z.nullable(MetadataDict$inboundSchema).optional(),
|
|
60
61
|
object: z.literal("conversation").default("conversation"),
|
|
61
62
|
id: z.string(),
|
|
62
63
|
created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)),
|
|
@@ -11,11 +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";
|
|
14
29
|
import {
|
|
15
30
|
GuardrailConfig,
|
|
16
31
|
GuardrailConfig$Outbound,
|
|
17
32
|
GuardrailConfig$outboundSchema,
|
|
18
33
|
} from "./guardrailconfig.js";
|
|
34
|
+
import {
|
|
35
|
+
ImageGenerationTool,
|
|
36
|
+
ImageGenerationTool$Outbound,
|
|
37
|
+
ImageGenerationTool$outboundSchema,
|
|
38
|
+
} from "./imagegenerationtool.js";
|
|
19
39
|
import {
|
|
20
40
|
MistralPromptMode,
|
|
21
41
|
MistralPromptMode$outboundSchema,
|
|
@@ -59,6 +79,16 @@ import {
|
|
|
59
79
|
UserMessage$Outbound,
|
|
60
80
|
UserMessage$outboundSchema,
|
|
61
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";
|
|
62
92
|
|
|
63
93
|
/**
|
|
64
94
|
* Stop generation if this token is detected. Or if one of these tokens is detected when providing an array
|
|
@@ -71,6 +101,27 @@ export type AgentsCompletionRequestMessage =
|
|
|
71
101
|
| ToolMessage
|
|
72
102
|
| UserMessage;
|
|
73
103
|
|
|
104
|
+
export type AgentsCompletionRequestTools1 =
|
|
105
|
+
| DocumentLibraryTool
|
|
106
|
+
| CustomConnector
|
|
107
|
+
| Tool
|
|
108
|
+
| WebSearchTool
|
|
109
|
+
| WebSearchPremiumTool
|
|
110
|
+
| CodeInterpreterTool
|
|
111
|
+
| ImageGenerationTool;
|
|
112
|
+
|
|
113
|
+
export type AgentsCompletionRequestTools2 =
|
|
114
|
+
| Array<
|
|
115
|
+
| DocumentLibraryTool
|
|
116
|
+
| CustomConnector
|
|
117
|
+
| Tool
|
|
118
|
+
| WebSearchTool
|
|
119
|
+
| WebSearchPremiumTool
|
|
120
|
+
| CodeInterpreterTool
|
|
121
|
+
| ImageGenerationTool
|
|
122
|
+
>
|
|
123
|
+
| Array<string>;
|
|
124
|
+
|
|
74
125
|
export type AgentsCompletionRequestToolChoice = ToolChoice | ToolChoiceEnum;
|
|
75
126
|
|
|
76
127
|
export type AgentsCompletionRequest = {
|
|
@@ -104,7 +155,19 @@ export type AgentsCompletionRequest = {
|
|
|
104
155
|
* Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.
|
|
105
156
|
*/
|
|
106
157
|
responseFormat?: ResponseFormat | undefined;
|
|
107
|
-
tools?:
|
|
158
|
+
tools?:
|
|
159
|
+
| Array<
|
|
160
|
+
| DocumentLibraryTool
|
|
161
|
+
| CustomConnector
|
|
162
|
+
| Tool
|
|
163
|
+
| WebSearchTool
|
|
164
|
+
| WebSearchPremiumTool
|
|
165
|
+
| CodeInterpreterTool
|
|
166
|
+
| ImageGenerationTool
|
|
167
|
+
>
|
|
168
|
+
| Array<string>
|
|
169
|
+
| null
|
|
170
|
+
| undefined;
|
|
108
171
|
toolChoice?: ToolChoice | ToolChoiceEnum | undefined;
|
|
109
172
|
/**
|
|
110
173
|
* The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.
|
|
@@ -133,6 +196,7 @@ export type AgentsCompletionRequest = {
|
|
|
133
196
|
* The ID of the agent to use for this completion.
|
|
134
197
|
*/
|
|
135
198
|
agentId: string;
|
|
199
|
+
[additionalProperties: string]: unknown;
|
|
136
200
|
};
|
|
137
201
|
|
|
138
202
|
/** @internal */
|
|
@@ -184,6 +248,82 @@ export function agentsCompletionRequestMessageToJSON(
|
|
|
184
248
|
);
|
|
185
249
|
}
|
|
186
250
|
|
|
251
|
+
/** @internal */
|
|
252
|
+
export type AgentsCompletionRequestTools1$Outbound =
|
|
253
|
+
| DocumentLibraryTool$Outbound
|
|
254
|
+
| CustomConnector$Outbound
|
|
255
|
+
| Tool$Outbound
|
|
256
|
+
| WebSearchTool$Outbound
|
|
257
|
+
| WebSearchPremiumTool$Outbound
|
|
258
|
+
| CodeInterpreterTool$Outbound
|
|
259
|
+
| ImageGenerationTool$Outbound;
|
|
260
|
+
|
|
261
|
+
/** @internal */
|
|
262
|
+
export const AgentsCompletionRequestTools1$outboundSchema: z.ZodType<
|
|
263
|
+
AgentsCompletionRequestTools1$Outbound,
|
|
264
|
+
AgentsCompletionRequestTools1
|
|
265
|
+
> = smartUnion([
|
|
266
|
+
DocumentLibraryTool$outboundSchema,
|
|
267
|
+
CustomConnector$outboundSchema,
|
|
268
|
+
Tool$outboundSchema,
|
|
269
|
+
WebSearchTool$outboundSchema,
|
|
270
|
+
WebSearchPremiumTool$outboundSchema,
|
|
271
|
+
CodeInterpreterTool$outboundSchema,
|
|
272
|
+
ImageGenerationTool$outboundSchema,
|
|
273
|
+
]);
|
|
274
|
+
|
|
275
|
+
export function agentsCompletionRequestTools1ToJSON(
|
|
276
|
+
agentsCompletionRequestTools1: AgentsCompletionRequestTools1,
|
|
277
|
+
): string {
|
|
278
|
+
return JSON.stringify(
|
|
279
|
+
AgentsCompletionRequestTools1$outboundSchema.parse(
|
|
280
|
+
agentsCompletionRequestTools1,
|
|
281
|
+
),
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** @internal */
|
|
286
|
+
export type AgentsCompletionRequestTools2$Outbound =
|
|
287
|
+
| Array<
|
|
288
|
+
| DocumentLibraryTool$Outbound
|
|
289
|
+
| CustomConnector$Outbound
|
|
290
|
+
| Tool$Outbound
|
|
291
|
+
| WebSearchTool$Outbound
|
|
292
|
+
| WebSearchPremiumTool$Outbound
|
|
293
|
+
| CodeInterpreterTool$Outbound
|
|
294
|
+
| ImageGenerationTool$Outbound
|
|
295
|
+
>
|
|
296
|
+
| Array<string>;
|
|
297
|
+
|
|
298
|
+
/** @internal */
|
|
299
|
+
export const AgentsCompletionRequestTools2$outboundSchema: z.ZodType<
|
|
300
|
+
AgentsCompletionRequestTools2$Outbound,
|
|
301
|
+
AgentsCompletionRequestTools2
|
|
302
|
+
> = smartUnion([
|
|
303
|
+
z.array(
|
|
304
|
+
smartUnion([
|
|
305
|
+
DocumentLibraryTool$outboundSchema,
|
|
306
|
+
CustomConnector$outboundSchema,
|
|
307
|
+
Tool$outboundSchema,
|
|
308
|
+
WebSearchTool$outboundSchema,
|
|
309
|
+
WebSearchPremiumTool$outboundSchema,
|
|
310
|
+
CodeInterpreterTool$outboundSchema,
|
|
311
|
+
ImageGenerationTool$outboundSchema,
|
|
312
|
+
]),
|
|
313
|
+
),
|
|
314
|
+
z.array(z.string()),
|
|
315
|
+
]);
|
|
316
|
+
|
|
317
|
+
export function agentsCompletionRequestTools2ToJSON(
|
|
318
|
+
agentsCompletionRequestTools2: AgentsCompletionRequestTools2,
|
|
319
|
+
): string {
|
|
320
|
+
return JSON.stringify(
|
|
321
|
+
AgentsCompletionRequestTools2$outboundSchema.parse(
|
|
322
|
+
agentsCompletionRequestTools2,
|
|
323
|
+
),
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
|
|
187
327
|
/** @internal */
|
|
188
328
|
export type AgentsCompletionRequestToolChoice$Outbound =
|
|
189
329
|
| ToolChoice$Outbound
|
|
@@ -219,7 +359,19 @@ export type AgentsCompletionRequest$Outbound = {
|
|
|
219
359
|
| UserMessage$Outbound
|
|
220
360
|
>;
|
|
221
361
|
response_format?: ResponseFormat$Outbound | undefined;
|
|
222
|
-
tools?:
|
|
362
|
+
tools?:
|
|
363
|
+
| Array<
|
|
364
|
+
| DocumentLibraryTool$Outbound
|
|
365
|
+
| CustomConnector$Outbound
|
|
366
|
+
| Tool$Outbound
|
|
367
|
+
| WebSearchTool$Outbound
|
|
368
|
+
| WebSearchPremiumTool$Outbound
|
|
369
|
+
| CodeInterpreterTool$Outbound
|
|
370
|
+
| ImageGenerationTool$Outbound
|
|
371
|
+
>
|
|
372
|
+
| Array<string>
|
|
373
|
+
| null
|
|
374
|
+
| undefined;
|
|
223
375
|
tool_choice?: ToolChoice$Outbound | string | undefined;
|
|
224
376
|
presence_penalty?: number | undefined;
|
|
225
377
|
frequency_penalty?: number | undefined;
|
|
@@ -230,6 +382,7 @@ export type AgentsCompletionRequest$Outbound = {
|
|
|
230
382
|
prompt_mode?: string | null | undefined;
|
|
231
383
|
guardrails?: Array<GuardrailConfig$Outbound> | null | undefined;
|
|
232
384
|
agent_id: string;
|
|
385
|
+
[additionalProperties: string]: unknown;
|
|
233
386
|
};
|
|
234
387
|
|
|
235
388
|
/** @internal */
|
|
@@ -253,7 +406,22 @@ export const AgentsCompletionRequest$outboundSchema: z.ZodType<
|
|
|
253
406
|
]),
|
|
254
407
|
),
|
|
255
408
|
responseFormat: ResponseFormat$outboundSchema.optional(),
|
|
256
|
-
tools: z.nullable(
|
|
409
|
+
tools: z.nullable(
|
|
410
|
+
smartUnion([
|
|
411
|
+
z.array(
|
|
412
|
+
smartUnion([
|
|
413
|
+
DocumentLibraryTool$outboundSchema,
|
|
414
|
+
CustomConnector$outboundSchema,
|
|
415
|
+
Tool$outboundSchema,
|
|
416
|
+
WebSearchTool$outboundSchema,
|
|
417
|
+
WebSearchPremiumTool$outboundSchema,
|
|
418
|
+
CodeInterpreterTool$outboundSchema,
|
|
419
|
+
ImageGenerationTool$outboundSchema,
|
|
420
|
+
]),
|
|
421
|
+
),
|
|
422
|
+
z.array(z.string()),
|
|
423
|
+
]),
|
|
424
|
+
).optional(),
|
|
257
425
|
toolChoice: smartUnion([
|
|
258
426
|
ToolChoice$outboundSchema,
|
|
259
427
|
ToolChoiceEnum$outboundSchema,
|
|
@@ -267,19 +435,21 @@ export const AgentsCompletionRequest$outboundSchema: z.ZodType<
|
|
|
267
435
|
promptMode: z.nullable(MistralPromptMode$outboundSchema).optional(),
|
|
268
436
|
guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
|
|
269
437
|
agentId: z.string(),
|
|
270
|
-
}).transform((v) => {
|
|
271
|
-
return
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
438
|
+
}).catchall(z.any()).transform((v) => {
|
|
439
|
+
return {
|
|
440
|
+
...remap$(v, {
|
|
441
|
+
maxTokens: "max_tokens",
|
|
442
|
+
randomSeed: "random_seed",
|
|
443
|
+
responseFormat: "response_format",
|
|
444
|
+
toolChoice: "tool_choice",
|
|
445
|
+
presencePenalty: "presence_penalty",
|
|
446
|
+
frequencyPenalty: "frequency_penalty",
|
|
447
|
+
parallelToolCalls: "parallel_tool_calls",
|
|
448
|
+
reasoningEffort: "reasoning_effort",
|
|
449
|
+
promptMode: "prompt_mode",
|
|
450
|
+
agentId: "agent_id",
|
|
451
|
+
}),
|
|
452
|
+
};
|
|
283
453
|
});
|
|
284
454
|
|
|
285
455
|
export function agentsCompletionRequestToJSON(
|