@openrouter/sdk 0.0.1 → 0.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/FUNCTIONS.md +1 -109
- package/REACT_QUERY.md +4 -121
- package/esm/funcs/embeddingsGenerate.d.ts +18 -0
- package/esm/funcs/embeddingsGenerate.js +97 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/chaterror.d.ts +4 -4
- package/esm/models/chaterror.js +4 -4
- package/esm/models/chatgenerationparams.d.ts +4 -2
- package/esm/models/chatgenerationparams.js +4 -2
- package/esm/models/chatmessagecontentitemaudio.d.ts +15 -15
- package/esm/models/chatmessagecontentitemaudio.js +15 -16
- package/esm/models/completioncreateparams.d.ts +4 -2
- package/esm/models/completioncreateparams.js +4 -2
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/openairesponsesinputunion.d.ts +21 -0
- package/esm/models/openairesponsesinputunion.js +31 -0
- package/esm/models/openairesponsesprompt.d.ts +4 -28
- package/esm/models/openairesponsesprompt.js +16 -36
- package/esm/models/openresponseseasyinputmessage.d.ts +13 -0
- package/esm/models/openresponseseasyinputmessage.js +19 -0
- package/esm/models/openresponsesinputmessageitem.d.ts +9 -0
- package/esm/models/openresponsesinputmessageitem.js +13 -0
- package/esm/models/operations/createembeddings.d.ts +582 -0
- package/esm/models/operations/createembeddings.js +608 -0
- package/esm/models/operations/getgeneration.d.ts +5 -0
- package/esm/models/operations/getgeneration.js +4 -0
- package/esm/models/operations/getparameters.d.ts +10 -10
- package/esm/models/operations/getparameters.js +14 -14
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/responseinputaudio.d.ts +103 -0
- package/esm/models/responseinputaudio.js +114 -0
- package/esm/react-query/embeddingsGenerate.d.ts +23 -0
- package/esm/react-query/embeddingsGenerate.js +42 -0
- package/esm/react-query/index.d.ts +1 -0
- package/esm/react-query/index.js +1 -0
- package/esm/react-query/parametersGetParameters.d.ts +3 -3
- package/esm/sdk/embeddings.d.ts +12 -0
- package/esm/sdk/embeddings.js +18 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/.devcontainer/README.md +0 -35
- package/examples/README.md +0 -31
package/esm/models/index.d.ts
CHANGED
|
@@ -105,6 +105,7 @@ export * from "./requesttimeoutresponseerrordata.js";
|
|
|
105
105
|
export * from "./responseformatjsonschema.js";
|
|
106
106
|
export * from "./responseformattextconfig.js";
|
|
107
107
|
export * from "./responseformattextgrammar.js";
|
|
108
|
+
export * from "./responseinputaudio.js";
|
|
108
109
|
export * from "./responseinputfile.js";
|
|
109
110
|
export * from "./responseinputimage.js";
|
|
110
111
|
export * from "./responseinputtext.js";
|
package/esm/models/index.js
CHANGED
|
@@ -108,6 +108,7 @@ export * from "./requesttimeoutresponseerrordata.js";
|
|
|
108
108
|
export * from "./responseformatjsonschema.js";
|
|
109
109
|
export * from "./responseformattextconfig.js";
|
|
110
110
|
export * from "./responseformattextgrammar.js";
|
|
111
|
+
export * from "./responseinputaudio.js";
|
|
111
112
|
export * from "./responseinputfile.js";
|
|
112
113
|
export * from "./responseinputimage.js";
|
|
113
114
|
export * from "./responseinputtext.js";
|
|
@@ -4,6 +4,7 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
import { OutputItemImageGenerationCall, OutputItemImageGenerationCall$Outbound } from "./outputitemimagegenerationcall.js";
|
|
6
6
|
import { OutputMessage, OutputMessage$Outbound } from "./outputmessage.js";
|
|
7
|
+
import { ResponseInputAudio, ResponseInputAudio$Outbound } from "./responseinputaudio.js";
|
|
7
8
|
import { ResponseInputFile, ResponseInputFile$Outbound } from "./responseinputfile.js";
|
|
8
9
|
import { ResponseInputImage, ResponseInputImage$Outbound } from "./responseinputimage.js";
|
|
9
10
|
import { ResponseInputText, ResponseInputText$Outbound } from "./responseinputtext.js";
|
|
@@ -52,6 +53,8 @@ export type OpenAIResponsesInputContent3 = (ResponseInputText & {
|
|
|
52
53
|
type: "input_text";
|
|
53
54
|
}) | (ResponseInputImage & {
|
|
54
55
|
type: "input_image";
|
|
56
|
+
}) | (ResponseInputAudio & {
|
|
57
|
+
type: "input_audio";
|
|
55
58
|
}) | (ResponseInputFile & {
|
|
56
59
|
type: "input_file";
|
|
57
60
|
});
|
|
@@ -63,6 +66,8 @@ export type OpenAIResponsesInputMessage2 = {
|
|
|
63
66
|
type: "input_text";
|
|
64
67
|
}) | (ResponseInputImage & {
|
|
65
68
|
type: "input_image";
|
|
69
|
+
}) | (ResponseInputAudio & {
|
|
70
|
+
type: "input_audio";
|
|
66
71
|
}) | (ResponseInputFile & {
|
|
67
72
|
type: "input_file";
|
|
68
73
|
})>;
|
|
@@ -92,6 +97,8 @@ export type OpenAIResponsesInputContent1 = (ResponseInputText & {
|
|
|
92
97
|
type: "input_text";
|
|
93
98
|
}) | (ResponseInputImage & {
|
|
94
99
|
type: "input_image";
|
|
100
|
+
}) | (ResponseInputAudio & {
|
|
101
|
+
type: "input_audio";
|
|
95
102
|
}) | (ResponseInputFile & {
|
|
96
103
|
type: "input_file";
|
|
97
104
|
});
|
|
@@ -99,6 +106,8 @@ export type OpenAIResponsesInputContent2 = Array<(ResponseInputText & {
|
|
|
99
106
|
type: "input_text";
|
|
100
107
|
}) | (ResponseInputImage & {
|
|
101
108
|
type: "input_image";
|
|
109
|
+
}) | (ResponseInputAudio & {
|
|
110
|
+
type: "input_audio";
|
|
102
111
|
}) | (ResponseInputFile & {
|
|
103
112
|
type: "input_file";
|
|
104
113
|
})> | string;
|
|
@@ -109,6 +118,8 @@ export type OpenAIResponsesInputMessage1 = {
|
|
|
109
118
|
type: "input_text";
|
|
110
119
|
}) | (ResponseInputImage & {
|
|
111
120
|
type: "input_image";
|
|
121
|
+
}) | (ResponseInputAudio & {
|
|
122
|
+
type: "input_audio";
|
|
112
123
|
}) | (ResponseInputFile & {
|
|
113
124
|
type: "input_file";
|
|
114
125
|
})> | string;
|
|
@@ -303,6 +314,8 @@ export type OpenAIResponsesInputContent3$Outbound = (ResponseInputText$Outbound
|
|
|
303
314
|
type: "input_text";
|
|
304
315
|
}) | (ResponseInputImage$Outbound & {
|
|
305
316
|
type: "input_image";
|
|
317
|
+
}) | (ResponseInputAudio$Outbound & {
|
|
318
|
+
type: "input_audio";
|
|
306
319
|
}) | (ResponseInputFile$Outbound & {
|
|
307
320
|
type: "input_file";
|
|
308
321
|
});
|
|
@@ -333,6 +346,8 @@ export type OpenAIResponsesInputMessage2$Outbound = {
|
|
|
333
346
|
type: "input_text";
|
|
334
347
|
}) | (ResponseInputImage$Outbound & {
|
|
335
348
|
type: "input_image";
|
|
349
|
+
}) | (ResponseInputAudio$Outbound & {
|
|
350
|
+
type: "input_audio";
|
|
336
351
|
}) | (ResponseInputFile$Outbound & {
|
|
337
352
|
type: "input_file";
|
|
338
353
|
})>;
|
|
@@ -470,6 +485,8 @@ export type OpenAIResponsesInputContent1$Outbound = (ResponseInputText$Outbound
|
|
|
470
485
|
type: "input_text";
|
|
471
486
|
}) | (ResponseInputImage$Outbound & {
|
|
472
487
|
type: "input_image";
|
|
488
|
+
}) | (ResponseInputAudio$Outbound & {
|
|
489
|
+
type: "input_audio";
|
|
473
490
|
}) | (ResponseInputFile$Outbound & {
|
|
474
491
|
type: "input_file";
|
|
475
492
|
});
|
|
@@ -496,6 +513,8 @@ export type OpenAIResponsesInputContent2$Outbound = Array<(ResponseInputText$Out
|
|
|
496
513
|
type: "input_text";
|
|
497
514
|
}) | (ResponseInputImage$Outbound & {
|
|
498
515
|
type: "input_image";
|
|
516
|
+
}) | (ResponseInputAudio$Outbound & {
|
|
517
|
+
type: "input_audio";
|
|
499
518
|
}) | (ResponseInputFile$Outbound & {
|
|
500
519
|
type: "input_file";
|
|
501
520
|
})> | string;
|
|
@@ -525,6 +544,8 @@ export type OpenAIResponsesInputMessage1$Outbound = {
|
|
|
525
544
|
type: "input_text";
|
|
526
545
|
}) | (ResponseInputImage$Outbound & {
|
|
527
546
|
type: "input_image";
|
|
547
|
+
}) | (ResponseInputAudio$Outbound & {
|
|
548
|
+
type: "input_audio";
|
|
528
549
|
}) | (ResponseInputFile$Outbound & {
|
|
529
550
|
type: "input_file";
|
|
530
551
|
})> | string;
|
|
@@ -6,6 +6,7 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { OutputItemImageGenerationCall$inboundSchema, OutputItemImageGenerationCall$outboundSchema, } from "./outputitemimagegenerationcall.js";
|
|
8
8
|
import { OutputMessage$inboundSchema, OutputMessage$outboundSchema, } from "./outputmessage.js";
|
|
9
|
+
import { ResponseInputAudio$inboundSchema, ResponseInputAudio$outboundSchema, } from "./responseinputaudio.js";
|
|
9
10
|
import { ResponseInputFile$inboundSchema, ResponseInputFile$outboundSchema, } from "./responseinputfile.js";
|
|
10
11
|
import { ResponseInputImage$inboundSchema, ResponseInputImage$outboundSchema, } from "./responseinputimage.js";
|
|
11
12
|
import { ResponseInputText$inboundSchema, ResponseInputText$outboundSchema, } from "./responseinputtext.js";
|
|
@@ -254,6 +255,9 @@ export const OpenAIResponsesInputContent3$inboundSchema = z.union([
|
|
|
254
255
|
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
255
256
|
type: v.type,
|
|
256
257
|
}))),
|
|
258
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
259
|
+
type: v.type,
|
|
260
|
+
}))),
|
|
257
261
|
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
258
262
|
type: v.type,
|
|
259
263
|
}))),
|
|
@@ -266,6 +270,9 @@ export const OpenAIResponsesInputContent3$outboundSchema = z.union([
|
|
|
266
270
|
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
267
271
|
type: v.type,
|
|
268
272
|
}))),
|
|
273
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
274
|
+
type: v.type,
|
|
275
|
+
}))),
|
|
269
276
|
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
270
277
|
type: v.type,
|
|
271
278
|
}))),
|
|
@@ -303,6 +310,9 @@ export const OpenAIResponsesInputMessage2$inboundSchema = z.object({
|
|
|
303
310
|
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
304
311
|
type: v.type,
|
|
305
312
|
}))),
|
|
313
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
314
|
+
type: v.type,
|
|
315
|
+
}))),
|
|
306
316
|
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
307
317
|
type: v.type,
|
|
308
318
|
}))),
|
|
@@ -324,6 +334,9 @@ export const OpenAIResponsesInputMessage2$outboundSchema = z.object({
|
|
|
324
334
|
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
325
335
|
type: v.type,
|
|
326
336
|
}))),
|
|
337
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
338
|
+
type: v.type,
|
|
339
|
+
}))),
|
|
327
340
|
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
328
341
|
type: v.type,
|
|
329
342
|
}))),
|
|
@@ -460,6 +473,9 @@ export const OpenAIResponsesInputContent1$inboundSchema = z.union([
|
|
|
460
473
|
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
461
474
|
type: v.type,
|
|
462
475
|
}))),
|
|
476
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
477
|
+
type: v.type,
|
|
478
|
+
}))),
|
|
463
479
|
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
464
480
|
type: v.type,
|
|
465
481
|
}))),
|
|
@@ -472,6 +488,9 @@ export const OpenAIResponsesInputContent1$outboundSchema = z.union([
|
|
|
472
488
|
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
473
489
|
type: v.type,
|
|
474
490
|
}))),
|
|
491
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
492
|
+
type: v.type,
|
|
493
|
+
}))),
|
|
475
494
|
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
476
495
|
type: v.type,
|
|
477
496
|
}))),
|
|
@@ -502,6 +521,9 @@ export const OpenAIResponsesInputContent2$inboundSchema = z.union([
|
|
|
502
521
|
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
503
522
|
type: v.type,
|
|
504
523
|
}))),
|
|
524
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
525
|
+
type: v.type,
|
|
526
|
+
}))),
|
|
505
527
|
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
506
528
|
type: v.type,
|
|
507
529
|
}))),
|
|
@@ -517,6 +539,9 @@ export const OpenAIResponsesInputContent2$outboundSchema = z.union([
|
|
|
517
539
|
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
518
540
|
type: v.type,
|
|
519
541
|
}))),
|
|
542
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
543
|
+
type: v.type,
|
|
544
|
+
}))),
|
|
520
545
|
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
521
546
|
type: v.type,
|
|
522
547
|
}))),
|
|
@@ -557,6 +582,9 @@ export const OpenAIResponsesInputMessage1$inboundSchema = z.object({
|
|
|
557
582
|
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
558
583
|
type: v.type,
|
|
559
584
|
}))),
|
|
585
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
586
|
+
type: v.type,
|
|
587
|
+
}))),
|
|
560
588
|
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
561
589
|
type: v.type,
|
|
562
590
|
}))),
|
|
@@ -581,6 +609,9 @@ export const OpenAIResponsesInputMessage1$outboundSchema = z.object({
|
|
|
581
609
|
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
582
610
|
type: v.type,
|
|
583
611
|
}))),
|
|
612
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
613
|
+
type: v.type,
|
|
614
|
+
}))),
|
|
584
615
|
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
585
616
|
type: v.type,
|
|
586
617
|
}))),
|
|
@@ -4,35 +4,17 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
4
4
|
import { ResponseInputFile, ResponseInputFile$Outbound } from "./responseinputfile.js";
|
|
5
5
|
import { ResponseInputImage, ResponseInputImage$Outbound } from "./responseinputimage.js";
|
|
6
6
|
import { ResponseInputText, ResponseInputText$Outbound } from "./responseinputtext.js";
|
|
7
|
-
export type Variables =
|
|
8
|
-
type: "input_text";
|
|
9
|
-
}) | (ResponseInputImage & {
|
|
10
|
-
type: "input_image";
|
|
11
|
-
}) | (ResponseInputFile & {
|
|
12
|
-
type: "input_file";
|
|
13
|
-
});
|
|
7
|
+
export type Variables = ResponseInputText | ResponseInputImage | ResponseInputFile | string;
|
|
14
8
|
export type OpenAIResponsesPrompt = {
|
|
15
9
|
id: string;
|
|
16
10
|
variables?: {
|
|
17
|
-
[k: string]:
|
|
18
|
-
type: "input_text";
|
|
19
|
-
}) | (ResponseInputImage & {
|
|
20
|
-
type: "input_image";
|
|
21
|
-
}) | (ResponseInputFile & {
|
|
22
|
-
type: "input_file";
|
|
23
|
-
});
|
|
11
|
+
[k: string]: ResponseInputText | ResponseInputImage | ResponseInputFile | string;
|
|
24
12
|
} | null | undefined;
|
|
25
13
|
};
|
|
26
14
|
/** @internal */
|
|
27
15
|
export declare const Variables$inboundSchema: z.ZodType<Variables, unknown>;
|
|
28
16
|
/** @internal */
|
|
29
|
-
export type Variables$Outbound =
|
|
30
|
-
type: "input_text";
|
|
31
|
-
}) | (ResponseInputImage$Outbound & {
|
|
32
|
-
type: "input_image";
|
|
33
|
-
}) | (ResponseInputFile$Outbound & {
|
|
34
|
-
type: "input_file";
|
|
35
|
-
});
|
|
17
|
+
export type Variables$Outbound = ResponseInputText$Outbound | ResponseInputImage$Outbound | ResponseInputFile$Outbound | string;
|
|
36
18
|
/** @internal */
|
|
37
19
|
export declare const Variables$outboundSchema: z.ZodType<Variables$Outbound, Variables>;
|
|
38
20
|
/**
|
|
@@ -55,13 +37,7 @@ export declare const OpenAIResponsesPrompt$inboundSchema: z.ZodType<OpenAIRespon
|
|
|
55
37
|
export type OpenAIResponsesPrompt$Outbound = {
|
|
56
38
|
id: string;
|
|
57
39
|
variables?: {
|
|
58
|
-
[k: string]:
|
|
59
|
-
type: "input_text";
|
|
60
|
-
}) | (ResponseInputImage$Outbound & {
|
|
61
|
-
type: "input_image";
|
|
62
|
-
}) | (ResponseInputFile$Outbound & {
|
|
63
|
-
type: "input_file";
|
|
64
|
-
});
|
|
40
|
+
[k: string]: ResponseInputText$Outbound | ResponseInputImage$Outbound | ResponseInputFile$Outbound | string;
|
|
65
41
|
} | null | undefined;
|
|
66
42
|
};
|
|
67
43
|
/** @internal */
|
|
@@ -8,27 +8,17 @@ import { ResponseInputImage$inboundSchema, ResponseInputImage$outboundSchema, }
|
|
|
8
8
|
import { ResponseInputText$inboundSchema, ResponseInputText$outboundSchema, } from "./responseinputtext.js";
|
|
9
9
|
/** @internal */
|
|
10
10
|
export const Variables$inboundSchema = z.union([
|
|
11
|
-
ResponseInputText$inboundSchema
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
type: v.type,
|
|
16
|
-
}))),
|
|
17
|
-
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
18
|
-
type: v.type,
|
|
19
|
-
}))),
|
|
11
|
+
ResponseInputText$inboundSchema,
|
|
12
|
+
ResponseInputImage$inboundSchema,
|
|
13
|
+
ResponseInputFile$inboundSchema,
|
|
14
|
+
z.string(),
|
|
20
15
|
]);
|
|
21
16
|
/** @internal */
|
|
22
17
|
export const Variables$outboundSchema = z.union([
|
|
23
|
-
ResponseInputText$outboundSchema
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
type: v.type,
|
|
28
|
-
}))),
|
|
29
|
-
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
30
|
-
type: v.type,
|
|
31
|
-
}))),
|
|
18
|
+
ResponseInputText$outboundSchema,
|
|
19
|
+
ResponseInputImage$outboundSchema,
|
|
20
|
+
ResponseInputFile$outboundSchema,
|
|
21
|
+
z.string(),
|
|
32
22
|
]);
|
|
33
23
|
/**
|
|
34
24
|
* @internal
|
|
@@ -51,30 +41,20 @@ export function variablesFromJSON(jsonString) {
|
|
|
51
41
|
export const OpenAIResponsesPrompt$inboundSchema = z.object({
|
|
52
42
|
id: z.string(),
|
|
53
43
|
variables: z.nullable(z.record(z.string(), z.union([
|
|
54
|
-
ResponseInputText$inboundSchema
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
type: v.type,
|
|
59
|
-
}))),
|
|
60
|
-
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
61
|
-
type: v.type,
|
|
62
|
-
}))),
|
|
44
|
+
ResponseInputText$inboundSchema,
|
|
45
|
+
ResponseInputImage$inboundSchema,
|
|
46
|
+
ResponseInputFile$inboundSchema,
|
|
47
|
+
z.string(),
|
|
63
48
|
]))).optional(),
|
|
64
49
|
});
|
|
65
50
|
/** @internal */
|
|
66
51
|
export const OpenAIResponsesPrompt$outboundSchema = z.object({
|
|
67
52
|
id: z.string(),
|
|
68
53
|
variables: z.nullable(z.record(z.string(), z.union([
|
|
69
|
-
ResponseInputText$outboundSchema
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
type: v.type,
|
|
74
|
-
}))),
|
|
75
|
-
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
76
|
-
type: v.type,
|
|
77
|
-
}))),
|
|
54
|
+
ResponseInputText$outboundSchema,
|
|
55
|
+
ResponseInputImage$outboundSchema,
|
|
56
|
+
ResponseInputFile$outboundSchema,
|
|
57
|
+
z.string(),
|
|
78
58
|
]))).optional(),
|
|
79
59
|
});
|
|
80
60
|
/**
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { ClosedEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ResponseInputAudio, ResponseInputAudio$Outbound } from "./responseinputaudio.js";
|
|
5
6
|
import { ResponseInputFile, ResponseInputFile$Outbound } from "./responseinputfile.js";
|
|
6
7
|
import { ResponseInputImage, ResponseInputImage$Outbound } from "./responseinputimage.js";
|
|
7
8
|
import { ResponseInputText, ResponseInputText$Outbound } from "./responseinputtext.js";
|
|
@@ -30,6 +31,8 @@ export type OpenResponsesEasyInputMessageContent1 = (ResponseInputText & {
|
|
|
30
31
|
type: "input_text";
|
|
31
32
|
}) | (ResponseInputImage & {
|
|
32
33
|
type: "input_image";
|
|
34
|
+
}) | (ResponseInputAudio & {
|
|
35
|
+
type: "input_audio";
|
|
33
36
|
}) | (ResponseInputFile & {
|
|
34
37
|
type: "input_file";
|
|
35
38
|
});
|
|
@@ -37,6 +40,8 @@ export type OpenResponsesEasyInputMessageContent2 = Array<(ResponseInputText & {
|
|
|
37
40
|
type: "input_text";
|
|
38
41
|
}) | (ResponseInputImage & {
|
|
39
42
|
type: "input_image";
|
|
43
|
+
}) | (ResponseInputAudio & {
|
|
44
|
+
type: "input_audio";
|
|
40
45
|
}) | (ResponseInputFile & {
|
|
41
46
|
type: "input_file";
|
|
42
47
|
})> | string;
|
|
@@ -47,6 +52,8 @@ export type OpenResponsesEasyInputMessage = {
|
|
|
47
52
|
type: "input_text";
|
|
48
53
|
}) | (ResponseInputImage & {
|
|
49
54
|
type: "input_image";
|
|
55
|
+
}) | (ResponseInputAudio & {
|
|
56
|
+
type: "input_audio";
|
|
50
57
|
}) | (ResponseInputFile & {
|
|
51
58
|
type: "input_file";
|
|
52
59
|
})> | string;
|
|
@@ -168,6 +175,8 @@ export type OpenResponsesEasyInputMessageContent1$Outbound = (ResponseInputText$
|
|
|
168
175
|
type: "input_text";
|
|
169
176
|
}) | (ResponseInputImage$Outbound & {
|
|
170
177
|
type: "input_image";
|
|
178
|
+
}) | (ResponseInputAudio$Outbound & {
|
|
179
|
+
type: "input_audio";
|
|
171
180
|
}) | (ResponseInputFile$Outbound & {
|
|
172
181
|
type: "input_file";
|
|
173
182
|
});
|
|
@@ -194,6 +203,8 @@ export type OpenResponsesEasyInputMessageContent2$Outbound = Array<(ResponseInpu
|
|
|
194
203
|
type: "input_text";
|
|
195
204
|
}) | (ResponseInputImage$Outbound & {
|
|
196
205
|
type: "input_image";
|
|
206
|
+
}) | (ResponseInputAudio$Outbound & {
|
|
207
|
+
type: "input_audio";
|
|
197
208
|
}) | (ResponseInputFile$Outbound & {
|
|
198
209
|
type: "input_file";
|
|
199
210
|
})> | string;
|
|
@@ -223,6 +234,8 @@ export type OpenResponsesEasyInputMessage$Outbound = {
|
|
|
223
234
|
type: "input_text";
|
|
224
235
|
}) | (ResponseInputImage$Outbound & {
|
|
225
236
|
type: "input_image";
|
|
237
|
+
}) | (ResponseInputAudio$Outbound & {
|
|
238
|
+
type: "input_audio";
|
|
226
239
|
}) | (ResponseInputFile$Outbound & {
|
|
227
240
|
type: "input_file";
|
|
228
241
|
})> | string;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import { ResponseInputAudio$inboundSchema, ResponseInputAudio$outboundSchema, } from "./responseinputaudio.js";
|
|
6
7
|
import { ResponseInputFile$inboundSchema, ResponseInputFile$outboundSchema, } from "./responseinputfile.js";
|
|
7
8
|
import { ResponseInputImage$inboundSchema, ResponseInputImage$outboundSchema, } from "./responseinputimage.js";
|
|
8
9
|
import { ResponseInputText$inboundSchema, ResponseInputText$outboundSchema, } from "./responseinputtext.js";
|
|
@@ -135,6 +136,9 @@ export const OpenResponsesEasyInputMessageContent1$inboundSchema = z.union([
|
|
|
135
136
|
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
136
137
|
type: v.type,
|
|
137
138
|
}))),
|
|
139
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
140
|
+
type: v.type,
|
|
141
|
+
}))),
|
|
138
142
|
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
139
143
|
type: v.type,
|
|
140
144
|
}))),
|
|
@@ -147,6 +151,9 @@ export const OpenResponsesEasyInputMessageContent1$outboundSchema = z.union([
|
|
|
147
151
|
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
148
152
|
type: v.type,
|
|
149
153
|
}))),
|
|
154
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
155
|
+
type: v.type,
|
|
156
|
+
}))),
|
|
150
157
|
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
151
158
|
type: v.type,
|
|
152
159
|
}))),
|
|
@@ -177,6 +184,9 @@ export const OpenResponsesEasyInputMessageContent2$inboundSchema = z.union([
|
|
|
177
184
|
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
178
185
|
type: v.type,
|
|
179
186
|
}))),
|
|
187
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
188
|
+
type: v.type,
|
|
189
|
+
}))),
|
|
180
190
|
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
181
191
|
type: v.type,
|
|
182
192
|
}))),
|
|
@@ -192,6 +202,9 @@ export const OpenResponsesEasyInputMessageContent2$outboundSchema = z.union([
|
|
|
192
202
|
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
193
203
|
type: v.type,
|
|
194
204
|
}))),
|
|
205
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
206
|
+
type: v.type,
|
|
207
|
+
}))),
|
|
195
208
|
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
196
209
|
type: v.type,
|
|
197
210
|
}))),
|
|
@@ -232,6 +245,9 @@ export const OpenResponsesEasyInputMessage$inboundSchema = z.object({
|
|
|
232
245
|
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
233
246
|
type: v.type,
|
|
234
247
|
}))),
|
|
248
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
249
|
+
type: v.type,
|
|
250
|
+
}))),
|
|
235
251
|
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
236
252
|
type: v.type,
|
|
237
253
|
}))),
|
|
@@ -256,6 +272,9 @@ export const OpenResponsesEasyInputMessage$outboundSchema = z.object({
|
|
|
256
272
|
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
257
273
|
type: v.type,
|
|
258
274
|
}))),
|
|
275
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
276
|
+
type: v.type,
|
|
277
|
+
}))),
|
|
259
278
|
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
260
279
|
type: v.type,
|
|
261
280
|
}))),
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { ClosedEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ResponseInputAudio, ResponseInputAudio$Outbound } from "./responseinputaudio.js";
|
|
5
6
|
import { ResponseInputFile, ResponseInputFile$Outbound } from "./responseinputfile.js";
|
|
6
7
|
import { ResponseInputImage, ResponseInputImage$Outbound } from "./responseinputimage.js";
|
|
7
8
|
import { ResponseInputText, ResponseInputText$Outbound } from "./responseinputtext.js";
|
|
@@ -26,6 +27,8 @@ export type OpenResponsesInputMessageItemContent = (ResponseInputText & {
|
|
|
26
27
|
type: "input_text";
|
|
27
28
|
}) | (ResponseInputImage & {
|
|
28
29
|
type: "input_image";
|
|
30
|
+
}) | (ResponseInputAudio & {
|
|
31
|
+
type: "input_audio";
|
|
29
32
|
}) | (ResponseInputFile & {
|
|
30
33
|
type: "input_file";
|
|
31
34
|
});
|
|
@@ -37,6 +40,8 @@ export type OpenResponsesInputMessageItem = {
|
|
|
37
40
|
type: "input_text";
|
|
38
41
|
}) | (ResponseInputImage & {
|
|
39
42
|
type: "input_image";
|
|
43
|
+
}) | (ResponseInputAudio & {
|
|
44
|
+
type: "input_audio";
|
|
40
45
|
}) | (ResponseInputFile & {
|
|
41
46
|
type: "input_file";
|
|
42
47
|
})>;
|
|
@@ -140,6 +145,8 @@ export type OpenResponsesInputMessageItemContent$Outbound = (ResponseInputText$O
|
|
|
140
145
|
type: "input_text";
|
|
141
146
|
}) | (ResponseInputImage$Outbound & {
|
|
142
147
|
type: "input_image";
|
|
148
|
+
}) | (ResponseInputAudio$Outbound & {
|
|
149
|
+
type: "input_audio";
|
|
143
150
|
}) | (ResponseInputFile$Outbound & {
|
|
144
151
|
type: "input_file";
|
|
145
152
|
});
|
|
@@ -170,6 +177,8 @@ export type OpenResponsesInputMessageItem$Outbound = {
|
|
|
170
177
|
type: "input_text";
|
|
171
178
|
}) | (ResponseInputImage$Outbound & {
|
|
172
179
|
type: "input_image";
|
|
180
|
+
}) | (ResponseInputAudio$Outbound & {
|
|
181
|
+
type: "input_audio";
|
|
173
182
|
}) | (ResponseInputFile$Outbound & {
|
|
174
183
|
type: "input_file";
|
|
175
184
|
})>;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import { ResponseInputAudio$inboundSchema, ResponseInputAudio$outboundSchema, } from "./responseinputaudio.js";
|
|
6
7
|
import { ResponseInputFile$inboundSchema, ResponseInputFile$outboundSchema, } from "./responseinputfile.js";
|
|
7
8
|
import { ResponseInputImage$inboundSchema, ResponseInputImage$outboundSchema, } from "./responseinputimage.js";
|
|
8
9
|
import { ResponseInputText$inboundSchema, ResponseInputText$outboundSchema, } from "./responseinputtext.js";
|
|
@@ -115,6 +116,9 @@ export const OpenResponsesInputMessageItemContent$inboundSchema = z.union([
|
|
|
115
116
|
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
116
117
|
type: v.type,
|
|
117
118
|
}))),
|
|
119
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
120
|
+
type: v.type,
|
|
121
|
+
}))),
|
|
118
122
|
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
119
123
|
type: v.type,
|
|
120
124
|
}))),
|
|
@@ -127,6 +131,9 @@ export const OpenResponsesInputMessageItemContent$outboundSchema = z.union([
|
|
|
127
131
|
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
128
132
|
type: v.type,
|
|
129
133
|
}))),
|
|
134
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
135
|
+
type: v.type,
|
|
136
|
+
}))),
|
|
130
137
|
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
131
138
|
type: v.type,
|
|
132
139
|
}))),
|
|
@@ -164,6 +171,9 @@ export const OpenResponsesInputMessageItem$inboundSchema = z.object({
|
|
|
164
171
|
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
165
172
|
type: v.type,
|
|
166
173
|
}))),
|
|
174
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
175
|
+
type: v.type,
|
|
176
|
+
}))),
|
|
167
177
|
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
168
178
|
type: v.type,
|
|
169
179
|
}))),
|
|
@@ -185,6 +195,9 @@ export const OpenResponsesInputMessageItem$outboundSchema = z.object({
|
|
|
185
195
|
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") }).transform((v) => ({
|
|
186
196
|
type: v.type,
|
|
187
197
|
}))),
|
|
198
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
199
|
+
type: v.type,
|
|
200
|
+
}))),
|
|
188
201
|
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
189
202
|
type: v.type,
|
|
190
203
|
}))),
|