@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,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e56d14b1a3f2
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import { Roles, Roles$inboundSchema } from "./roles.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Information on a single message included in a tokenized prompt as part of an InstructRequest.
|
|
15
|
+
*/
|
|
16
|
+
export type MessageTokens = {
|
|
17
|
+
role: Roles;
|
|
18
|
+
totalTokens?: number | null | undefined;
|
|
19
|
+
truncated: boolean;
|
|
20
|
+
usageCount: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const MessageTokens$inboundSchema: z.ZodType<MessageTokens, unknown> = z
|
|
25
|
+
.object({
|
|
26
|
+
role: Roles$inboundSchema,
|
|
27
|
+
total_tokens: z.nullable(z.int()).optional(),
|
|
28
|
+
truncated: z.boolean().default(false),
|
|
29
|
+
usage_count: z.int().default(1),
|
|
30
|
+
}).transform((v) => {
|
|
31
|
+
return remap$(v, {
|
|
32
|
+
"total_tokens": "totalTokens",
|
|
33
|
+
"usage_count": "usageCount",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export function messageTokensFromJSON(
|
|
38
|
+
jsonString: string,
|
|
39
|
+
): SafeParseResult<MessageTokens, SDKValidationError> {
|
|
40
|
+
return safeParse(
|
|
41
|
+
jsonString,
|
|
42
|
+
(x) => MessageTokens$inboundSchema.parse(JSON.parse(x)),
|
|
43
|
+
`Failed to parse 'MessageTokens' from JSON`,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: a8e91799a548
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
InternalMetadata,
|
|
12
|
+
InternalMetadata$inboundSchema,
|
|
13
|
+
InternalMetadata$Outbound,
|
|
14
|
+
InternalMetadata$outboundSchema,
|
|
15
|
+
} from "./internalmetadata.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Custom type for metadata with embedded validation.
|
|
19
|
+
*/
|
|
20
|
+
export type MetadataDict = {
|
|
21
|
+
internal?: InternalMetadata | null | undefined;
|
|
22
|
+
[additionalProperties: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const MetadataDict$inboundSchema: z.ZodType<MetadataDict, unknown> = z
|
|
27
|
+
.object({
|
|
28
|
+
internal: z.nullable(InternalMetadata$inboundSchema).optional(),
|
|
29
|
+
}).catchall(z.any());
|
|
30
|
+
/** @internal */
|
|
31
|
+
export type MetadataDict$Outbound = {
|
|
32
|
+
internal?: InternalMetadata$Outbound | null | undefined;
|
|
33
|
+
[additionalProperties: string]: unknown;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const MetadataDict$outboundSchema: z.ZodType<
|
|
38
|
+
MetadataDict$Outbound,
|
|
39
|
+
MetadataDict
|
|
40
|
+
> = z.object({
|
|
41
|
+
internal: z.nullable(InternalMetadata$outboundSchema).optional(),
|
|
42
|
+
}).catchall(z.any());
|
|
43
|
+
|
|
44
|
+
export function metadataDictToJSON(metadataDict: MetadataDict): string {
|
|
45
|
+
return JSON.stringify(MetadataDict$outboundSchema.parse(metadataDict));
|
|
46
|
+
}
|
|
47
|
+
export function metadataDictFromJSON(
|
|
48
|
+
jsonString: string,
|
|
49
|
+
): SafeParseResult<MetadataDict, SDKValidationError> {
|
|
50
|
+
return safeParse(
|
|
51
|
+
jsonString,
|
|
52
|
+
(x) => MetadataDict$inboundSchema.parse(JSON.parse(x)),
|
|
53
|
+
`Failed to parse 'MetadataDict' from JSON`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: c8c262460c15
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
MirrorSource,
|
|
13
|
+
MirrorSource$inboundSchema,
|
|
14
|
+
MirrorSource$Outbound,
|
|
15
|
+
MirrorSource$outboundSchema,
|
|
16
|
+
} from "./mirrorsource.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Configuration for mirroring behavior.
|
|
20
|
+
*/
|
|
21
|
+
export type MirrorConfig = {
|
|
22
|
+
/**
|
|
23
|
+
* Source information for mirrored requests.
|
|
24
|
+
*/
|
|
25
|
+
mirrorSource: MirrorSource;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const MirrorConfig$inboundSchema: z.ZodType<MirrorConfig, unknown> = z
|
|
30
|
+
.object({
|
|
31
|
+
mirror_source: MirrorSource$inboundSchema,
|
|
32
|
+
}).transform((v) => {
|
|
33
|
+
return remap$(v, {
|
|
34
|
+
"mirror_source": "mirrorSource",
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
/** @internal */
|
|
38
|
+
export type MirrorConfig$Outbound = {
|
|
39
|
+
mirror_source: MirrorSource$Outbound;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const MirrorConfig$outboundSchema: z.ZodType<
|
|
44
|
+
MirrorConfig$Outbound,
|
|
45
|
+
MirrorConfig
|
|
46
|
+
> = z.object({
|
|
47
|
+
mirrorSource: MirrorSource$outboundSchema,
|
|
48
|
+
}).transform((v) => {
|
|
49
|
+
return remap$(v, {
|
|
50
|
+
mirrorSource: "mirror_source",
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export function mirrorConfigToJSON(mirrorConfig: MirrorConfig): string {
|
|
55
|
+
return JSON.stringify(MirrorConfig$outboundSchema.parse(mirrorConfig));
|
|
56
|
+
}
|
|
57
|
+
export function mirrorConfigFromJSON(
|
|
58
|
+
jsonString: string,
|
|
59
|
+
): SafeParseResult<MirrorConfig, SDKValidationError> {
|
|
60
|
+
return safeParse(
|
|
61
|
+
jsonString,
|
|
62
|
+
(x) => MirrorConfig$inboundSchema.parse(JSON.parse(x)),
|
|
63
|
+
`Failed to parse 'MirrorConfig' from JSON`,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 3bd93f177873
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Source information for mirrored requests.
|
|
14
|
+
*/
|
|
15
|
+
export type MirrorSource = {
|
|
16
|
+
app: string;
|
|
17
|
+
version?: string | null | undefined;
|
|
18
|
+
rootModelName: string;
|
|
19
|
+
mirrorModelName: string;
|
|
20
|
+
experimentId?: string | null | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const MirrorSource$inboundSchema: z.ZodType<MirrorSource, unknown> = z
|
|
25
|
+
.object({
|
|
26
|
+
app: z.string(),
|
|
27
|
+
version: z.nullable(z.string()).optional(),
|
|
28
|
+
root_model_name: z.string(),
|
|
29
|
+
mirror_model_name: z.string(),
|
|
30
|
+
experiment_id: z.nullable(z.string()).optional(),
|
|
31
|
+
}).transform((v) => {
|
|
32
|
+
return remap$(v, {
|
|
33
|
+
"root_model_name": "rootModelName",
|
|
34
|
+
"mirror_model_name": "mirrorModelName",
|
|
35
|
+
"experiment_id": "experimentId",
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
/** @internal */
|
|
39
|
+
export type MirrorSource$Outbound = {
|
|
40
|
+
app: string;
|
|
41
|
+
version?: string | null | undefined;
|
|
42
|
+
root_model_name: string;
|
|
43
|
+
mirror_model_name: string;
|
|
44
|
+
experiment_id?: string | null | undefined;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const MirrorSource$outboundSchema: z.ZodType<
|
|
49
|
+
MirrorSource$Outbound,
|
|
50
|
+
MirrorSource
|
|
51
|
+
> = z.object({
|
|
52
|
+
app: z.string(),
|
|
53
|
+
version: z.nullable(z.string()).optional(),
|
|
54
|
+
rootModelName: z.string(),
|
|
55
|
+
mirrorModelName: z.string(),
|
|
56
|
+
experimentId: z.nullable(z.string()).optional(),
|
|
57
|
+
}).transform((v) => {
|
|
58
|
+
return remap$(v, {
|
|
59
|
+
rootModelName: "root_model_name",
|
|
60
|
+
mirrorModelName: "mirror_model_name",
|
|
61
|
+
experimentId: "experiment_id",
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export function mirrorSourceToJSON(mirrorSource: MirrorSource): string {
|
|
66
|
+
return JSON.stringify(MirrorSource$outboundSchema.parse(mirrorSource));
|
|
67
|
+
}
|
|
68
|
+
export function mirrorSourceFromJSON(
|
|
69
|
+
jsonString: string,
|
|
70
|
+
): SafeParseResult<MirrorSource, SDKValidationError> {
|
|
71
|
+
return safeParse(
|
|
72
|
+
jsonString,
|
|
73
|
+
(x) => MirrorSource$inboundSchema.parse(JSON.parse(x)),
|
|
74
|
+
`Failed to parse 'MirrorSource' from JSON`,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -18,6 +18,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
18
18
|
export type ModelCapabilities = {
|
|
19
19
|
completionChat: boolean;
|
|
20
20
|
functionCalling: boolean;
|
|
21
|
+
reasoning: boolean;
|
|
21
22
|
completionFim: boolean;
|
|
22
23
|
fineTuning: boolean;
|
|
23
24
|
vision: boolean;
|
|
@@ -37,6 +38,7 @@ export const ModelCapabilities$inboundSchema: z.ZodType<
|
|
|
37
38
|
> = z.object({
|
|
38
39
|
completion_chat: z.boolean().default(false),
|
|
39
40
|
function_calling: z.boolean().default(false),
|
|
41
|
+
reasoning: z.boolean().default(false),
|
|
40
42
|
completion_fim: z.boolean().default(false),
|
|
41
43
|
fine_tuning: z.boolean().default(false),
|
|
42
44
|
vision: z.boolean().default(false),
|
|
@@ -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,
|
|
@@ -87,7 +88,7 @@ export type ModelConversation = {
|
|
|
87
88
|
/**
|
|
88
89
|
* Custom metadata for the conversation.
|
|
89
90
|
*/
|
|
90
|
-
metadata?:
|
|
91
|
+
metadata?: MetadataDict | null | undefined;
|
|
91
92
|
object: "conversation";
|
|
92
93
|
id: string;
|
|
93
94
|
createdAt: Date;
|
|
@@ -138,7 +139,7 @@ export const ModelConversation$inboundSchema: z.ZodType<
|
|
|
138
139
|
guardrails: z.nullable(z.array(GuardrailConfig$inboundSchema)).optional(),
|
|
139
140
|
name: z.nullable(z.string()).optional(),
|
|
140
141
|
description: z.nullable(z.string()).optional(),
|
|
141
|
-
metadata: z.nullable(
|
|
142
|
+
metadata: z.nullable(MetadataDict$inboundSchema).optional(),
|
|
142
143
|
object: z.literal("conversation").default("conversation"),
|
|
143
144
|
id: z.string(),
|
|
144
145
|
created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)),
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 5d93876e4d19
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import { MessageTokens, MessageTokens$inboundSchema } from "./messagetokens.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Token usage details for the prompt.
|
|
15
|
+
*/
|
|
16
|
+
export type PromptTokensDetails = {
|
|
17
|
+
messages?: Array<MessageTokens> | undefined;
|
|
18
|
+
cachedTokens: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const PromptTokensDetails$inboundSchema: z.ZodType<
|
|
23
|
+
PromptTokensDetails,
|
|
24
|
+
unknown
|
|
25
|
+
> = z.object({
|
|
26
|
+
messages: z.array(MessageTokens$inboundSchema).optional(),
|
|
27
|
+
cached_tokens: z.int().default(0),
|
|
28
|
+
}).transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
"cached_tokens": "cachedTokens",
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export function promptTokensDetailsFromJSON(
|
|
35
|
+
jsonString: string,
|
|
36
|
+
): SafeParseResult<PromptTokensDetails, SDKValidationError> {
|
|
37
|
+
return safeParse(
|
|
38
|
+
jsonString,
|
|
39
|
+
(x) => PromptTokensDetails$inboundSchema.parse(JSON.parse(x)),
|
|
40
|
+
`Failed to parse 'PromptTokensDetails' from JSON`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -4,14 +4,22 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import * as z from "zod/v4";
|
|
7
|
-
import
|
|
7
|
+
import * as openEnums from "../../types/enums.js";
|
|
8
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
9
|
|
|
9
10
|
export const ReasoningEffort = {
|
|
10
11
|
None: "none",
|
|
11
12
|
High: "high",
|
|
12
13
|
} as const;
|
|
13
|
-
export type ReasoningEffort =
|
|
14
|
+
export type ReasoningEffort = OpenEnum<typeof ReasoningEffort>;
|
|
14
15
|
|
|
15
16
|
/** @internal */
|
|
16
|
-
export const ReasoningEffort$
|
|
17
|
-
|
|
17
|
+
export const ReasoningEffort$inboundSchema: z.ZodType<
|
|
18
|
+
ReasoningEffort,
|
|
19
|
+
unknown
|
|
20
|
+
> = openEnums.inboundSchema(ReasoningEffort);
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const ReasoningEffort$outboundSchema: z.ZodType<
|
|
23
|
+
string,
|
|
24
|
+
ReasoningEffort
|
|
25
|
+
> = openEnums.outboundSchema(ReasoningEffort);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 14506aa40233
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import * as openEnums from "../../types/enums.js";
|
|
8
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
9
|
+
|
|
10
|
+
export const Roles = {
|
|
11
|
+
System: "system",
|
|
12
|
+
User: "user",
|
|
13
|
+
Assistant: "assistant",
|
|
14
|
+
Tool: "tool",
|
|
15
|
+
} as const;
|
|
16
|
+
export type Roles = OpenEnum<typeof Roles>;
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const Roles$inboundSchema: z.ZodType<Roles, unknown> = openEnums
|
|
20
|
+
.inboundSchema(Roles);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 563b60b8536d
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const SpeechOutputFormat = {
|
|
10
|
+
Pcm: "pcm",
|
|
11
|
+
Wav: "wav",
|
|
12
|
+
Mp3: "mp3",
|
|
13
|
+
Flac: "flac",
|
|
14
|
+
Opus: "opus",
|
|
15
|
+
} as const;
|
|
16
|
+
export type SpeechOutputFormat = ClosedEnum<typeof SpeechOutputFormat>;
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const SpeechOutputFormat$outboundSchema: z.ZodEnum<
|
|
20
|
+
typeof SpeechOutputFormat
|
|
21
|
+
> = z.enum(SpeechOutputFormat);
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 5d434727e189
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import {
|
|
9
|
+
MetadataDict,
|
|
10
|
+
MetadataDict$Outbound,
|
|
11
|
+
MetadataDict$outboundSchema,
|
|
12
|
+
} from "./metadatadict.js";
|
|
13
|
+
import {
|
|
14
|
+
SpeechOutputFormat,
|
|
15
|
+
SpeechOutputFormat$outboundSchema,
|
|
16
|
+
} from "./speechoutputformat.js";
|
|
17
|
+
|
|
18
|
+
export type SpeechRequest = {
|
|
19
|
+
model?: string | null | undefined;
|
|
20
|
+
metadata?: MetadataDict | null | undefined;
|
|
21
|
+
stream?: boolean | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The preset or custom voice to use for generating the speech.
|
|
24
|
+
*/
|
|
25
|
+
voiceId?: string | null | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The audio reference for generating the speech.
|
|
28
|
+
*/
|
|
29
|
+
refAudio?: string | null | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Text to generate a speech from
|
|
32
|
+
*/
|
|
33
|
+
input: string;
|
|
34
|
+
responseFormat?: SpeechOutputFormat | undefined;
|
|
35
|
+
[additionalProperties: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export type SpeechRequest$Outbound = {
|
|
40
|
+
model?: string | null | undefined;
|
|
41
|
+
metadata?: MetadataDict$Outbound | null | undefined;
|
|
42
|
+
stream: boolean;
|
|
43
|
+
voice_id?: string | null | undefined;
|
|
44
|
+
ref_audio?: string | null | undefined;
|
|
45
|
+
input: string;
|
|
46
|
+
response_format?: string | undefined;
|
|
47
|
+
[additionalProperties: string]: unknown;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export const SpeechRequest$outboundSchema: z.ZodType<
|
|
52
|
+
SpeechRequest$Outbound,
|
|
53
|
+
SpeechRequest
|
|
54
|
+
> = z.object({
|
|
55
|
+
model: z.nullable(z.string()).optional(),
|
|
56
|
+
metadata: z.nullable(MetadataDict$outboundSchema).optional(),
|
|
57
|
+
stream: z.boolean().default(false),
|
|
58
|
+
voiceId: z.nullable(z.string()).optional(),
|
|
59
|
+
refAudio: z.nullable(z.string()).optional(),
|
|
60
|
+
input: z.string(),
|
|
61
|
+
responseFormat: SpeechOutputFormat$outboundSchema.optional(),
|
|
62
|
+
}).catchall(z.any()).transform((v) => {
|
|
63
|
+
return {
|
|
64
|
+
...remap$(v, {
|
|
65
|
+
voiceId: "voice_id",
|
|
66
|
+
refAudio: "ref_audio",
|
|
67
|
+
responseFormat: "response_format",
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export function speechRequestToJSON(speechRequest: SpeechRequest): string {
|
|
73
|
+
return JSON.stringify(SpeechRequest$outboundSchema.parse(speechRequest));
|
|
74
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 998442277807
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type SpeechStreamAudioDelta = {
|
|
13
|
+
type: "speech.audio.delta";
|
|
14
|
+
audioData: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const SpeechStreamAudioDelta$inboundSchema: z.ZodType<
|
|
19
|
+
SpeechStreamAudioDelta,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.object({
|
|
22
|
+
type: z.literal("speech.audio.delta"),
|
|
23
|
+
audio_data: z.string(),
|
|
24
|
+
}).transform((v) => {
|
|
25
|
+
return remap$(v, {
|
|
26
|
+
"audio_data": "audioData",
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export function speechStreamAudioDeltaFromJSON(
|
|
31
|
+
jsonString: string,
|
|
32
|
+
): SafeParseResult<SpeechStreamAudioDelta, SDKValidationError> {
|
|
33
|
+
return safeParse(
|
|
34
|
+
jsonString,
|
|
35
|
+
(x) => SpeechStreamAudioDelta$inboundSchema.parse(JSON.parse(x)),
|
|
36
|
+
`Failed to parse 'SpeechStreamAudioDelta' from JSON`,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: d3610c601337
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
UsageInfoDollarDefs,
|
|
12
|
+
UsageInfoDollarDefs$inboundSchema,
|
|
13
|
+
} from "./usageinfodollardefs.js";
|
|
14
|
+
|
|
15
|
+
export type SpeechStreamDone = {
|
|
16
|
+
type: "speech.audio.done";
|
|
17
|
+
usage: UsageInfoDollarDefs;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const SpeechStreamDone$inboundSchema: z.ZodType<
|
|
22
|
+
SpeechStreamDone,
|
|
23
|
+
unknown
|
|
24
|
+
> = z.object({
|
|
25
|
+
type: z.literal("speech.audio.done"),
|
|
26
|
+
usage: UsageInfoDollarDefs$inboundSchema,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export function speechStreamDoneFromJSON(
|
|
30
|
+
jsonString: string,
|
|
31
|
+
): SafeParseResult<SpeechStreamDone, SDKValidationError> {
|
|
32
|
+
return safeParse(
|
|
33
|
+
jsonString,
|
|
34
|
+
(x) => SpeechStreamDone$inboundSchema.parse(JSON.parse(x)),
|
|
35
|
+
`Failed to parse 'SpeechStreamDone' from JSON`,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: fee6fc51269e
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import * as openEnums from "../../types/enums.js";
|
|
8
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
9
|
+
|
|
10
|
+
export const SpeechStreamEventTypes = {
|
|
11
|
+
SpeechAudioDelta: "speech.audio.delta",
|
|
12
|
+
SpeechAudioDone: "speech.audio.done",
|
|
13
|
+
} as const;
|
|
14
|
+
export type SpeechStreamEventTypes = OpenEnum<typeof SpeechStreamEventTypes>;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const SpeechStreamEventTypes$inboundSchema: z.ZodType<
|
|
18
|
+
SpeechStreamEventTypes,
|
|
19
|
+
unknown
|
|
20
|
+
> = openEnums.inboundSchema(SpeechStreamEventTypes);
|
|
@@ -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,
|
|
@@ -89,7 +94,7 @@ export type UpdateAgentRequest = {
|
|
|
89
94
|
description?: string | null | undefined;
|
|
90
95
|
handoffs?: Array<string> | null | undefined;
|
|
91
96
|
deploymentChat?: boolean | null | undefined;
|
|
92
|
-
metadata?:
|
|
97
|
+
metadata?: MetadataDict | null | undefined;
|
|
93
98
|
versionMessage?: string | null | undefined;
|
|
94
99
|
};
|
|
95
100
|
|
|
@@ -146,7 +151,7 @@ export type UpdateAgentRequest$Outbound = {
|
|
|
146
151
|
description?: string | null | undefined;
|
|
147
152
|
handoffs?: Array<string> | null | undefined;
|
|
148
153
|
deployment_chat?: boolean | null | undefined;
|
|
149
|
-
metadata?:
|
|
154
|
+
metadata?: MetadataDict$Outbound | null | undefined;
|
|
150
155
|
version_message?: string | null | undefined;
|
|
151
156
|
};
|
|
152
157
|
|
|
@@ -174,7 +179,7 @@ export const UpdateAgentRequest$outboundSchema: z.ZodType<
|
|
|
174
179
|
description: z.nullable(z.string()).optional(),
|
|
175
180
|
handoffs: z.nullable(z.array(z.string())).optional(),
|
|
176
181
|
deploymentChat: z.nullable(z.boolean()).optional(),
|
|
177
|
-
metadata: z.nullable(
|
|
182
|
+
metadata: z.nullable(MetadataDict$outboundSchema).optional(),
|
|
178
183
|
versionMessage: z.nullable(z.string()).optional(),
|
|
179
184
|
}).transform((v) => {
|
|
180
185
|
return remap$(v, {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 1edf56765dba
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
PromptTokensDetails,
|
|
13
|
+
PromptTokensDetails$inboundSchema,
|
|
14
|
+
} from "./prompttokensdetails.js";
|
|
15
|
+
|
|
16
|
+
export type UsageInfoDollarDefs = {
|
|
17
|
+
promptAudioSeconds?: number | null | undefined;
|
|
18
|
+
promptTokens: number;
|
|
19
|
+
totalTokens: number;
|
|
20
|
+
completionTokens?: number | null | undefined;
|
|
21
|
+
requestCount?: number | null | undefined;
|
|
22
|
+
promptTokensDetails?: PromptTokensDetails | null | undefined;
|
|
23
|
+
promptTokenDetails?: PromptTokensDetails | null | undefined;
|
|
24
|
+
numCachedTokens?: number | null | undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const UsageInfoDollarDefs$inboundSchema: z.ZodType<
|
|
29
|
+
UsageInfoDollarDefs,
|
|
30
|
+
unknown
|
|
31
|
+
> = z.object({
|
|
32
|
+
prompt_audio_seconds: z.nullable(z.int()).optional(),
|
|
33
|
+
prompt_tokens: z.int().default(0),
|
|
34
|
+
total_tokens: z.int().default(0),
|
|
35
|
+
completion_tokens: z.nullable(z.int()).optional(),
|
|
36
|
+
request_count: z.nullable(z.int()).optional(),
|
|
37
|
+
prompt_tokens_details: z.nullable(PromptTokensDetails$inboundSchema)
|
|
38
|
+
.optional(),
|
|
39
|
+
prompt_token_details: z.nullable(PromptTokensDetails$inboundSchema)
|
|
40
|
+
.optional(),
|
|
41
|
+
num_cached_tokens: z.nullable(z.int()).optional(),
|
|
42
|
+
}).transform((v) => {
|
|
43
|
+
return remap$(v, {
|
|
44
|
+
"prompt_audio_seconds": "promptAudioSeconds",
|
|
45
|
+
"prompt_tokens": "promptTokens",
|
|
46
|
+
"total_tokens": "totalTokens",
|
|
47
|
+
"completion_tokens": "completionTokens",
|
|
48
|
+
"request_count": "requestCount",
|
|
49
|
+
"prompt_tokens_details": "promptTokensDetails",
|
|
50
|
+
"prompt_token_details": "promptTokenDetails",
|
|
51
|
+
"num_cached_tokens": "numCachedTokens",
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export function usageInfoDollarDefsFromJSON(
|
|
56
|
+
jsonString: string,
|
|
57
|
+
): SafeParseResult<UsageInfoDollarDefs, SDKValidationError> {
|
|
58
|
+
return safeParse(
|
|
59
|
+
jsonString,
|
|
60
|
+
(x) => UsageInfoDollarDefs$inboundSchema.parse(JSON.parse(x)),
|
|
61
|
+
`Failed to parse 'UsageInfoDollarDefs' from JSON`,
|
|
62
|
+
);
|
|
63
|
+
}
|