@mistralai/mistralai 1.7.4 → 1.9.17

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.
Files changed (181) hide show
  1. package/README.md +10 -0
  2. package/docs/sdks/accesses/README.md +2 -0
  3. package/docs/sdks/audio/README.md +6 -0
  4. package/docs/sdks/documents/README.md +2 -0
  5. package/docs/sdks/libraries/README.md +1 -1
  6. package/docs/sdks/transcriptions/README.md +167 -0
  7. package/examples/src/async_audio_transcription_stream.ts +17 -0
  8. package/funcs/audioTranscriptionsComplete.d.ts +13 -0
  9. package/funcs/audioTranscriptionsComplete.d.ts.map +1 -0
  10. package/funcs/audioTranscriptionsComplete.js +133 -0
  11. package/funcs/audioTranscriptionsComplete.js.map +1 -0
  12. package/funcs/audioTranscriptionsStream.d.ts +14 -0
  13. package/funcs/audioTranscriptionsStream.d.ts.map +1 -0
  14. package/funcs/audioTranscriptionsStream.js +143 -0
  15. package/funcs/audioTranscriptionsStream.js.map +1 -0
  16. package/funcs/batchJobsList.js +1 -0
  17. package/funcs/batchJobsList.js.map +1 -1
  18. package/jsr.json +1 -1
  19. package/lib/config.d.ts +2 -2
  20. package/lib/config.js +2 -2
  21. package/lib/config.js.map +1 -1
  22. package/models/components/audiochunk.d.ts +54 -0
  23. package/models/components/audiochunk.d.ts.map +1 -0
  24. package/models/components/audiochunk.js +88 -0
  25. package/models/components/audiochunk.js.map +1 -0
  26. package/models/components/audiotranscriptionrequest.d.ts +57 -0
  27. package/models/components/audiotranscriptionrequest.d.ts.map +1 -0
  28. package/models/components/audiotranscriptionrequest.js +91 -0
  29. package/models/components/audiotranscriptionrequest.js.map +1 -0
  30. package/models/components/audiotranscriptionrequeststream.d.ts +57 -0
  31. package/models/components/audiotranscriptionrequeststream.d.ts.map +1 -0
  32. package/models/components/audiotranscriptionrequeststream.js +91 -0
  33. package/models/components/audiotranscriptionrequeststream.js.map +1 -0
  34. package/models/components/basemodelcard.d.ts +7 -7
  35. package/models/components/basemodelcard.d.ts.map +1 -1
  36. package/models/components/basemodelcard.js +11 -11
  37. package/models/components/basemodelcard.js.map +1 -1
  38. package/models/components/batchjobin.d.ts +4 -2
  39. package/models/components/batchjobin.d.ts.map +1 -1
  40. package/models/components/batchjobin.js +6 -2
  41. package/models/components/batchjobin.js.map +1 -1
  42. package/models/components/batchjobout.d.ts +4 -2
  43. package/models/components/batchjobout.d.ts.map +1 -1
  44. package/models/components/batchjobout.js +6 -2
  45. package/models/components/batchjobout.js.map +1 -1
  46. package/models/components/classifierftmodelout.d.ts +4 -0
  47. package/models/components/classifierftmodelout.d.ts.map +1 -1
  48. package/models/components/classifierftmodelout.js +8 -0
  49. package/models/components/classifierftmodelout.js.map +1 -1
  50. package/models/components/completionargs.d.ts +2 -2
  51. package/models/components/completionargs.d.ts.map +1 -1
  52. package/models/components/completionargs.js +2 -2
  53. package/models/components/completionargs.js.map +1 -1
  54. package/models/components/completionftmodelout.d.ts +4 -0
  55. package/models/components/completionftmodelout.d.ts.map +1 -1
  56. package/models/components/completionftmodelout.js +8 -0
  57. package/models/components/completionftmodelout.js.map +1 -1
  58. package/models/components/contentchunk.d.ts +10 -0
  59. package/models/components/contentchunk.d.ts.map +1 -1
  60. package/models/components/contentchunk.js +14 -0
  61. package/models/components/contentchunk.js.map +1 -1
  62. package/models/components/fileschema.d.ts +4 -0
  63. package/models/components/fileschema.d.ts.map +1 -1
  64. package/models/components/fileschema.js +4 -0
  65. package/models/components/fileschema.js.map +1 -1
  66. package/models/components/index.d.ts +13 -0
  67. package/models/components/index.d.ts.map +1 -1
  68. package/models/components/index.js +13 -0
  69. package/models/components/index.js.map +1 -1
  70. package/models/components/messageoutputcontentchunks.d.ts +3 -2
  71. package/models/components/messageoutputcontentchunks.d.ts.map +1 -1
  72. package/models/components/messageoutputcontentchunks.js +3 -0
  73. package/models/components/messageoutputcontentchunks.js.map +1 -1
  74. package/models/components/outputcontentchunks.d.ts +3 -2
  75. package/models/components/outputcontentchunks.d.ts.map +1 -1
  76. package/models/components/outputcontentchunks.js +3 -0
  77. package/models/components/outputcontentchunks.js.map +1 -1
  78. package/models/components/retrievefileout.d.ts +4 -0
  79. package/models/components/retrievefileout.d.ts.map +1 -1
  80. package/models/components/retrievefileout.js +4 -0
  81. package/models/components/retrievefileout.js.map +1 -1
  82. package/models/components/thinkchunk.d.ts +82 -0
  83. package/models/components/thinkchunk.d.ts.map +1 -0
  84. package/models/components/thinkchunk.js +106 -0
  85. package/models/components/thinkchunk.js.map +1 -0
  86. package/models/components/timestampgranularity.d.ts +25 -0
  87. package/models/components/timestampgranularity.d.ts.map +1 -0
  88. package/models/components/timestampgranularity.js +49 -0
  89. package/models/components/timestampgranularity.js.map +1 -0
  90. package/models/components/transcriptionresponse.d.ts +43 -0
  91. package/models/components/transcriptionresponse.d.ts.map +1 -0
  92. package/models/components/transcriptionresponse.js +78 -0
  93. package/models/components/transcriptionresponse.js.map +1 -0
  94. package/models/components/transcriptionsegmentchunk.d.ts +62 -0
  95. package/models/components/transcriptionsegmentchunk.d.ts.map +1 -0
  96. package/models/components/transcriptionsegmentchunk.js +92 -0
  97. package/models/components/transcriptionsegmentchunk.js.map +1 -0
  98. package/models/components/transcriptionstreamdone.d.ts +68 -0
  99. package/models/components/transcriptionstreamdone.d.ts.map +1 -0
  100. package/models/components/transcriptionstreamdone.js +98 -0
  101. package/models/components/transcriptionstreamdone.js.map +1 -0
  102. package/models/components/transcriptionstreamevents.d.ts +89 -0
  103. package/models/components/transcriptionstreamevents.d.ts.map +1 -0
  104. package/models/components/transcriptionstreamevents.js +138 -0
  105. package/models/components/transcriptionstreamevents.js.map +1 -0
  106. package/models/components/transcriptionstreameventtypes.d.ts +34 -0
  107. package/models/components/transcriptionstreameventtypes.d.ts.map +1 -0
  108. package/models/components/transcriptionstreameventtypes.js +52 -0
  109. package/models/components/transcriptionstreameventtypes.js.map +1 -0
  110. package/models/components/transcriptionstreamlanguage.d.ts +58 -0
  111. package/models/components/transcriptionstreamlanguage.d.ts.map +1 -0
  112. package/models/components/transcriptionstreamlanguage.js +93 -0
  113. package/models/components/transcriptionstreamlanguage.js.map +1 -0
  114. package/models/components/transcriptionstreamsegmentdelta.d.ts +62 -0
  115. package/models/components/transcriptionstreamsegmentdelta.d.ts.map +1 -0
  116. package/models/components/transcriptionstreamsegmentdelta.js +92 -0
  117. package/models/components/transcriptionstreamsegmentdelta.js.map +1 -0
  118. package/models/components/transcriptionstreamtextdelta.d.ts +58 -0
  119. package/models/components/transcriptionstreamtextdelta.d.ts.map +1 -0
  120. package/models/components/transcriptionstreamtextdelta.js +88 -0
  121. package/models/components/transcriptionstreamtextdelta.js.map +1 -0
  122. package/models/components/uploadfileout.d.ts +4 -0
  123. package/models/components/uploadfileout.d.ts.map +1 -1
  124. package/models/components/uploadfileout.js +4 -0
  125. package/models/components/uploadfileout.js.map +1 -1
  126. package/models/components/usageinfo.d.ts +9 -3
  127. package/models/components/usageinfo.d.ts.map +1 -1
  128. package/models/components/usageinfo.js +22 -13
  129. package/models/components/usageinfo.js.map +1 -1
  130. package/models/operations/jobsapiroutesbatchgetbatchjobs.d.ts +2 -0
  131. package/models/operations/jobsapiroutesbatchgetbatchjobs.d.ts.map +1 -1
  132. package/models/operations/jobsapiroutesbatchgetbatchjobs.js +4 -0
  133. package/models/operations/jobsapiroutesbatchgetbatchjobs.js.map +1 -1
  134. package/package.json +1 -1
  135. package/sdk/audio.d.ts +7 -0
  136. package/sdk/audio.d.ts.map +1 -0
  137. package/sdk/audio.js +15 -0
  138. package/sdk/audio.js.map +1 -0
  139. package/sdk/sdk.d.ts +3 -0
  140. package/sdk/sdk.d.ts.map +1 -1
  141. package/sdk/sdk.js +4 -0
  142. package/sdk/sdk.js.map +1 -1
  143. package/sdk/transcriptions.d.ts +14 -0
  144. package/sdk/transcriptions.d.ts.map +1 -0
  145. package/sdk/transcriptions.js +26 -0
  146. package/sdk/transcriptions.js.map +1 -0
  147. package/src/funcs/audioTranscriptionsComplete.ts +193 -0
  148. package/src/funcs/audioTranscriptionsStream.ts +207 -0
  149. package/src/funcs/batchJobsList.ts +1 -0
  150. package/src/lib/config.ts +2 -2
  151. package/src/models/components/audiochunk.ts +102 -0
  152. package/src/models/components/audiotranscriptionrequest.ts +133 -0
  153. package/src/models/components/audiotranscriptionrequeststream.ts +135 -0
  154. package/src/models/components/basemodelcard.ts +13 -12
  155. package/src/models/components/batchjobin.ts +10 -4
  156. package/src/models/components/batchjobout.ts +10 -4
  157. package/src/models/components/classifierftmodelout.ts +12 -0
  158. package/src/models/components/completionargs.ts +4 -4
  159. package/src/models/components/completionftmodelout.ts +12 -0
  160. package/src/models/components/contentchunk.ts +38 -2
  161. package/src/models/components/fileschema.ts +8 -0
  162. package/src/models/components/index.ts +13 -0
  163. package/src/models/components/messageoutputcontentchunks.ts +10 -0
  164. package/src/models/components/outputcontentchunks.ts +10 -0
  165. package/src/models/components/retrievefileout.ts +8 -0
  166. package/src/models/components/thinkchunk.ts +162 -0
  167. package/src/models/components/timestampgranularity.ts +32 -0
  168. package/src/models/components/transcriptionresponse.ts +112 -0
  169. package/src/models/components/transcriptionsegmentchunk.ts +122 -0
  170. package/src/models/components/transcriptionstreamdone.ts +149 -0
  171. package/src/models/components/transcriptionstreamevents.ts +273 -0
  172. package/src/models/components/transcriptionstreameventtypes.ts +37 -0
  173. package/src/models/components/transcriptionstreamlanguage.ts +128 -0
  174. package/src/models/components/transcriptionstreamsegmentdelta.ts +133 -0
  175. package/src/models/components/transcriptionstreamtextdelta.ts +123 -0
  176. package/src/models/components/uploadfileout.ts +8 -0
  177. package/src/models/components/usageinfo.ts +37 -17
  178. package/src/models/operations/jobsapiroutesbatchgetbatchjobs.ts +6 -0
  179. package/src/sdk/audio.ts +13 -0
  180. package/src/sdk/sdk.ts +6 -0
  181. package/src/sdk/transcriptions.ts +40 -0
