@mistralai/mistralai 2.0.0 → 2.1.1
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 +2 -3
- package/esm/models/components/agent.d.ts.map +1 -1
- package/esm/models/components/agent.js +2 -1
- 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/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 +3 -6
- package/esm/models/components/conversationrequest.d.ts.map +1 -1
- package/esm/models/components/conversationrequest.js +2 -1
- 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 +3 -6
- package/esm/models/components/conversationstreamrequest.d.ts.map +1 -1
- package/esm/models/components/conversationstreamrequest.js +2 -1
- package/esm/models/components/conversationstreamrequest.js.map +1 -1
- package/esm/models/components/createagentrequest.d.ts +3 -6
- package/esm/models/components/createagentrequest.d.ts.map +1 -1
- package/esm/models/components/createagentrequest.js +2 -1
- package/esm/models/components/createagentrequest.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 +2 -3
- package/esm/models/components/modelconversation.d.ts.map +1 -1
- package/esm/models/components/modelconversation.js +2 -1
- 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 +3 -6
- package/esm/models/components/updateagentrequest.d.ts.map +1 -1
- package/esm/models/components/updateagentrequest.js +2 -1
- 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/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 +3 -2
- package/src/models/components/agentconversation.ts +3 -2
- package/src/models/components/completionargs.ts +11 -0
- package/src/models/components/conversationrequest.ts +8 -3
- package/src/models/components/conversationrestartrequest.ts +8 -3
- package/src/models/components/conversationrestartstreamrequest.ts +8 -3
- package/src/models/components/conversationstreamrequest.ts +8 -3
- package/src/models/components/createagentrequest.ts +8 -3
- 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 +3 -2
- 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 +8 -3
- 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/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.1",
|
|
64
64
|
genVersion: "2.859.0",
|
|
65
65
|
userAgent:
|
|
66
|
-
"speakeasy-sdk/typescript 2.
|
|
66
|
+
"speakeasy-sdk/typescript 2.1.1 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,
|
|
@@ -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;
|
|
@@ -132,7 +133,7 @@ export const Agent$inboundSchema: z.ZodType<Agent, unknown> = z.object({
|
|
|
132
133
|
name: z.string(),
|
|
133
134
|
description: z.nullable(z.string()).optional(),
|
|
134
135
|
handoffs: z.nullable(z.array(z.string())).optional(),
|
|
135
|
-
metadata: z.nullable(
|
|
136
|
+
metadata: z.nullable(MetadataDict$inboundSchema).optional(),
|
|
136
137
|
object: z.literal("agent").default("agent"),
|
|
137
138
|
id: z.string(),
|
|
138
139
|
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)),
|
|
@@ -20,6 +20,11 @@ import {
|
|
|
20
20
|
Prediction$Outbound,
|
|
21
21
|
Prediction$outboundSchema,
|
|
22
22
|
} from "./prediction.js";
|
|
23
|
+
import {
|
|
24
|
+
ReasoningEffort,
|
|
25
|
+
ReasoningEffort$inboundSchema,
|
|
26
|
+
ReasoningEffort$outboundSchema,
|
|
27
|
+
} from "./reasoningeffort.js";
|
|
23
28
|
import {
|
|
24
29
|
ResponseFormat,
|
|
25
30
|
ResponseFormat$inboundSchema,
|
|
@@ -46,6 +51,7 @@ export type CompletionArgs = {
|
|
|
46
51
|
prediction?: Prediction | null | undefined;
|
|
47
52
|
responseFormat?: ResponseFormat | null | undefined;
|
|
48
53
|
toolChoice?: ToolChoiceEnum | undefined;
|
|
54
|
+
reasoningEffort?: ReasoningEffort | null | undefined;
|
|
49
55
|
};
|
|
50
56
|
|
|
51
57
|
/** @internal */
|
|
@@ -61,6 +67,7 @@ export const CompletionArgs$inboundSchema: z.ZodType<CompletionArgs, unknown> =
|
|
|
61
67
|
prediction: z.nullable(Prediction$inboundSchema).optional(),
|
|
62
68
|
response_format: z.nullable(ResponseFormat$inboundSchema).optional(),
|
|
63
69
|
tool_choice: ToolChoiceEnum$inboundSchema.optional(),
|
|
70
|
+
reasoning_effort: z.nullable(ReasoningEffort$inboundSchema).optional(),
|
|
64
71
|
}).transform((v) => {
|
|
65
72
|
return remap$(v, {
|
|
66
73
|
"presence_penalty": "presencePenalty",
|
|
@@ -70,6 +77,7 @@ export const CompletionArgs$inboundSchema: z.ZodType<CompletionArgs, unknown> =
|
|
|
70
77
|
"random_seed": "randomSeed",
|
|
71
78
|
"response_format": "responseFormat",
|
|
72
79
|
"tool_choice": "toolChoice",
|
|
80
|
+
"reasoning_effort": "reasoningEffort",
|
|
73
81
|
});
|
|
74
82
|
});
|
|
75
83
|
/** @internal */
|
|
@@ -84,6 +92,7 @@ export type CompletionArgs$Outbound = {
|
|
|
84
92
|
prediction?: Prediction$Outbound | null | undefined;
|
|
85
93
|
response_format?: ResponseFormat$Outbound | null | undefined;
|
|
86
94
|
tool_choice?: string | undefined;
|
|
95
|
+
reasoning_effort?: string | null | undefined;
|
|
87
96
|
};
|
|
88
97
|
|
|
89
98
|
/** @internal */
|
|
@@ -101,6 +110,7 @@ export const CompletionArgs$outboundSchema: z.ZodType<
|
|
|
101
110
|
prediction: z.nullable(Prediction$outboundSchema).optional(),
|
|
102
111
|
responseFormat: z.nullable(ResponseFormat$outboundSchema).optional(),
|
|
103
112
|
toolChoice: ToolChoiceEnum$outboundSchema.optional(),
|
|
113
|
+
reasoningEffort: z.nullable(ReasoningEffort$outboundSchema).optional(),
|
|
104
114
|
}).transform((v) => {
|
|
105
115
|
return remap$(v, {
|
|
106
116
|
presencePenalty: "presence_penalty",
|
|
@@ -110,6 +120,7 @@ export const CompletionArgs$outboundSchema: z.ZodType<
|
|
|
110
120
|
randomSeed: "random_seed",
|
|
111
121
|
responseFormat: "response_format",
|
|
112
122
|
toolChoice: "tool_choice",
|
|
123
|
+
reasoningEffort: "reasoning_effort",
|
|
113
124
|
});
|
|
114
125
|
});
|
|
115
126
|
|
|
@@ -47,6 +47,11 @@ import {
|
|
|
47
47
|
ImageGenerationTool$Outbound,
|
|
48
48
|
ImageGenerationTool$outboundSchema,
|
|
49
49
|
} from "./imagegenerationtool.js";
|
|
50
|
+
import {
|
|
51
|
+
MetadataDict,
|
|
52
|
+
MetadataDict$Outbound,
|
|
53
|
+
MetadataDict$outboundSchema,
|
|
54
|
+
} from "./metadatadict.js";
|
|
50
55
|
import {
|
|
51
56
|
WebSearchPremiumTool,
|
|
52
57
|
WebSearchPremiumTool$Outbound,
|
|
@@ -99,7 +104,7 @@ export type ConversationRequest = {
|
|
|
99
104
|
guardrails?: Array<GuardrailConfig> | null | undefined;
|
|
100
105
|
name?: string | null | undefined;
|
|
101
106
|
description?: string | null | undefined;
|
|
102
|
-
metadata?:
|
|
107
|
+
metadata?: MetadataDict | null | undefined;
|
|
103
108
|
agentId?: string | null | undefined;
|
|
104
109
|
agentVersion?: string | number | null | undefined;
|
|
105
110
|
model?: string | null | undefined;
|
|
@@ -184,7 +189,7 @@ export type ConversationRequest$Outbound = {
|
|
|
184
189
|
guardrails?: Array<GuardrailConfig$Outbound> | null | undefined;
|
|
185
190
|
name?: string | null | undefined;
|
|
186
191
|
description?: string | null | undefined;
|
|
187
|
-
metadata?:
|
|
192
|
+
metadata?: MetadataDict$Outbound | null | undefined;
|
|
188
193
|
agent_id?: string | null | undefined;
|
|
189
194
|
agent_version?: string | number | null | undefined;
|
|
190
195
|
model?: string | null | undefined;
|
|
@@ -219,7 +224,7 @@ export const ConversationRequest$outboundSchema: z.ZodType<
|
|
|
219
224
|
guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
|
|
220
225
|
name: z.nullable(z.string()).optional(),
|
|
221
226
|
description: z.nullable(z.string()).optional(),
|
|
222
|
-
metadata: z.nullable(
|
|
227
|
+
metadata: z.nullable(MetadataDict$outboundSchema).optional(),
|
|
223
228
|
agentId: z.nullable(z.string()).optional(),
|
|
224
229
|
agentVersion: z.nullable(smartUnion([z.string(), z.int()])).optional(),
|
|
225
230
|
model: z.nullable(z.string()).optional(),
|
|
@@ -22,6 +22,11 @@ import {
|
|
|
22
22
|
GuardrailConfig$Outbound,
|
|
23
23
|
GuardrailConfig$outboundSchema,
|
|
24
24
|
} from "./guardrailconfig.js";
|
|
25
|
+
import {
|
|
26
|
+
MetadataDict,
|
|
27
|
+
MetadataDict$Outbound,
|
|
28
|
+
MetadataDict$outboundSchema,
|
|
29
|
+
} from "./metadatadict.js";
|
|
25
30
|
|
|
26
31
|
export const ConversationRestartRequestHandoffExecution = {
|
|
27
32
|
Client: "client",
|
|
@@ -55,7 +60,7 @@ export type ConversationRestartRequest = {
|
|
|
55
60
|
/**
|
|
56
61
|
* Custom metadata for the conversation.
|
|
57
62
|
*/
|
|
58
|
-
metadata?:
|
|
63
|
+
metadata?: MetadataDict | null | undefined;
|
|
59
64
|
fromEntryId: string;
|
|
60
65
|
/**
|
|
61
66
|
* Specific version of the agent to use when restarting. If not provided, uses the current version.
|
|
@@ -97,7 +102,7 @@ export type ConversationRestartRequest$Outbound = {
|
|
|
97
102
|
handoff_execution: string;
|
|
98
103
|
completion_args?: CompletionArgs$Outbound | undefined;
|
|
99
104
|
guardrails?: Array<GuardrailConfig$Outbound> | null | undefined;
|
|
100
|
-
metadata?:
|
|
105
|
+
metadata?: MetadataDict$Outbound | null | undefined;
|
|
101
106
|
from_entry_id: string;
|
|
102
107
|
agent_version?: string | number | null | undefined;
|
|
103
108
|
};
|
|
@@ -114,7 +119,7 @@ export const ConversationRestartRequest$outboundSchema: z.ZodType<
|
|
|
114
119
|
.default("server"),
|
|
115
120
|
completionArgs: CompletionArgs$outboundSchema.optional(),
|
|
116
121
|
guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
|
|
117
|
-
metadata: z.nullable(
|
|
122
|
+
metadata: z.nullable(MetadataDict$outboundSchema).optional(),
|
|
118
123
|
fromEntryId: z.string(),
|
|
119
124
|
agentVersion: z.nullable(smartUnion([z.string(), z.int()])).optional(),
|
|
120
125
|
}).transform((v) => {
|
|
@@ -22,6 +22,11 @@ import {
|
|
|
22
22
|
GuardrailConfig$Outbound,
|
|
23
23
|
GuardrailConfig$outboundSchema,
|
|
24
24
|
} from "./guardrailconfig.js";
|
|
25
|
+
import {
|
|
26
|
+
MetadataDict,
|
|
27
|
+
MetadataDict$Outbound,
|
|
28
|
+
MetadataDict$outboundSchema,
|
|
29
|
+
} from "./metadatadict.js";
|
|
25
30
|
|
|
26
31
|
export const ConversationRestartStreamRequestHandoffExecution = {
|
|
27
32
|
Client: "client",
|
|
@@ -57,7 +62,7 @@ export type ConversationRestartStreamRequest = {
|
|
|
57
62
|
/**
|
|
58
63
|
* Custom metadata for the conversation.
|
|
59
64
|
*/
|
|
60
|
-
metadata?:
|
|
65
|
+
metadata?: MetadataDict | null | undefined;
|
|
61
66
|
fromEntryId: string;
|
|
62
67
|
/**
|
|
63
68
|
* Specific version of the agent to use when restarting. If not provided, uses the current version.
|
|
@@ -102,7 +107,7 @@ export type ConversationRestartStreamRequest$Outbound = {
|
|
|
102
107
|
handoff_execution: string;
|
|
103
108
|
completion_args?: CompletionArgs$Outbound | undefined;
|
|
104
109
|
guardrails?: Array<GuardrailConfig$Outbound> | null | undefined;
|
|
105
|
-
metadata?:
|
|
110
|
+
metadata?: MetadataDict$Outbound | null | undefined;
|
|
106
111
|
from_entry_id: string;
|
|
107
112
|
agent_version?: string | number | null | undefined;
|
|
108
113
|
};
|
|
@@ -121,7 +126,7 @@ export const ConversationRestartStreamRequest$outboundSchema: z.ZodType<
|
|
|
121
126
|
),
|
|
122
127
|
completionArgs: CompletionArgs$outboundSchema.optional(),
|
|
123
128
|
guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
|
|
124
|
-
metadata: z.nullable(
|
|
129
|
+
metadata: z.nullable(MetadataDict$outboundSchema).optional(),
|
|
125
130
|
fromEntryId: z.string(),
|
|
126
131
|
agentVersion: z.nullable(smartUnion([z.string(), z.int()])).optional(),
|
|
127
132
|
}).transform((v) => {
|
|
@@ -47,6 +47,11 @@ import {
|
|
|
47
47
|
ImageGenerationTool$Outbound,
|
|
48
48
|
ImageGenerationTool$outboundSchema,
|
|
49
49
|
} from "./imagegenerationtool.js";
|
|
50
|
+
import {
|
|
51
|
+
MetadataDict,
|
|
52
|
+
MetadataDict$Outbound,
|
|
53
|
+
MetadataDict$outboundSchema,
|
|
54
|
+
} from "./metadatadict.js";
|
|
50
55
|
import {
|
|
51
56
|
WebSearchPremiumTool,
|
|
52
57
|
WebSearchPremiumTool$Outbound,
|
|
@@ -102,7 +107,7 @@ export type ConversationStreamRequest = {
|
|
|
102
107
|
guardrails?: Array<GuardrailConfig> | null | undefined;
|
|
103
108
|
name?: string | null | undefined;
|
|
104
109
|
description?: string | null | undefined;
|
|
105
|
-
metadata?:
|
|
110
|
+
metadata?: MetadataDict | null | undefined;
|
|
106
111
|
agentId?: string | null | undefined;
|
|
107
112
|
agentVersion?: string | number | null | undefined;
|
|
108
113
|
model?: string | null | undefined;
|
|
@@ -190,7 +195,7 @@ export type ConversationStreamRequest$Outbound = {
|
|
|
190
195
|
guardrails?: Array<GuardrailConfig$Outbound> | null | undefined;
|
|
191
196
|
name?: string | null | undefined;
|
|
192
197
|
description?: string | null | undefined;
|
|
193
|
-
metadata?:
|
|
198
|
+
metadata?: MetadataDict$Outbound | null | undefined;
|
|
194
199
|
agent_id?: string | null | undefined;
|
|
195
200
|
agent_version?: string | number | null | undefined;
|
|
196
201
|
model?: string | null | undefined;
|
|
@@ -225,7 +230,7 @@ export const ConversationStreamRequest$outboundSchema: z.ZodType<
|
|
|
225
230
|
guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
|
|
226
231
|
name: z.nullable(z.string()).optional(),
|
|
227
232
|
description: z.nullable(z.string()).optional(),
|
|
228
|
-
metadata: z.nullable(
|
|
233
|
+
metadata: z.nullable(MetadataDict$outboundSchema).optional(),
|
|
229
234
|
agentId: z.nullable(z.string()).optional(),
|
|
230
235
|
agentVersion: z.nullable(smartUnion([z.string(), z.int()])).optional(),
|
|
231
236
|
model: z.nullable(z.string()).optional(),
|
|
@@ -40,6 +40,11 @@ import {
|
|
|
40
40
|
ImageGenerationTool$Outbound,
|
|
41
41
|
ImageGenerationTool$outboundSchema,
|
|
42
42
|
} from "./imagegenerationtool.js";
|
|
43
|
+
import {
|
|
44
|
+
MetadataDict,
|
|
45
|
+
MetadataDict$Outbound,
|
|
46
|
+
MetadataDict$outboundSchema,
|
|
47
|
+
} from "./metadatadict.js";
|
|
43
48
|
import {
|
|
44
49
|
WebSearchPremiumTool,
|
|
45
50
|
WebSearchPremiumTool$Outbound,
|
|
@@ -88,7 +93,7 @@ export type CreateAgentRequest = {
|
|
|
88
93
|
name: string;
|
|
89
94
|
description?: string | null | undefined;
|
|
90
95
|
handoffs?: Array<string> | null | undefined;
|
|
91
|
-
metadata?:
|
|
96
|
+
metadata?: MetadataDict | null | undefined;
|
|
92
97
|
versionMessage?: string | null | undefined;
|
|
93
98
|
};
|
|
94
99
|
|
|
@@ -144,7 +149,7 @@ export type CreateAgentRequest$Outbound = {
|
|
|
144
149
|
name: string;
|
|
145
150
|
description?: string | null | undefined;
|
|
146
151
|
handoffs?: Array<string> | null | undefined;
|
|
147
|
-
metadata?:
|
|
152
|
+
metadata?: MetadataDict$Outbound | null | undefined;
|
|
148
153
|
version_message?: string | null | undefined;
|
|
149
154
|
};
|
|
150
155
|
|
|
@@ -171,7 +176,7 @@ export const CreateAgentRequest$outboundSchema: z.ZodType<
|
|
|
171
176
|
name: z.string(),
|
|
172
177
|
description: z.nullable(z.string()).optional(),
|
|
173
178
|
handoffs: z.nullable(z.array(z.string())).optional(),
|
|
174
|
-
metadata: z.nullable(
|
|
179
|
+
metadata: z.nullable(MetadataDict$outboundSchema).optional(),
|
|
175
180
|
versionMessage: z.nullable(z.string()).optional(),
|
|
176
181
|
}).transform((v) => {
|
|
177
182
|
return remap$(v, {
|
|
@@ -167,6 +167,7 @@ export * from "./importdatasetfromplaygroundrequest.js";
|
|
|
167
167
|
export * from "./inputentries.js";
|
|
168
168
|
export * from "./inputs.js";
|
|
169
169
|
export * from "./instructrequest.js";
|
|
170
|
+
export * from "./internalmetadata.js";
|
|
170
171
|
export * from "./jobmetadata.js";
|
|
171
172
|
export * from "./jsonschema.js";
|
|
172
173
|
export * from "./judge.js";
|
|
@@ -201,7 +202,11 @@ export * from "./messageoutputcontentchunks.js";
|
|
|
201
202
|
export * from "./messageoutputentry.js";
|
|
202
203
|
export * from "./messageoutputevent.js";
|
|
203
204
|
export * from "./messageresponse.js";
|
|
205
|
+
export * from "./messagetokens.js";
|
|
206
|
+
export * from "./metadatadict.js";
|
|
204
207
|
export * from "./metric.js";
|
|
208
|
+
export * from "./mirrorconfig.js";
|
|
209
|
+
export * from "./mirrorsource.js";
|
|
205
210
|
export * from "./mistralpromptmode.js";
|
|
206
211
|
export * from "./modelcapabilities.js";
|
|
207
212
|
export * from "./modelconversation.js";
|
|
@@ -236,6 +241,7 @@ export * from "./paginationresponse.js";
|
|
|
236
241
|
export * from "./prediction.js";
|
|
237
242
|
export * from "./processingstatus.js";
|
|
238
243
|
export * from "./processstatus.js";
|
|
244
|
+
export * from "./prompttokensdetails.js";
|
|
239
245
|
export * from "./realtimetranscriptionerror.js";
|
|
240
246
|
export * from "./realtimetranscriptionerrordetail.js";
|
|
241
247
|
export * from "./realtimetranscriptioninputaudioappend.js";
|
|
@@ -256,6 +262,7 @@ export * from "./responseerrorevent.js";
|
|
|
256
262
|
export * from "./responseformat.js";
|
|
257
263
|
export * from "./responseformats.js";
|
|
258
264
|
export * from "./responsestartedevent.js";
|
|
265
|
+
export * from "./roles.js";
|
|
259
266
|
export * from "./sampletype.js";
|
|
260
267
|
export * from "./searchchatcompletioneventidsrequest.js";
|
|
261
268
|
export * from "./searchchatcompletioneventidsresponse.js";
|
|
@@ -267,6 +274,11 @@ export * from "./sharing.js";
|
|
|
267
274
|
export * from "./sharingdelete.js";
|
|
268
275
|
export * from "./sharingrequest.js";
|
|
269
276
|
export * from "./source.js";
|
|
277
|
+
export * from "./speechoutputformat.js";
|
|
278
|
+
export * from "./speechrequest.js";
|
|
279
|
+
export * from "./speechstreamaudiodelta.js";
|
|
280
|
+
export * from "./speechstreamdone.js";
|
|
281
|
+
export * from "./speechstreameventtypes.js";
|
|
270
282
|
export * from "./ssetypes.js";
|
|
271
283
|
export * from "./systemmessage.js";
|
|
272
284
|
export * from "./systemmessagecontentchunks.js";
|
|
@@ -309,8 +321,13 @@ export * from "./updatejudgerequest.js";
|
|
|
309
321
|
export * from "./updatelibraryrequest.js";
|
|
310
322
|
export * from "./updatemodelrequest.js";
|
|
311
323
|
export * from "./usageinfo.js";
|
|
324
|
+
export * from "./usageinfodollardefs.js";
|
|
312
325
|
export * from "./usermessage.js";
|
|
313
326
|
export * from "./validationerror.js";
|
|
327
|
+
export * from "./voicecreaterequest.js";
|
|
328
|
+
export * from "./voicelistresponse.js";
|
|
329
|
+
export * from "./voiceresponse.js";
|
|
330
|
+
export * from "./voiceupdaterequest.js";
|
|
314
331
|
export * from "./wandbintegration.js";
|
|
315
332
|
export * from "./wandbintegrationresult.js";
|
|
316
333
|
export * from "./websearchpremiumtool.js";
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 5bb58674fbba
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { smartUnion } from "../../types/smartUnion.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
import {
|
|
13
|
+
MirrorConfig,
|
|
14
|
+
MirrorConfig$inboundSchema,
|
|
15
|
+
MirrorConfig$Outbound,
|
|
16
|
+
MirrorConfig$outboundSchema,
|
|
17
|
+
} from "./mirrorconfig.js";
|
|
18
|
+
|
|
19
|
+
export type InternalMetadataAgentVersion = string | number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Typed structure for internal metadata.
|
|
23
|
+
*/
|
|
24
|
+
export type InternalMetadata = {
|
|
25
|
+
agentId?: string | null | undefined;
|
|
26
|
+
agentVersion?: string | number | null | undefined;
|
|
27
|
+
mirrorConfig?: MirrorConfig | null | undefined;
|
|
28
|
+
scienceConfig?: { [k: string]: any } | null | undefined;
|
|
29
|
+
[additionalProperties: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const InternalMetadataAgentVersion$inboundSchema: z.ZodType<
|
|
34
|
+
InternalMetadataAgentVersion,
|
|
35
|
+
unknown
|
|
36
|
+
> = smartUnion([z.string(), z.int()]);
|
|
37
|
+
/** @internal */
|
|
38
|
+
export type InternalMetadataAgentVersion$Outbound = string | number;
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const InternalMetadataAgentVersion$outboundSchema: z.ZodType<
|
|
42
|
+
InternalMetadataAgentVersion$Outbound,
|
|
43
|
+
InternalMetadataAgentVersion
|
|
44
|
+
> = smartUnion([z.string(), z.int()]);
|
|
45
|
+
|
|
46
|
+
export function internalMetadataAgentVersionToJSON(
|
|
47
|
+
internalMetadataAgentVersion: InternalMetadataAgentVersion,
|
|
48
|
+
): string {
|
|
49
|
+
return JSON.stringify(
|
|
50
|
+
InternalMetadataAgentVersion$outboundSchema.parse(
|
|
51
|
+
internalMetadataAgentVersion,
|
|
52
|
+
),
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
export function internalMetadataAgentVersionFromJSON(
|
|
56
|
+
jsonString: string,
|
|
57
|
+
): SafeParseResult<InternalMetadataAgentVersion, SDKValidationError> {
|
|
58
|
+
return safeParse(
|
|
59
|
+
jsonString,
|
|
60
|
+
(x) => InternalMetadataAgentVersion$inboundSchema.parse(JSON.parse(x)),
|
|
61
|
+
`Failed to parse 'InternalMetadataAgentVersion' from JSON`,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** @internal */
|
|
66
|
+
export const InternalMetadata$inboundSchema: z.ZodType<
|
|
67
|
+
InternalMetadata,
|
|
68
|
+
unknown
|
|
69
|
+
> = z.object({
|
|
70
|
+
agent_id: z.nullable(z.string()).optional(),
|
|
71
|
+
agent_version: z.nullable(smartUnion([z.string(), z.int()])).optional(),
|
|
72
|
+
mirror_config: z.nullable(MirrorConfig$inboundSchema).optional(),
|
|
73
|
+
science_config: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
74
|
+
}).catchall(z.any()).transform((v) => {
|
|
75
|
+
return remap$(v, {
|
|
76
|
+
"agent_id": "agentId",
|
|
77
|
+
"agent_version": "agentVersion",
|
|
78
|
+
"mirror_config": "mirrorConfig",
|
|
79
|
+
"science_config": "scienceConfig",
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
/** @internal */
|
|
83
|
+
export type InternalMetadata$Outbound = {
|
|
84
|
+
agent_id?: string | null | undefined;
|
|
85
|
+
agent_version?: string | number | null | undefined;
|
|
86
|
+
mirror_config?: MirrorConfig$Outbound | null | undefined;
|
|
87
|
+
science_config?: { [k: string]: any } | null | undefined;
|
|
88
|
+
[additionalProperties: string]: unknown;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** @internal */
|
|
92
|
+
export const InternalMetadata$outboundSchema: z.ZodType<
|
|
93
|
+
InternalMetadata$Outbound,
|
|
94
|
+
InternalMetadata
|
|
95
|
+
> = z.object({
|
|
96
|
+
agentId: z.nullable(z.string()).optional(),
|
|
97
|
+
agentVersion: z.nullable(smartUnion([z.string(), z.int()])).optional(),
|
|
98
|
+
mirrorConfig: z.nullable(MirrorConfig$outboundSchema).optional(),
|
|
99
|
+
scienceConfig: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
100
|
+
}).catchall(z.any()).transform((v) => {
|
|
101
|
+
return {
|
|
102
|
+
...remap$(v, {
|
|
103
|
+
agentId: "agent_id",
|
|
104
|
+
agentVersion: "agent_version",
|
|
105
|
+
mirrorConfig: "mirror_config",
|
|
106
|
+
scienceConfig: "science_config",
|
|
107
|
+
}),
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export function internalMetadataToJSON(
|
|
112
|
+
internalMetadata: InternalMetadata,
|
|
113
|
+
): string {
|
|
114
|
+
return JSON.stringify(
|
|
115
|
+
InternalMetadata$outboundSchema.parse(internalMetadata),
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
export function internalMetadataFromJSON(
|
|
119
|
+
jsonString: string,
|
|
120
|
+
): SafeParseResult<InternalMetadata, SDKValidationError> {
|
|
121
|
+
return safeParse(
|
|
122
|
+
jsonString,
|
|
123
|
+
(x) => InternalMetadata$inboundSchema.parse(JSON.parse(x)),
|
|
124
|
+
`Failed to parse 'InternalMetadata' from JSON`,
|
|
125
|
+
);
|
|
126
|
+
}
|