@mistralai/mistralai 1.7.4 → 1.7.5
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 +10 -0
- package/docs/sdks/audio/README.md +6 -0
- package/docs/sdks/transcriptions/README.md +167 -0
- package/examples/src/async_audio_transcription_stream.ts +17 -0
- package/funcs/audioTranscriptionsComplete.d.ts +13 -0
- package/funcs/audioTranscriptionsComplete.d.ts.map +1 -0
- package/funcs/audioTranscriptionsComplete.js +133 -0
- package/funcs/audioTranscriptionsComplete.js.map +1 -0
- package/funcs/audioTranscriptionsStream.d.ts +14 -0
- package/funcs/audioTranscriptionsStream.d.ts.map +1 -0
- package/funcs/audioTranscriptionsStream.js +143 -0
- package/funcs/audioTranscriptionsStream.js.map +1 -0
- package/funcs/batchJobsList.js +1 -0
- package/funcs/batchJobsList.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/audiochunk.d.ts +54 -0
- package/models/components/audiochunk.d.ts.map +1 -0
- package/models/components/audiochunk.js +88 -0
- package/models/components/audiochunk.js.map +1 -0
- package/models/components/audiotranscriptionrequest.d.ts +57 -0
- package/models/components/audiotranscriptionrequest.d.ts.map +1 -0
- package/models/components/audiotranscriptionrequest.js +91 -0
- package/models/components/audiotranscriptionrequest.js.map +1 -0
- package/models/components/audiotranscriptionrequeststream.d.ts +57 -0
- package/models/components/audiotranscriptionrequeststream.d.ts.map +1 -0
- package/models/components/audiotranscriptionrequeststream.js +91 -0
- package/models/components/audiotranscriptionrequeststream.js.map +1 -0
- package/models/components/basemodelcard.d.ts +7 -7
- package/models/components/basemodelcard.d.ts.map +1 -1
- package/models/components/basemodelcard.js +11 -11
- package/models/components/basemodelcard.js.map +1 -1
- package/models/components/batchjobin.d.ts +4 -2
- package/models/components/batchjobin.d.ts.map +1 -1
- package/models/components/batchjobin.js +6 -2
- package/models/components/batchjobin.js.map +1 -1
- package/models/components/batchjobout.d.ts +4 -2
- package/models/components/batchjobout.d.ts.map +1 -1
- package/models/components/batchjobout.js +6 -2
- package/models/components/batchjobout.js.map +1 -1
- package/models/components/classifierftmodelout.d.ts +4 -0
- package/models/components/classifierftmodelout.d.ts.map +1 -1
- package/models/components/classifierftmodelout.js +8 -0
- package/models/components/classifierftmodelout.js.map +1 -1
- package/models/components/completionargs.d.ts +2 -2
- package/models/components/completionargs.d.ts.map +1 -1
- package/models/components/completionargs.js +2 -2
- package/models/components/completionargs.js.map +1 -1
- package/models/components/completionftmodelout.d.ts +4 -0
- package/models/components/completionftmodelout.d.ts.map +1 -1
- package/models/components/completionftmodelout.js +8 -0
- package/models/components/completionftmodelout.js.map +1 -1
- package/models/components/contentchunk.d.ts +10 -0
- package/models/components/contentchunk.d.ts.map +1 -1
- package/models/components/contentchunk.js +14 -0
- package/models/components/contentchunk.js.map +1 -1
- package/models/components/fileschema.d.ts +4 -0
- package/models/components/fileschema.d.ts.map +1 -1
- package/models/components/fileschema.js +4 -0
- package/models/components/fileschema.js.map +1 -1
- package/models/components/index.d.ts +13 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +13 -0
- package/models/components/index.js.map +1 -1
- package/models/components/retrievefileout.d.ts +4 -0
- package/models/components/retrievefileout.d.ts.map +1 -1
- package/models/components/retrievefileout.js +4 -0
- package/models/components/retrievefileout.js.map +1 -1
- package/models/components/thinkchunk.d.ts +82 -0
- package/models/components/thinkchunk.d.ts.map +1 -0
- package/models/components/thinkchunk.js +106 -0
- package/models/components/thinkchunk.js.map +1 -0
- package/models/components/timestampgranularity.d.ts +25 -0
- package/models/components/timestampgranularity.d.ts.map +1 -0
- package/models/components/timestampgranularity.js +49 -0
- package/models/components/timestampgranularity.js.map +1 -0
- package/models/components/toolcall.d.ts +23 -0
- package/models/components/toolcall.d.ts.map +1 -1
- package/models/components/toolcall.js +26 -1
- package/models/components/toolcall.js.map +1 -1
- package/models/components/transcriptionresponse.d.ts +43 -0
- package/models/components/transcriptionresponse.d.ts.map +1 -0
- package/models/components/transcriptionresponse.js +78 -0
- package/models/components/transcriptionresponse.js.map +1 -0
- package/models/components/transcriptionsegmentchunk.d.ts +62 -0
- package/models/components/transcriptionsegmentchunk.d.ts.map +1 -0
- package/models/components/transcriptionsegmentchunk.js +92 -0
- package/models/components/transcriptionsegmentchunk.js.map +1 -0
- package/models/components/transcriptionstreamdone.d.ts +68 -0
- package/models/components/transcriptionstreamdone.d.ts.map +1 -0
- package/models/components/transcriptionstreamdone.js +98 -0
- package/models/components/transcriptionstreamdone.js.map +1 -0
- package/models/components/transcriptionstreamevents.d.ts +89 -0
- package/models/components/transcriptionstreamevents.d.ts.map +1 -0
- package/models/components/transcriptionstreamevents.js +138 -0
- package/models/components/transcriptionstreamevents.js.map +1 -0
- package/models/components/transcriptionstreameventtypes.d.ts +34 -0
- package/models/components/transcriptionstreameventtypes.d.ts.map +1 -0
- package/models/components/transcriptionstreameventtypes.js +52 -0
- package/models/components/transcriptionstreameventtypes.js.map +1 -0
- package/models/components/transcriptionstreamlanguage.d.ts +58 -0
- package/models/components/transcriptionstreamlanguage.d.ts.map +1 -0
- package/models/components/transcriptionstreamlanguage.js +93 -0
- package/models/components/transcriptionstreamlanguage.js.map +1 -0
- package/models/components/transcriptionstreamsegmentdelta.d.ts +62 -0
- package/models/components/transcriptionstreamsegmentdelta.d.ts.map +1 -0
- package/models/components/transcriptionstreamsegmentdelta.js +92 -0
- package/models/components/transcriptionstreamsegmentdelta.js.map +1 -0
- package/models/components/transcriptionstreamtextdelta.d.ts +58 -0
- package/models/components/transcriptionstreamtextdelta.d.ts.map +1 -0
- package/models/components/transcriptionstreamtextdelta.js +88 -0
- package/models/components/transcriptionstreamtextdelta.js.map +1 -0
- package/models/components/uploadfileout.d.ts +4 -0
- package/models/components/uploadfileout.d.ts.map +1 -1
- package/models/components/uploadfileout.js +4 -0
- package/models/components/uploadfileout.js.map +1 -1
- package/models/components/usageinfo.d.ts +9 -3
- package/models/components/usageinfo.d.ts.map +1 -1
- package/models/components/usageinfo.js +22 -13
- package/models/components/usageinfo.js.map +1 -1
- package/models/operations/jobsapiroutesbatchgetbatchjobs.d.ts +2 -0
- package/models/operations/jobsapiroutesbatchgetbatchjobs.d.ts.map +1 -1
- package/models/operations/jobsapiroutesbatchgetbatchjobs.js +4 -0
- package/models/operations/jobsapiroutesbatchgetbatchjobs.js.map +1 -1
- package/package.json +1 -1
- package/sdk/audio.d.ts +7 -0
- package/sdk/audio.d.ts.map +1 -0
- package/sdk/audio.js +15 -0
- package/sdk/audio.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/transcriptions.d.ts +14 -0
- package/sdk/transcriptions.d.ts.map +1 -0
- package/sdk/transcriptions.js +26 -0
- package/sdk/transcriptions.js.map +1 -0
- package/src/funcs/audioTranscriptionsComplete.ts +193 -0
- package/src/funcs/audioTranscriptionsStream.ts +207 -0
- package/src/funcs/batchJobsList.ts +1 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/audiochunk.ts +102 -0
- package/src/models/components/audiotranscriptionrequest.ts +133 -0
- package/src/models/components/audiotranscriptionrequeststream.ts +135 -0
- package/src/models/components/basemodelcard.ts +13 -12
- package/src/models/components/batchjobin.ts +10 -4
- package/src/models/components/batchjobout.ts +10 -4
- package/src/models/components/classifierftmodelout.ts +12 -0
- package/src/models/components/completionargs.ts +4 -4
- package/src/models/components/completionftmodelout.ts +12 -0
- package/src/models/components/contentchunk.ts +38 -2
- package/src/models/components/fileschema.ts +8 -0
- package/src/models/components/index.ts +13 -0
- package/src/models/components/retrievefileout.ts +8 -0
- package/src/models/components/thinkchunk.ts +162 -0
- package/src/models/components/timestampgranularity.ts +32 -0
- package/src/models/components/toolcall.ts +50 -0
- package/src/models/components/transcriptionresponse.ts +112 -0
- package/src/models/components/transcriptionsegmentchunk.ts +122 -0
- package/src/models/components/transcriptionstreamdone.ts +149 -0
- package/src/models/components/transcriptionstreamevents.ts +273 -0
- package/src/models/components/transcriptionstreameventtypes.ts +37 -0
- package/src/models/components/transcriptionstreamlanguage.ts +128 -0
- package/src/models/components/transcriptionstreamsegmentdelta.ts +133 -0
- package/src/models/components/transcriptionstreamtextdelta.ts +123 -0
- package/src/models/components/uploadfileout.ts +8 -0
- package/src/models/components/usageinfo.ts +37 -17
- package/src/models/operations/jobsapiroutesbatchgetbatchjobs.ts +6 -0
- package/src/sdk/audio.ts +13 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/transcriptions.ts +40 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
ReferenceChunk,
|
|
12
|
+
ReferenceChunk$inboundSchema,
|
|
13
|
+
ReferenceChunk$Outbound,
|
|
14
|
+
ReferenceChunk$outboundSchema,
|
|
15
|
+
} from "./referencechunk.js";
|
|
16
|
+
import {
|
|
17
|
+
TextChunk,
|
|
18
|
+
TextChunk$inboundSchema,
|
|
19
|
+
TextChunk$Outbound,
|
|
20
|
+
TextChunk$outboundSchema,
|
|
21
|
+
} from "./textchunk.js";
|
|
22
|
+
|
|
23
|
+
export type Thinking = ReferenceChunk | TextChunk;
|
|
24
|
+
|
|
25
|
+
export const ThinkChunkType = {
|
|
26
|
+
Thinking: "thinking",
|
|
27
|
+
} as const;
|
|
28
|
+
export type ThinkChunkType = ClosedEnum<typeof ThinkChunkType>;
|
|
29
|
+
|
|
30
|
+
export type ThinkChunk = {
|
|
31
|
+
thinking: Array<ReferenceChunk | TextChunk>;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the thinking chunk is closed or not. Currently only used for prefixing.
|
|
34
|
+
*/
|
|
35
|
+
closed?: boolean | undefined;
|
|
36
|
+
type?: ThinkChunkType | undefined;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const Thinking$inboundSchema: z.ZodType<
|
|
41
|
+
Thinking,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
unknown
|
|
44
|
+
> = z.union([ReferenceChunk$inboundSchema, TextChunk$inboundSchema]);
|
|
45
|
+
|
|
46
|
+
/** @internal */
|
|
47
|
+
export type Thinking$Outbound = ReferenceChunk$Outbound | TextChunk$Outbound;
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const Thinking$outboundSchema: z.ZodType<
|
|
51
|
+
Thinking$Outbound,
|
|
52
|
+
z.ZodTypeDef,
|
|
53
|
+
Thinking
|
|
54
|
+
> = z.union([ReferenceChunk$outboundSchema, TextChunk$outboundSchema]);
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
59
|
+
*/
|
|
60
|
+
export namespace Thinking$ {
|
|
61
|
+
/** @deprecated use `Thinking$inboundSchema` instead. */
|
|
62
|
+
export const inboundSchema = Thinking$inboundSchema;
|
|
63
|
+
/** @deprecated use `Thinking$outboundSchema` instead. */
|
|
64
|
+
export const outboundSchema = Thinking$outboundSchema;
|
|
65
|
+
/** @deprecated use `Thinking$Outbound` instead. */
|
|
66
|
+
export type Outbound = Thinking$Outbound;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function thinkingToJSON(thinking: Thinking): string {
|
|
70
|
+
return JSON.stringify(Thinking$outboundSchema.parse(thinking));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function thinkingFromJSON(
|
|
74
|
+
jsonString: string,
|
|
75
|
+
): SafeParseResult<Thinking, SDKValidationError> {
|
|
76
|
+
return safeParse(
|
|
77
|
+
jsonString,
|
|
78
|
+
(x) => Thinking$inboundSchema.parse(JSON.parse(x)),
|
|
79
|
+
`Failed to parse 'Thinking' from JSON`,
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const ThinkChunkType$inboundSchema: z.ZodNativeEnum<
|
|
85
|
+
typeof ThinkChunkType
|
|
86
|
+
> = z.nativeEnum(ThinkChunkType);
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export const ThinkChunkType$outboundSchema: z.ZodNativeEnum<
|
|
90
|
+
typeof ThinkChunkType
|
|
91
|
+
> = ThinkChunkType$inboundSchema;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
96
|
+
*/
|
|
97
|
+
export namespace ThinkChunkType$ {
|
|
98
|
+
/** @deprecated use `ThinkChunkType$inboundSchema` instead. */
|
|
99
|
+
export const inboundSchema = ThinkChunkType$inboundSchema;
|
|
100
|
+
/** @deprecated use `ThinkChunkType$outboundSchema` instead. */
|
|
101
|
+
export const outboundSchema = ThinkChunkType$outboundSchema;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** @internal */
|
|
105
|
+
export const ThinkChunk$inboundSchema: z.ZodType<
|
|
106
|
+
ThinkChunk,
|
|
107
|
+
z.ZodTypeDef,
|
|
108
|
+
unknown
|
|
109
|
+
> = z.object({
|
|
110
|
+
thinking: z.array(
|
|
111
|
+
z.union([ReferenceChunk$inboundSchema, TextChunk$inboundSchema]),
|
|
112
|
+
),
|
|
113
|
+
closed: z.boolean().optional(),
|
|
114
|
+
type: ThinkChunkType$inboundSchema.default("thinking"),
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
/** @internal */
|
|
118
|
+
export type ThinkChunk$Outbound = {
|
|
119
|
+
thinking: Array<ReferenceChunk$Outbound | TextChunk$Outbound>;
|
|
120
|
+
closed?: boolean | undefined;
|
|
121
|
+
type: string;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/** @internal */
|
|
125
|
+
export const ThinkChunk$outboundSchema: z.ZodType<
|
|
126
|
+
ThinkChunk$Outbound,
|
|
127
|
+
z.ZodTypeDef,
|
|
128
|
+
ThinkChunk
|
|
129
|
+
> = z.object({
|
|
130
|
+
thinking: z.array(
|
|
131
|
+
z.union([ReferenceChunk$outboundSchema, TextChunk$outboundSchema]),
|
|
132
|
+
),
|
|
133
|
+
closed: z.boolean().optional(),
|
|
134
|
+
type: ThinkChunkType$outboundSchema.default("thinking"),
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @internal
|
|
139
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
140
|
+
*/
|
|
141
|
+
export namespace ThinkChunk$ {
|
|
142
|
+
/** @deprecated use `ThinkChunk$inboundSchema` instead. */
|
|
143
|
+
export const inboundSchema = ThinkChunk$inboundSchema;
|
|
144
|
+
/** @deprecated use `ThinkChunk$outboundSchema` instead. */
|
|
145
|
+
export const outboundSchema = ThinkChunk$outboundSchema;
|
|
146
|
+
/** @deprecated use `ThinkChunk$Outbound` instead. */
|
|
147
|
+
export type Outbound = ThinkChunk$Outbound;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function thinkChunkToJSON(thinkChunk: ThinkChunk): string {
|
|
151
|
+
return JSON.stringify(ThinkChunk$outboundSchema.parse(thinkChunk));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function thinkChunkFromJSON(
|
|
155
|
+
jsonString: string,
|
|
156
|
+
): SafeParseResult<ThinkChunk, SDKValidationError> {
|
|
157
|
+
return safeParse(
|
|
158
|
+
jsonString,
|
|
159
|
+
(x) => ThinkChunk$inboundSchema.parse(JSON.parse(x)),
|
|
160
|
+
`Failed to parse 'ThinkChunk' from JSON`,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const TimestampGranularity = {
|
|
9
|
+
Segment: "segment",
|
|
10
|
+
} as const;
|
|
11
|
+
export type TimestampGranularity = ClosedEnum<typeof TimestampGranularity>;
|
|
12
|
+
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const TimestampGranularity$inboundSchema: z.ZodNativeEnum<
|
|
15
|
+
typeof TimestampGranularity
|
|
16
|
+
> = z.nativeEnum(TimestampGranularity);
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const TimestampGranularity$outboundSchema: z.ZodNativeEnum<
|
|
20
|
+
typeof TimestampGranularity
|
|
21
|
+
> = TimestampGranularity$inboundSchema;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
26
|
+
*/
|
|
27
|
+
export namespace TimestampGranularity$ {
|
|
28
|
+
/** @deprecated use `TimestampGranularity$inboundSchema` instead. */
|
|
29
|
+
export const inboundSchema = TimestampGranularity$inboundSchema;
|
|
30
|
+
/** @deprecated use `TimestampGranularity$outboundSchema` instead. */
|
|
31
|
+
export const outboundSchema = TimestampGranularity$outboundSchema;
|
|
32
|
+
}
|
|
@@ -18,13 +18,60 @@ import {
|
|
|
18
18
|
ToolTypes$outboundSchema,
|
|
19
19
|
} from "./tooltypes.js";
|
|
20
20
|
|
|
21
|
+
export type Metadata = {};
|
|
22
|
+
|
|
21
23
|
export type ToolCall = {
|
|
22
24
|
id?: string | undefined;
|
|
23
25
|
type?: ToolTypes | undefined;
|
|
24
26
|
function: FunctionCall;
|
|
25
27
|
index?: number | undefined;
|
|
28
|
+
metadata?: Metadata | null | undefined;
|
|
26
29
|
};
|
|
27
30
|
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const Metadata$inboundSchema: z.ZodType<
|
|
33
|
+
Metadata,
|
|
34
|
+
z.ZodTypeDef,
|
|
35
|
+
unknown
|
|
36
|
+
> = z.object({});
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export type Metadata$Outbound = {};
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const Metadata$outboundSchema: z.ZodType<
|
|
43
|
+
Metadata$Outbound,
|
|
44
|
+
z.ZodTypeDef,
|
|
45
|
+
Metadata
|
|
46
|
+
> = z.object({});
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
51
|
+
*/
|
|
52
|
+
export namespace Metadata$ {
|
|
53
|
+
/** @deprecated use `Metadata$inboundSchema` instead. */
|
|
54
|
+
export const inboundSchema = Metadata$inboundSchema;
|
|
55
|
+
/** @deprecated use `Metadata$outboundSchema` instead. */
|
|
56
|
+
export const outboundSchema = Metadata$outboundSchema;
|
|
57
|
+
/** @deprecated use `Metadata$Outbound` instead. */
|
|
58
|
+
export type Outbound = Metadata$Outbound;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function metadataToJSON(metadata: Metadata): string {
|
|
62
|
+
return JSON.stringify(Metadata$outboundSchema.parse(metadata));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function metadataFromJSON(
|
|
66
|
+
jsonString: string,
|
|
67
|
+
): SafeParseResult<Metadata, SDKValidationError> {
|
|
68
|
+
return safeParse(
|
|
69
|
+
jsonString,
|
|
70
|
+
(x) => Metadata$inboundSchema.parse(JSON.parse(x)),
|
|
71
|
+
`Failed to parse 'Metadata' from JSON`,
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
28
75
|
/** @internal */
|
|
29
76
|
export const ToolCall$inboundSchema: z.ZodType<
|
|
30
77
|
ToolCall,
|
|
@@ -35,6 +82,7 @@ export const ToolCall$inboundSchema: z.ZodType<
|
|
|
35
82
|
type: ToolTypes$inboundSchema.optional(),
|
|
36
83
|
function: FunctionCall$inboundSchema,
|
|
37
84
|
index: z.number().int().default(0),
|
|
85
|
+
metadata: z.nullable(z.lazy(() => Metadata$inboundSchema)).optional(),
|
|
38
86
|
});
|
|
39
87
|
|
|
40
88
|
/** @internal */
|
|
@@ -43,6 +91,7 @@ export type ToolCall$Outbound = {
|
|
|
43
91
|
type?: string | undefined;
|
|
44
92
|
function: FunctionCall$Outbound;
|
|
45
93
|
index: number;
|
|
94
|
+
metadata?: Metadata$Outbound | null | undefined;
|
|
46
95
|
};
|
|
47
96
|
|
|
48
97
|
/** @internal */
|
|
@@ -55,6 +104,7 @@ export const ToolCall$outboundSchema: z.ZodType<
|
|
|
55
104
|
type: ToolTypes$outboundSchema.optional(),
|
|
56
105
|
function: FunctionCall$outboundSchema,
|
|
57
106
|
index: z.number().int().default(0),
|
|
107
|
+
metadata: z.nullable(z.lazy(() => Metadata$outboundSchema)).optional(),
|
|
58
108
|
});
|
|
59
109
|
|
|
60
110
|
/**
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
collectExtraKeys as collectExtraKeys$,
|
|
9
|
+
safeParse,
|
|
10
|
+
} from "../../lib/schemas.js";
|
|
11
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
12
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
13
|
+
import {
|
|
14
|
+
TranscriptionSegmentChunk,
|
|
15
|
+
TranscriptionSegmentChunk$inboundSchema,
|
|
16
|
+
TranscriptionSegmentChunk$Outbound,
|
|
17
|
+
TranscriptionSegmentChunk$outboundSchema,
|
|
18
|
+
} from "./transcriptionsegmentchunk.js";
|
|
19
|
+
import {
|
|
20
|
+
UsageInfo,
|
|
21
|
+
UsageInfo$inboundSchema,
|
|
22
|
+
UsageInfo$Outbound,
|
|
23
|
+
UsageInfo$outboundSchema,
|
|
24
|
+
} from "./usageinfo.js";
|
|
25
|
+
|
|
26
|
+
export type TranscriptionResponse = {
|
|
27
|
+
model: string;
|
|
28
|
+
text: string;
|
|
29
|
+
segments?: Array<TranscriptionSegmentChunk> | undefined;
|
|
30
|
+
usage: UsageInfo;
|
|
31
|
+
language: string | null;
|
|
32
|
+
additionalProperties?: { [k: string]: any };
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const TranscriptionResponse$inboundSchema: z.ZodType<
|
|
37
|
+
TranscriptionResponse,
|
|
38
|
+
z.ZodTypeDef,
|
|
39
|
+
unknown
|
|
40
|
+
> = collectExtraKeys$(
|
|
41
|
+
z.object({
|
|
42
|
+
model: z.string(),
|
|
43
|
+
text: z.string(),
|
|
44
|
+
segments: z.array(TranscriptionSegmentChunk$inboundSchema).optional(),
|
|
45
|
+
usage: UsageInfo$inboundSchema,
|
|
46
|
+
language: z.nullable(z.string()),
|
|
47
|
+
}).catchall(z.any()),
|
|
48
|
+
"additionalProperties",
|
|
49
|
+
true,
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export type TranscriptionResponse$Outbound = {
|
|
54
|
+
model: string;
|
|
55
|
+
text: string;
|
|
56
|
+
segments?: Array<TranscriptionSegmentChunk$Outbound> | undefined;
|
|
57
|
+
usage: UsageInfo$Outbound;
|
|
58
|
+
language: string | null;
|
|
59
|
+
[additionalProperties: string]: unknown;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** @internal */
|
|
63
|
+
export const TranscriptionResponse$outboundSchema: z.ZodType<
|
|
64
|
+
TranscriptionResponse$Outbound,
|
|
65
|
+
z.ZodTypeDef,
|
|
66
|
+
TranscriptionResponse
|
|
67
|
+
> = z.object({
|
|
68
|
+
model: z.string(),
|
|
69
|
+
text: z.string(),
|
|
70
|
+
segments: z.array(TranscriptionSegmentChunk$outboundSchema).optional(),
|
|
71
|
+
usage: UsageInfo$outboundSchema,
|
|
72
|
+
language: z.nullable(z.string()),
|
|
73
|
+
additionalProperties: z.record(z.any()),
|
|
74
|
+
}).transform((v) => {
|
|
75
|
+
return {
|
|
76
|
+
...v.additionalProperties,
|
|
77
|
+
...remap$(v, {
|
|
78
|
+
additionalProperties: null,
|
|
79
|
+
}),
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
86
|
+
*/
|
|
87
|
+
export namespace TranscriptionResponse$ {
|
|
88
|
+
/** @deprecated use `TranscriptionResponse$inboundSchema` instead. */
|
|
89
|
+
export const inboundSchema = TranscriptionResponse$inboundSchema;
|
|
90
|
+
/** @deprecated use `TranscriptionResponse$outboundSchema` instead. */
|
|
91
|
+
export const outboundSchema = TranscriptionResponse$outboundSchema;
|
|
92
|
+
/** @deprecated use `TranscriptionResponse$Outbound` instead. */
|
|
93
|
+
export type Outbound = TranscriptionResponse$Outbound;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function transcriptionResponseToJSON(
|
|
97
|
+
transcriptionResponse: TranscriptionResponse,
|
|
98
|
+
): string {
|
|
99
|
+
return JSON.stringify(
|
|
100
|
+
TranscriptionResponse$outboundSchema.parse(transcriptionResponse),
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function transcriptionResponseFromJSON(
|
|
105
|
+
jsonString: string,
|
|
106
|
+
): SafeParseResult<TranscriptionResponse, SDKValidationError> {
|
|
107
|
+
return safeParse(
|
|
108
|
+
jsonString,
|
|
109
|
+
(x) => TranscriptionResponse$inboundSchema.parse(JSON.parse(x)),
|
|
110
|
+
`Failed to parse 'TranscriptionResponse' from JSON`,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
collectExtraKeys as collectExtraKeys$,
|
|
9
|
+
safeParse,
|
|
10
|
+
} from "../../lib/schemas.js";
|
|
11
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
12
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
13
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
14
|
+
|
|
15
|
+
export const Type = {
|
|
16
|
+
TranscriptionSegment: "transcription_segment",
|
|
17
|
+
} as const;
|
|
18
|
+
export type Type = ClosedEnum<typeof Type>;
|
|
19
|
+
|
|
20
|
+
export type TranscriptionSegmentChunk = {
|
|
21
|
+
text: string;
|
|
22
|
+
start: number;
|
|
23
|
+
end: number;
|
|
24
|
+
type?: Type | undefined;
|
|
25
|
+
additionalProperties?: { [k: string]: any };
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
|
|
30
|
+
Type,
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
|
|
35
|
+
Type$inboundSchema;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
40
|
+
*/
|
|
41
|
+
export namespace Type$ {
|
|
42
|
+
/** @deprecated use `Type$inboundSchema` instead. */
|
|
43
|
+
export const inboundSchema = Type$inboundSchema;
|
|
44
|
+
/** @deprecated use `Type$outboundSchema` instead. */
|
|
45
|
+
export const outboundSchema = Type$outboundSchema;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const TranscriptionSegmentChunk$inboundSchema: z.ZodType<
|
|
50
|
+
TranscriptionSegmentChunk,
|
|
51
|
+
z.ZodTypeDef,
|
|
52
|
+
unknown
|
|
53
|
+
> = collectExtraKeys$(
|
|
54
|
+
z.object({
|
|
55
|
+
text: z.string(),
|
|
56
|
+
start: z.number(),
|
|
57
|
+
end: z.number(),
|
|
58
|
+
type: Type$inboundSchema.default("transcription_segment"),
|
|
59
|
+
}).catchall(z.any()),
|
|
60
|
+
"additionalProperties",
|
|
61
|
+
true,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export type TranscriptionSegmentChunk$Outbound = {
|
|
66
|
+
text: string;
|
|
67
|
+
start: number;
|
|
68
|
+
end: number;
|
|
69
|
+
type: string;
|
|
70
|
+
[additionalProperties: string]: unknown;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/** @internal */
|
|
74
|
+
export const TranscriptionSegmentChunk$outboundSchema: z.ZodType<
|
|
75
|
+
TranscriptionSegmentChunk$Outbound,
|
|
76
|
+
z.ZodTypeDef,
|
|
77
|
+
TranscriptionSegmentChunk
|
|
78
|
+
> = z.object({
|
|
79
|
+
text: z.string(),
|
|
80
|
+
start: z.number(),
|
|
81
|
+
end: z.number(),
|
|
82
|
+
type: Type$outboundSchema.default("transcription_segment"),
|
|
83
|
+
additionalProperties: z.record(z.any()),
|
|
84
|
+
}).transform((v) => {
|
|
85
|
+
return {
|
|
86
|
+
...v.additionalProperties,
|
|
87
|
+
...remap$(v, {
|
|
88
|
+
additionalProperties: null,
|
|
89
|
+
}),
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
96
|
+
*/
|
|
97
|
+
export namespace TranscriptionSegmentChunk$ {
|
|
98
|
+
/** @deprecated use `TranscriptionSegmentChunk$inboundSchema` instead. */
|
|
99
|
+
export const inboundSchema = TranscriptionSegmentChunk$inboundSchema;
|
|
100
|
+
/** @deprecated use `TranscriptionSegmentChunk$outboundSchema` instead. */
|
|
101
|
+
export const outboundSchema = TranscriptionSegmentChunk$outboundSchema;
|
|
102
|
+
/** @deprecated use `TranscriptionSegmentChunk$Outbound` instead. */
|
|
103
|
+
export type Outbound = TranscriptionSegmentChunk$Outbound;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function transcriptionSegmentChunkToJSON(
|
|
107
|
+
transcriptionSegmentChunk: TranscriptionSegmentChunk,
|
|
108
|
+
): string {
|
|
109
|
+
return JSON.stringify(
|
|
110
|
+
TranscriptionSegmentChunk$outboundSchema.parse(transcriptionSegmentChunk),
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function transcriptionSegmentChunkFromJSON(
|
|
115
|
+
jsonString: string,
|
|
116
|
+
): SafeParseResult<TranscriptionSegmentChunk, SDKValidationError> {
|
|
117
|
+
return safeParse(
|
|
118
|
+
jsonString,
|
|
119
|
+
(x) => TranscriptionSegmentChunk$inboundSchema.parse(JSON.parse(x)),
|
|
120
|
+
`Failed to parse 'TranscriptionSegmentChunk' from JSON`,
|
|
121
|
+
);
|
|
122
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
collectExtraKeys as collectExtraKeys$,
|
|
9
|
+
safeParse,
|
|
10
|
+
} from "../../lib/schemas.js";
|
|
11
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
12
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
13
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
14
|
+
import {
|
|
15
|
+
TranscriptionSegmentChunk,
|
|
16
|
+
TranscriptionSegmentChunk$inboundSchema,
|
|
17
|
+
TranscriptionSegmentChunk$Outbound,
|
|
18
|
+
TranscriptionSegmentChunk$outboundSchema,
|
|
19
|
+
} from "./transcriptionsegmentchunk.js";
|
|
20
|
+
import {
|
|
21
|
+
UsageInfo,
|
|
22
|
+
UsageInfo$inboundSchema,
|
|
23
|
+
UsageInfo$Outbound,
|
|
24
|
+
UsageInfo$outboundSchema,
|
|
25
|
+
} from "./usageinfo.js";
|
|
26
|
+
|
|
27
|
+
export const TranscriptionStreamDoneType = {
|
|
28
|
+
TranscriptionDone: "transcription.done",
|
|
29
|
+
} as const;
|
|
30
|
+
export type TranscriptionStreamDoneType = ClosedEnum<
|
|
31
|
+
typeof TranscriptionStreamDoneType
|
|
32
|
+
>;
|
|
33
|
+
|
|
34
|
+
export type TranscriptionStreamDone = {
|
|
35
|
+
model: string;
|
|
36
|
+
text: string;
|
|
37
|
+
segments?: Array<TranscriptionSegmentChunk> | undefined;
|
|
38
|
+
usage: UsageInfo;
|
|
39
|
+
type?: TranscriptionStreamDoneType | undefined;
|
|
40
|
+
language: string | null;
|
|
41
|
+
additionalProperties?: { [k: string]: any };
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const TranscriptionStreamDoneType$inboundSchema: z.ZodNativeEnum<
|
|
46
|
+
typeof TranscriptionStreamDoneType
|
|
47
|
+
> = z.nativeEnum(TranscriptionStreamDoneType);
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const TranscriptionStreamDoneType$outboundSchema: z.ZodNativeEnum<
|
|
51
|
+
typeof TranscriptionStreamDoneType
|
|
52
|
+
> = TranscriptionStreamDoneType$inboundSchema;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
57
|
+
*/
|
|
58
|
+
export namespace TranscriptionStreamDoneType$ {
|
|
59
|
+
/** @deprecated use `TranscriptionStreamDoneType$inboundSchema` instead. */
|
|
60
|
+
export const inboundSchema = TranscriptionStreamDoneType$inboundSchema;
|
|
61
|
+
/** @deprecated use `TranscriptionStreamDoneType$outboundSchema` instead. */
|
|
62
|
+
export const outboundSchema = TranscriptionStreamDoneType$outboundSchema;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** @internal */
|
|
66
|
+
export const TranscriptionStreamDone$inboundSchema: z.ZodType<
|
|
67
|
+
TranscriptionStreamDone,
|
|
68
|
+
z.ZodTypeDef,
|
|
69
|
+
unknown
|
|
70
|
+
> = collectExtraKeys$(
|
|
71
|
+
z.object({
|
|
72
|
+
model: z.string(),
|
|
73
|
+
text: z.string(),
|
|
74
|
+
segments: z.array(TranscriptionSegmentChunk$inboundSchema).optional(),
|
|
75
|
+
usage: UsageInfo$inboundSchema,
|
|
76
|
+
type: TranscriptionStreamDoneType$inboundSchema.default(
|
|
77
|
+
"transcription.done",
|
|
78
|
+
),
|
|
79
|
+
language: z.nullable(z.string()),
|
|
80
|
+
}).catchall(z.any()),
|
|
81
|
+
"additionalProperties",
|
|
82
|
+
true,
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
export type TranscriptionStreamDone$Outbound = {
|
|
87
|
+
model: string;
|
|
88
|
+
text: string;
|
|
89
|
+
segments?: Array<TranscriptionSegmentChunk$Outbound> | undefined;
|
|
90
|
+
usage: UsageInfo$Outbound;
|
|
91
|
+
type: string;
|
|
92
|
+
language: string | null;
|
|
93
|
+
[additionalProperties: string]: unknown;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/** @internal */
|
|
97
|
+
export const TranscriptionStreamDone$outboundSchema: z.ZodType<
|
|
98
|
+
TranscriptionStreamDone$Outbound,
|
|
99
|
+
z.ZodTypeDef,
|
|
100
|
+
TranscriptionStreamDone
|
|
101
|
+
> = z.object({
|
|
102
|
+
model: z.string(),
|
|
103
|
+
text: z.string(),
|
|
104
|
+
segments: z.array(TranscriptionSegmentChunk$outboundSchema).optional(),
|
|
105
|
+
usage: UsageInfo$outboundSchema,
|
|
106
|
+
type: TranscriptionStreamDoneType$outboundSchema.default(
|
|
107
|
+
"transcription.done",
|
|
108
|
+
),
|
|
109
|
+
language: z.nullable(z.string()),
|
|
110
|
+
additionalProperties: z.record(z.any()),
|
|
111
|
+
}).transform((v) => {
|
|
112
|
+
return {
|
|
113
|
+
...v.additionalProperties,
|
|
114
|
+
...remap$(v, {
|
|
115
|
+
additionalProperties: null,
|
|
116
|
+
}),
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @internal
|
|
122
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
123
|
+
*/
|
|
124
|
+
export namespace TranscriptionStreamDone$ {
|
|
125
|
+
/** @deprecated use `TranscriptionStreamDone$inboundSchema` instead. */
|
|
126
|
+
export const inboundSchema = TranscriptionStreamDone$inboundSchema;
|
|
127
|
+
/** @deprecated use `TranscriptionStreamDone$outboundSchema` instead. */
|
|
128
|
+
export const outboundSchema = TranscriptionStreamDone$outboundSchema;
|
|
129
|
+
/** @deprecated use `TranscriptionStreamDone$Outbound` instead. */
|
|
130
|
+
export type Outbound = TranscriptionStreamDone$Outbound;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function transcriptionStreamDoneToJSON(
|
|
134
|
+
transcriptionStreamDone: TranscriptionStreamDone,
|
|
135
|
+
): string {
|
|
136
|
+
return JSON.stringify(
|
|
137
|
+
TranscriptionStreamDone$outboundSchema.parse(transcriptionStreamDone),
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function transcriptionStreamDoneFromJSON(
|
|
142
|
+
jsonString: string,
|
|
143
|
+
): SafeParseResult<TranscriptionStreamDone, SDKValidationError> {
|
|
144
|
+
return safeParse(
|
|
145
|
+
jsonString,
|
|
146
|
+
(x) => TranscriptionStreamDone$inboundSchema.parse(JSON.parse(x)),
|
|
147
|
+
`Failed to parse 'TranscriptionStreamDone' from JSON`,
|
|
148
|
+
);
|
|
149
|
+
}
|