@@ -0,0 +1,273 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ TranscriptionStreamDone,
11
+ TranscriptionStreamDone$inboundSchema,
12
+ TranscriptionStreamDone$Outbound,
13
+ TranscriptionStreamDone$outboundSchema,
14
+ } from "./transcriptionstreamdone.js";
15
+ import {
16
+ TranscriptionStreamEventTypes,
17
+ TranscriptionStreamEventTypes$inboundSchema,
18
+ TranscriptionStreamEventTypes$outboundSchema,
19
+ } from "./transcriptionstreameventtypes.js";
20
+ import {
21
+ TranscriptionStreamLanguage,
22
+ TranscriptionStreamLanguage$inboundSchema,
23
+ TranscriptionStreamLanguage$Outbound,
24
+ TranscriptionStreamLanguage$outboundSchema,
25
+ } from "./transcriptionstreamlanguage.js";
26
+ import {
27
+ TranscriptionStreamSegmentDelta,
28
+ TranscriptionStreamSegmentDelta$inboundSchema,
29
+ TranscriptionStreamSegmentDelta$Outbound,
30
+ TranscriptionStreamSegmentDelta$outboundSchema,
31
+ } from "./transcriptionstreamsegmentdelta.js";
32
+ import {
33
+ TranscriptionStreamTextDelta,
34
+ TranscriptionStreamTextDelta$inboundSchema,
35
+ TranscriptionStreamTextDelta$Outbound,
36
+ TranscriptionStreamTextDelta$outboundSchema,
37
+ } from "./transcriptionstreamtextdelta.js";
38
+
39
+ export type TranscriptionStreamEventsData =
40
+ | (TranscriptionStreamLanguage & { type: "transcription.language" })
41
+ | (TranscriptionStreamTextDelta & { type: "transcription.text.delta" })
42
+ | (TranscriptionStreamSegmentDelta & { type: "transcription.segment" })
43
+ | (TranscriptionStreamDone & { type: "transcription.done" });
44
+
45
+ export type TranscriptionStreamEvents = {
46
+ event: TranscriptionStreamEventTypes;
47
+ data:
48
+ | (TranscriptionStreamLanguage & { type: "transcription.language" })
49
+ | (TranscriptionStreamTextDelta & { type: "transcription.text.delta" })
50
+ | (TranscriptionStreamSegmentDelta & { type: "transcription.segment" })
51
+ | (TranscriptionStreamDone & { type: "transcription.done" });
52
+ };
53
+
54
+ /** @internal */
55
+ export const TranscriptionStreamEventsData$inboundSchema: z.ZodType<
56
+ TranscriptionStreamEventsData,
57
+ z.ZodTypeDef,
58
+ unknown
59
+ > = z.union([
60
+ TranscriptionStreamLanguage$inboundSchema.and(
61
+ z.object({ type: z.literal("transcription.language") }).transform((v) => ({
62
+ type: v.type,
63
+ })),
64
+ ),
65
+ TranscriptionStreamTextDelta$inboundSchema.and(
66
+ z.object({ type: z.literal("transcription.text.delta") }).transform((
67
+ v,
68
+ ) => ({ type: v.type })),
69
+ ),
70
+ TranscriptionStreamSegmentDelta$inboundSchema.and(
71
+ z.object({ type: z.literal("transcription.segment") }).transform((v) => ({
72
+ type: v.type,
73
+ })),
74
+ ),
75
+ TranscriptionStreamDone$inboundSchema.and(
76
+ z.object({ type: z.literal("transcription.done") }).transform((v) => ({
77
+ type: v.type,
78
+ })),
79
+ ),
80
+ ]);
81
+
82
+ /** @internal */
83
+ export type TranscriptionStreamEventsData$Outbound =
84
+ | (TranscriptionStreamLanguage$Outbound & { type: "transcription.language" })
85
+ | (TranscriptionStreamTextDelta$Outbound & {
86
+ type: "transcription.text.delta";
87
+ })
88
+ | (TranscriptionStreamSegmentDelta$Outbound & {
89
+ type: "transcription.segment";
90
+ })
91
+ | (TranscriptionStreamDone$Outbound & { type: "transcription.done" });
92
+
93
+ /** @internal */
94
+ export const TranscriptionStreamEventsData$outboundSchema: z.ZodType<
95
+ TranscriptionStreamEventsData$Outbound,
96
+ z.ZodTypeDef,
97
+ TranscriptionStreamEventsData
98
+ > = z.union([
99
+ TranscriptionStreamLanguage$outboundSchema.and(
100
+ z.object({ type: z.literal("transcription.language") }).transform((v) => ({
101
+ type: v.type,
102
+ })),
103
+ ),
104
+ TranscriptionStreamTextDelta$outboundSchema.and(
105
+ z.object({ type: z.literal("transcription.text.delta") }).transform((
106
+ v,
107
+ ) => ({ type: v.type })),
108
+ ),
109
+ TranscriptionStreamSegmentDelta$outboundSchema.and(
110
+ z.object({ type: z.literal("transcription.segment") }).transform((v) => ({
111
+ type: v.type,
112
+ })),
113
+ ),
114
+ TranscriptionStreamDone$outboundSchema.and(
115
+ z.object({ type: z.literal("transcription.done") }).transform((v) => ({
116
+ type: v.type,
117
+ })),
118
+ ),
119
+ ]);
120
+
121
+ /**
122
+ * @internal
123
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
124
+ */
125
+ export namespace TranscriptionStreamEventsData$ {
126
+ /** @deprecated use `TranscriptionStreamEventsData$inboundSchema` instead. */
127
+ export const inboundSchema = TranscriptionStreamEventsData$inboundSchema;
128
+ /** @deprecated use `TranscriptionStreamEventsData$outboundSchema` instead. */
129
+ export const outboundSchema = TranscriptionStreamEventsData$outboundSchema;
130
+ /** @deprecated use `TranscriptionStreamEventsData$Outbound` instead. */
131
+ export type Outbound = TranscriptionStreamEventsData$Outbound;
132
+ }
133
+
134
+ export function transcriptionStreamEventsDataToJSON(
135
+ transcriptionStreamEventsData: TranscriptionStreamEventsData,
136
+ ): string {
137
+ return JSON.stringify(
138
+ TranscriptionStreamEventsData$outboundSchema.parse(
139
+ transcriptionStreamEventsData,
140
+ ),
141
+ );
142
+ }
143
+
144
+ export function transcriptionStreamEventsDataFromJSON(
145
+ jsonString: string,
146
+ ): SafeParseResult<TranscriptionStreamEventsData, SDKValidationError> {
147
+ return safeParse(
148
+ jsonString,
149
+ (x) => TranscriptionStreamEventsData$inboundSchema.parse(JSON.parse(x)),
150
+ `Failed to parse 'TranscriptionStreamEventsData' from JSON`,
151
+ );
152
+ }
153
+
154
+ /** @internal */
155
+ export const TranscriptionStreamEvents$inboundSchema: z.ZodType<
156
+ TranscriptionStreamEvents,
157
+ z.ZodTypeDef,
158
+ unknown
159
+ > = z.object({
160
+ event: TranscriptionStreamEventTypes$inboundSchema,
161
+ data: z.string().transform((v, ctx) => {
162
+ try {
163
+ return JSON.parse(v);
164
+ } catch (err) {
165
+ ctx.addIssue({
166
+ code: z.ZodIssueCode.custom,
167
+ message: `malformed json: ${err}`,
168
+ });
169
+ return z.NEVER;
170
+ }
171
+ }).pipe(
172
+ z.union([
173
+ TranscriptionStreamLanguage$inboundSchema.and(
174
+ z.object({ type: z.literal("transcription.language") }).transform((
175
+ v,
176
+ ) => ({ type: v.type })),
177
+ ),
178
+ TranscriptionStreamTextDelta$inboundSchema.and(
179
+ z.object({ type: z.literal("transcription.text.delta") }).transform((
180
+ v,
181
+ ) => ({ type: v.type })),
182
+ ),
183
+ TranscriptionStreamSegmentDelta$inboundSchema.and(
184
+ z.object({ type: z.literal("transcription.segment") }).transform((
185
+ v,
186
+ ) => ({ type: v.type })),
187
+ ),
188
+ TranscriptionStreamDone$inboundSchema.and(
189
+ z.object({ type: z.literal("transcription.done") }).transform((v) => ({
190
+ type: v.type,
191
+ })),
192
+ ),
193
+ ]),
194
+ ),
195
+ });
196
+
197
+ /** @internal */
198
+ export type TranscriptionStreamEvents$Outbound = {
199
+ event: string;
200
+ data:
201
+ | (TranscriptionStreamLanguage$Outbound & {
202
+ type: "transcription.language";
203
+ })
204
+ | (TranscriptionStreamTextDelta$Outbound & {
205
+ type: "transcription.text.delta";
206
+ })
207
+ | (TranscriptionStreamSegmentDelta$Outbound & {
208
+ type: "transcription.segment";
209
+ })
210
+ | (TranscriptionStreamDone$Outbound & { type: "transcription.done" });
211
+ };
212
+
213
+ /** @internal */
214
+ export const TranscriptionStreamEvents$outboundSchema: z.ZodType<
215
+ TranscriptionStreamEvents$Outbound,
216
+ z.ZodTypeDef,
217
+ TranscriptionStreamEvents
218
+ > = z.object({
219
+ event: TranscriptionStreamEventTypes$outboundSchema,
220
+ data: z.union([
221
+ TranscriptionStreamLanguage$outboundSchema.and(
222
+ z.object({ type: z.literal("transcription.language") }).transform((
223
+ v,
224
+ ) => ({ type: v.type })),
225
+ ),
226
+ TranscriptionStreamTextDelta$outboundSchema.and(
227
+ z.object({ type: z.literal("transcription.text.delta") }).transform((
228
+ v,
229
+ ) => ({ type: v.type })),
230
+ ),
231
+ TranscriptionStreamSegmentDelta$outboundSchema.and(
232
+ z.object({ type: z.literal("transcription.segment") }).transform((v) => ({
233
+ type: v.type,
234
+ })),
235
+ ),
236
+ TranscriptionStreamDone$outboundSchema.and(
237
+ z.object({ type: z.literal("transcription.done") }).transform((v) => ({
238
+ type: v.type,
239
+ })),
240
+ ),
241
+ ]),
242
+ });
243
+
244
+ /**
245
+ * @internal
246
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
247
+ */
248
+ export namespace TranscriptionStreamEvents$ {
249
+ /** @deprecated use `TranscriptionStreamEvents$inboundSchema` instead. */
250
+ export const inboundSchema = TranscriptionStreamEvents$inboundSchema;
251
+ /** @deprecated use `TranscriptionStreamEvents$outboundSchema` instead. */
252
+ export const outboundSchema = TranscriptionStreamEvents$outboundSchema;
253
+ /** @deprecated use `TranscriptionStreamEvents$Outbound` instead. */
254
+ export type Outbound = TranscriptionStreamEvents$Outbound;
255
+ }
256
+
257
+ export function transcriptionStreamEventsToJSON(
258
+ transcriptionStreamEvents: TranscriptionStreamEvents,
259
+ ): string {
260
+ return JSON.stringify(
261
+ TranscriptionStreamEvents$outboundSchema.parse(transcriptionStreamEvents),
262
+ );
263
+ }
264
+
265
+ export function transcriptionStreamEventsFromJSON(
266
+ jsonString: string,
267
+ ): SafeParseResult<TranscriptionStreamEvents, SDKValidationError> {
268
+ return safeParse(
269
+ jsonString,
270
+ (x) => TranscriptionStreamEvents$inboundSchema.parse(JSON.parse(x)),
271
+ `Failed to parse 'TranscriptionStreamEvents' from JSON`,
272
+ );
273
+ }
@@ -0,0 +1,37 @@
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 TranscriptionStreamEventTypes = {
9
+ TranscriptionLanguage: "transcription.language",
10
+ TranscriptionSegment: "transcription.segment",
11
+ TranscriptionTextDelta: "transcription.text.delta",
12
+ TranscriptionDone: "transcription.done",
13
+ } as const;
14
+ export type TranscriptionStreamEventTypes = ClosedEnum<
15
+ typeof TranscriptionStreamEventTypes
16
+ >;
17
+
18
+ /** @internal */
19
+ export const TranscriptionStreamEventTypes$inboundSchema: z.ZodNativeEnum<
20
+ typeof TranscriptionStreamEventTypes
21
+ > = z.nativeEnum(TranscriptionStreamEventTypes);
22
+
23
+ /** @internal */
24
+ export const TranscriptionStreamEventTypes$outboundSchema: z.ZodNativeEnum<
25
+ typeof TranscriptionStreamEventTypes
26
+ > = TranscriptionStreamEventTypes$inboundSchema;
27
+
28
+ /**
29
+ * @internal
30
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
31
+ */
32
+ export namespace TranscriptionStreamEventTypes$ {
33
+ /** @deprecated use `TranscriptionStreamEventTypes$inboundSchema` instead. */
34
+ export const inboundSchema = TranscriptionStreamEventTypes$inboundSchema;
35
+ /** @deprecated use `TranscriptionStreamEventTypes$outboundSchema` instead. */
36
+ export const outboundSchema = TranscriptionStreamEventTypes$outboundSchema;
37
+ }
@@ -0,0 +1,128 @@
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 TranscriptionStreamLanguageType = {
16
+ TranscriptionLanguage: "transcription.language",
17
+ } as const;
18
+ export type TranscriptionStreamLanguageType = ClosedEnum<
19
+ typeof TranscriptionStreamLanguageType
20
+ >;
21
+
22
+ export type TranscriptionStreamLanguage = {
23
+ type?: TranscriptionStreamLanguageType | undefined;
24
+ audioLanguage: string;
25
+ additionalProperties?: { [k: string]: any };
26
+ };
27
+
28
+ /** @internal */
29
+ export const TranscriptionStreamLanguageType$inboundSchema: z.ZodNativeEnum<
30
+ typeof TranscriptionStreamLanguageType
31
+ > = z.nativeEnum(TranscriptionStreamLanguageType);
32
+
33
+ /** @internal */
34
+ export const TranscriptionStreamLanguageType$outboundSchema: z.ZodNativeEnum<
35
+ typeof TranscriptionStreamLanguageType
36
+ > = TranscriptionStreamLanguageType$inboundSchema;
37
+
38
+ /**
39
+ * @internal
40
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
41
+ */
42
+ export namespace TranscriptionStreamLanguageType$ {
43
+ /** @deprecated use `TranscriptionStreamLanguageType$inboundSchema` instead. */
44
+ export const inboundSchema = TranscriptionStreamLanguageType$inboundSchema;
45
+ /** @deprecated use `TranscriptionStreamLanguageType$outboundSchema` instead. */
46
+ export const outboundSchema = TranscriptionStreamLanguageType$outboundSchema;
47
+ }
48
+
49
+ /** @internal */
50
+ export const TranscriptionStreamLanguage$inboundSchema: z.ZodType<
51
+ TranscriptionStreamLanguage,
52
+ z.ZodTypeDef,
53
+ unknown
54
+ > = collectExtraKeys$(
55
+ z.object({
56
+ type: TranscriptionStreamLanguageType$inboundSchema.default(
57
+ "transcription.language",
58
+ ),
59
+ audio_language: z.string(),
60
+ }).catchall(z.any()),
61
+ "additionalProperties",
62
+ true,
63
+ ).transform((v) => {
64
+ return remap$(v, {
65
+ "audio_language": "audioLanguage",
66
+ });
67
+ });
68
+
69
+ /** @internal */
70
+ export type TranscriptionStreamLanguage$Outbound = {
71
+ type: string;
72
+ audio_language: string;
73
+ [additionalProperties: string]: unknown;
74
+ };
75
+
76
+ /** @internal */
77
+ export const TranscriptionStreamLanguage$outboundSchema: z.ZodType<
78
+ TranscriptionStreamLanguage$Outbound,
79
+ z.ZodTypeDef,
80
+ TranscriptionStreamLanguage
81
+ > = z.object({
82
+ type: TranscriptionStreamLanguageType$outboundSchema.default(
83
+ "transcription.language",
84
+ ),
85
+ audioLanguage: z.string(),
86
+ additionalProperties: z.record(z.any()),
87
+ }).transform((v) => {
88
+ return {
89
+ ...v.additionalProperties,
90
+ ...remap$(v, {
91
+ audioLanguage: "audio_language",
92
+ additionalProperties: null,
93
+ }),
94
+ };
95
+ });
96
+
97
+ /**
98
+ * @internal
99
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
100
+ */
101
+ export namespace TranscriptionStreamLanguage$ {
102
+ /** @deprecated use `TranscriptionStreamLanguage$inboundSchema` instead. */
103
+ export const inboundSchema = TranscriptionStreamLanguage$inboundSchema;
104
+ /** @deprecated use `TranscriptionStreamLanguage$outboundSchema` instead. */
105
+ export const outboundSchema = TranscriptionStreamLanguage$outboundSchema;
106
+ /** @deprecated use `TranscriptionStreamLanguage$Outbound` instead. */
107
+ export type Outbound = TranscriptionStreamLanguage$Outbound;
108
+ }
109
+
110
+ export function transcriptionStreamLanguageToJSON(
111
+ transcriptionStreamLanguage: TranscriptionStreamLanguage,
112
+ ): string {
113
+ return JSON.stringify(
114
+ TranscriptionStreamLanguage$outboundSchema.parse(
115
+ transcriptionStreamLanguage,
116
+ ),
117
+ );
118
+ }
119
+
120
+ export function transcriptionStreamLanguageFromJSON(
121
+ jsonString: string,
122
+ ): SafeParseResult<TranscriptionStreamLanguage, SDKValidationError> {
123
+ return safeParse(
124
+ jsonString,
125
+ (x) => TranscriptionStreamLanguage$inboundSchema.parse(JSON.parse(x)),
126
+ `Failed to parse 'TranscriptionStreamLanguage' from JSON`,
127
+ );
128
+ }
@@ -0,0 +1,133 @@
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 TranscriptionStreamSegmentDeltaType = {
16
+ TranscriptionSegment: "transcription.segment",
17
+ } as const;
18
+ export type TranscriptionStreamSegmentDeltaType = ClosedEnum<
19
+ typeof TranscriptionStreamSegmentDeltaType
20
+ >;
21
+
22
+ export type TranscriptionStreamSegmentDelta = {
23
+ text: string;
24
+ start: number;
25
+ end: number;
26
+ type?: TranscriptionStreamSegmentDeltaType | undefined;
27
+ additionalProperties?: { [k: string]: any };
28
+ };
29
+
30
+ /** @internal */
31
+ export const TranscriptionStreamSegmentDeltaType$inboundSchema: z.ZodNativeEnum<
32
+ typeof TranscriptionStreamSegmentDeltaType
33
+ > = z.nativeEnum(TranscriptionStreamSegmentDeltaType);
34
+
35
+ /** @internal */
36
+ export const TranscriptionStreamSegmentDeltaType$outboundSchema:
37
+ z.ZodNativeEnum<typeof TranscriptionStreamSegmentDeltaType> =
38
+ TranscriptionStreamSegmentDeltaType$inboundSchema;
39
+
40
+ /**
41
+ * @internal
42
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
43
+ */
44
+ export namespace TranscriptionStreamSegmentDeltaType$ {
45
+ /** @deprecated use `TranscriptionStreamSegmentDeltaType$inboundSchema` instead. */
46
+ export const inboundSchema =
47
+ TranscriptionStreamSegmentDeltaType$inboundSchema;
48
+ /** @deprecated use `TranscriptionStreamSegmentDeltaType$outboundSchema` instead. */
49
+ export const outboundSchema =
50
+ TranscriptionStreamSegmentDeltaType$outboundSchema;
51
+ }
52
+
53
+ /** @internal */
54
+ export const TranscriptionStreamSegmentDelta$inboundSchema: z.ZodType<
55
+ TranscriptionStreamSegmentDelta,
56
+ z.ZodTypeDef,
57
+ unknown
58
+ > = collectExtraKeys$(
59
+ z.object({
60
+ text: z.string(),
61
+ start: z.number(),
62
+ end: z.number(),
63
+ type: TranscriptionStreamSegmentDeltaType$inboundSchema.default(
64
+ "transcription.segment",
65
+ ),
66
+ }).catchall(z.any()),
67
+ "additionalProperties",
68
+ true,
69
+ );
70
+
71
+ /** @internal */
72
+ export type TranscriptionStreamSegmentDelta$Outbound = {
73
+ text: string;
74
+ start: number;
75
+ end: number;
76
+ type: string;
77
+ [additionalProperties: string]: unknown;
78
+ };
79
+
80
+ /** @internal */
81
+ export const TranscriptionStreamSegmentDelta$outboundSchema: z.ZodType<
82
+ TranscriptionStreamSegmentDelta$Outbound,
83
+ z.ZodTypeDef,
84
+ TranscriptionStreamSegmentDelta
85
+ > = z.object({
86
+ text: z.string(),
87
+ start: z.number(),
88
+ end: z.number(),
89
+ type: TranscriptionStreamSegmentDeltaType$outboundSchema.default(
90
+ "transcription.segment",
91
+ ),
92
+ additionalProperties: z.record(z.any()),
93
+ }).transform((v) => {
94
+ return {
95
+ ...v.additionalProperties,
96
+ ...remap$(v, {
97
+ additionalProperties: null,
98
+ }),
99
+ };
100
+ });
101
+
102
+ /**
103
+ * @internal
104
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
105
+ */
106
+ export namespace TranscriptionStreamSegmentDelta$ {
107
+ /** @deprecated use `TranscriptionStreamSegmentDelta$inboundSchema` instead. */
108
+ export const inboundSchema = TranscriptionStreamSegmentDelta$inboundSchema;
109
+ /** @deprecated use `TranscriptionStreamSegmentDelta$outboundSchema` instead. */
110
+ export const outboundSchema = TranscriptionStreamSegmentDelta$outboundSchema;
111
+ /** @deprecated use `TranscriptionStreamSegmentDelta$Outbound` instead. */
112
+ export type Outbound = TranscriptionStreamSegmentDelta$Outbound;
113
+ }
114
+
115
+ export function transcriptionStreamSegmentDeltaToJSON(
116
+ transcriptionStreamSegmentDelta: TranscriptionStreamSegmentDelta,
117
+ ): string {
118
+ return JSON.stringify(
119
+ TranscriptionStreamSegmentDelta$outboundSchema.parse(
120
+ transcriptionStreamSegmentDelta,
121
+ ),
122
+ );
123
+ }
124
+
125
+ export function transcriptionStreamSegmentDeltaFromJSON(
126
+ jsonString: string,
127
+ ): SafeParseResult<TranscriptionStreamSegmentDelta, SDKValidationError> {
128
+ return safeParse(
129
+ jsonString,
130
+ (x) => TranscriptionStreamSegmentDelta$inboundSchema.parse(JSON.parse(x)),
131
+ `Failed to parse 'TranscriptionStreamSegmentDelta' from JSON`,
132
+ );
133
+ }
@@ -0,0 +1,123 @@
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 TranscriptionStreamTextDeltaType = {
16
+ TranscriptionTextDelta: "transcription.text.delta",
17
+ } as const;
18
+ export type TranscriptionStreamTextDeltaType = ClosedEnum<
19
+ typeof TranscriptionStreamTextDeltaType
20
+ >;
21
+
22
+ export type TranscriptionStreamTextDelta = {
23
+ text: string;
24
+ type?: TranscriptionStreamTextDeltaType | undefined;
25
+ additionalProperties?: { [k: string]: any };
26
+ };
27
+
28
+ /** @internal */
29
+ export const TranscriptionStreamTextDeltaType$inboundSchema: z.ZodNativeEnum<
30
+ typeof TranscriptionStreamTextDeltaType
31
+ > = z.nativeEnum(TranscriptionStreamTextDeltaType);
32
+
33
+ /** @internal */
34
+ export const TranscriptionStreamTextDeltaType$outboundSchema: z.ZodNativeEnum<
35
+ typeof TranscriptionStreamTextDeltaType
36
+ > = TranscriptionStreamTextDeltaType$inboundSchema;
37
+
38
+ /**
39
+ * @internal
40
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
41
+ */
42
+ export namespace TranscriptionStreamTextDeltaType$ {
43
+ /** @deprecated use `TranscriptionStreamTextDeltaType$inboundSchema` instead. */
44
+ export const inboundSchema = TranscriptionStreamTextDeltaType$inboundSchema;
45
+ /** @deprecated use `TranscriptionStreamTextDeltaType$outboundSchema` instead. */
46
+ export const outboundSchema = TranscriptionStreamTextDeltaType$outboundSchema;
47
+ }
48
+
49
+ /** @internal */
50
+ export const TranscriptionStreamTextDelta$inboundSchema: z.ZodType<
51
+ TranscriptionStreamTextDelta,
52
+ z.ZodTypeDef,
53
+ unknown
54
+ > = collectExtraKeys$(
55
+ z.object({
56
+ text: z.string(),
57
+ type: TranscriptionStreamTextDeltaType$inboundSchema.default(
58
+ "transcription.text.delta",
59
+ ),
60
+ }).catchall(z.any()),
61
+ "additionalProperties",
62
+ true,
63
+ );
64
+
65
+ /** @internal */
66
+ export type TranscriptionStreamTextDelta$Outbound = {
67
+ text: string;
68
+ type: string;
69
+ [additionalProperties: string]: unknown;
70
+ };
71
+
72
+ /** @internal */
73
+ export const TranscriptionStreamTextDelta$outboundSchema: z.ZodType<
74
+ TranscriptionStreamTextDelta$Outbound,
75
+ z.ZodTypeDef,
76
+ TranscriptionStreamTextDelta
77
+ > = z.object({
78
+ text: z.string(),
79
+ type: TranscriptionStreamTextDeltaType$outboundSchema.default(
80
+ "transcription.text.delta",
81
+ ),
82
+ additionalProperties: z.record(z.any()),
83
+ }).transform((v) => {
84
+ return {
85
+ ...v.additionalProperties,
86
+ ...remap$(v, {
87
+ additionalProperties: null,
88
+ }),
89
+ };
90
+ });
91
+
92
+ /**
93
+ * @internal
94
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
95
+ */
96
+ export namespace TranscriptionStreamTextDelta$ {
97
+ /** @deprecated use `TranscriptionStreamTextDelta$inboundSchema` instead. */
98
+ export const inboundSchema = TranscriptionStreamTextDelta$inboundSchema;
99
+ /** @deprecated use `TranscriptionStreamTextDelta$outboundSchema` instead. */
100
+ export const outboundSchema = TranscriptionStreamTextDelta$outboundSchema;
101
+ /** @deprecated use `TranscriptionStreamTextDelta$Outbound` instead. */
102
+ export type Outbound = TranscriptionStreamTextDelta$Outbound;
103
+ }
104
+
105
+ export function transcriptionStreamTextDeltaToJSON(
106
+ transcriptionStreamTextDelta: TranscriptionStreamTextDelta,
107
+ ): string {
108
+ return JSON.stringify(
109
+ TranscriptionStreamTextDelta$outboundSchema.parse(
110
+ transcriptionStreamTextDelta,
111
+ ),
112
+ );
113
+ }
114
+
115
+ export function transcriptionStreamTextDeltaFromJSON(
116
+ jsonString: string,
117
+ ): SafeParseResult<TranscriptionStreamTextDelta, SDKValidationError> {
118
+ return safeParse(
119
+ jsonString,
120
+ (x) => TranscriptionStreamTextDelta$inboundSchema.parse(JSON.parse(x)),
121
+ `Failed to parse 'TranscriptionStreamTextDelta' from JSON`,
122
+ );
123
+ }