@openrouter/sdk 0.2.6 → 0.2.11
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/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/response-wrapper.d.ts +12 -0
- package/esm/lib/response-wrapper.js +45 -15
- package/esm/lib/tool-orchestrator.js +33 -11
- package/esm/models/chatgenerationparams.d.ts +256 -2
- package/esm/models/chatgenerationparams.js +175 -1
- package/esm/models/chatmessagecontentitemaudio.d.ts +1 -16
- package/esm/models/chatmessagecontentitemaudio.js +2 -16
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/openairesponsesreasoningeffort.d.ts +1 -0
- package/esm/models/openairesponsesreasoningeffort.js +1 -0
- package/esm/models/openresponsesrequest.d.ts +111 -63
- package/esm/models/openresponsesrequest.js +70 -53
- package/esm/models/operations/createembeddings.d.ts +25 -15
- package/esm/models/operations/createembeddings.js +9 -5
- package/esm/models/operations/getparameters.d.ts +3 -0
- package/esm/models/operations/getparameters.js +3 -0
- package/esm/models/providername.d.ts +3 -0
- package/esm/models/providername.js +3 -0
- package/esm/models/publicendpoint.d.ts +24 -24
- package/esm/models/publicendpoint.js +12 -12
- package/esm/models/publicpricing.d.ts +24 -24
- package/esm/models/publicpricing.js +12 -12
- package/esm/models/schema0.d.ts +83 -0
- package/esm/models/schema0.js +85 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
|
@@ -9,15 +9,167 @@ import { Message$outboundSchema, } from "./message.js";
|
|
|
9
9
|
import { ReasoningSummaryVerbosity$outboundSchema, } from "./reasoningsummaryverbosity.js";
|
|
10
10
|
import { ResponseFormatJSONSchema$outboundSchema, } from "./responseformatjsonschema.js";
|
|
11
11
|
import { ResponseFormatTextGrammar$outboundSchema, } from "./responseformattextgrammar.js";
|
|
12
|
+
import { Schema0$outboundSchema, } from "./schema0.js";
|
|
12
13
|
import { ToolDefinitionJson$outboundSchema, } from "./tooldefinitionjson.js";
|
|
14
|
+
export const ChatGenerationParamsDataCollection = {
|
|
15
|
+
Deny: "deny",
|
|
16
|
+
Allow: "allow",
|
|
17
|
+
};
|
|
18
|
+
export const Quantizations = {
|
|
19
|
+
Int4: "int4",
|
|
20
|
+
Int8: "int8",
|
|
21
|
+
Fp4: "fp4",
|
|
22
|
+
Fp6: "fp6",
|
|
23
|
+
Fp8: "fp8",
|
|
24
|
+
Fp16: "fp16",
|
|
25
|
+
Bf16: "bf16",
|
|
26
|
+
Fp32: "fp32",
|
|
27
|
+
Unknown: "unknown",
|
|
28
|
+
};
|
|
29
|
+
export const Sort = {
|
|
30
|
+
Price: "price",
|
|
31
|
+
Throughput: "throughput",
|
|
32
|
+
Latency: "latency",
|
|
33
|
+
};
|
|
34
|
+
export const ChatGenerationParamsPdfEngine = {
|
|
35
|
+
MistralOcr: "mistral-ocr",
|
|
36
|
+
PdfText: "pdf-text",
|
|
37
|
+
Native: "native",
|
|
38
|
+
};
|
|
39
|
+
export const ChatGenerationParamsEngine = {
|
|
40
|
+
Native: "native",
|
|
41
|
+
Exa: "exa",
|
|
42
|
+
};
|
|
43
|
+
export const ChatGenerationParamsRoute = {
|
|
44
|
+
Fallback: "fallback",
|
|
45
|
+
Sort: "sort",
|
|
46
|
+
};
|
|
13
47
|
export const Effort = {
|
|
14
48
|
None: "none",
|
|
15
49
|
Minimal: "minimal",
|
|
16
50
|
Low: "low",
|
|
17
51
|
Medium: "medium",
|
|
18
52
|
High: "high",
|
|
53
|
+
Xhigh: "xhigh",
|
|
19
54
|
};
|
|
20
55
|
/** @internal */
|
|
56
|
+
export const ChatGenerationParamsDataCollection$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsDataCollection);
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const Quantizations$outboundSchema = openEnums.outboundSchema(Quantizations);
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const Sort$outboundSchema = openEnums
|
|
61
|
+
.outboundSchema(Sort);
|
|
62
|
+
/** @internal */
|
|
63
|
+
export const ChatGenerationParamsMaxPrice$outboundSchema = z.object({
|
|
64
|
+
prompt: z.any().optional(),
|
|
65
|
+
completion: z.any().optional(),
|
|
66
|
+
image: z.any().optional(),
|
|
67
|
+
audio: z.any().optional(),
|
|
68
|
+
request: z.any().optional(),
|
|
69
|
+
});
|
|
70
|
+
export function chatGenerationParamsMaxPriceToJSON(chatGenerationParamsMaxPrice) {
|
|
71
|
+
return JSON.stringify(ChatGenerationParamsMaxPrice$outboundSchema.parse(chatGenerationParamsMaxPrice));
|
|
72
|
+
}
|
|
73
|
+
/** @internal */
|
|
74
|
+
export const ChatGenerationParamsProvider$outboundSchema = z.object({
|
|
75
|
+
allowFallbacks: z.nullable(z.boolean()).optional(),
|
|
76
|
+
requireParameters: z.nullable(z.boolean()).optional(),
|
|
77
|
+
dataCollection: z.nullable(ChatGenerationParamsDataCollection$outboundSchema)
|
|
78
|
+
.optional(),
|
|
79
|
+
zdr: z.nullable(z.boolean()).optional(),
|
|
80
|
+
enforceDistillableText: z.nullable(z.boolean()).optional(),
|
|
81
|
+
order: z.nullable(z.array(Schema0$outboundSchema)).optional(),
|
|
82
|
+
only: z.nullable(z.array(Schema0$outboundSchema)).optional(),
|
|
83
|
+
ignore: z.nullable(z.array(Schema0$outboundSchema)).optional(),
|
|
84
|
+
quantizations: z.nullable(z.array(Quantizations$outboundSchema)).optional(),
|
|
85
|
+
sort: z.nullable(Sort$outboundSchema).optional(),
|
|
86
|
+
maxPrice: z.lazy(() => ChatGenerationParamsMaxPrice$outboundSchema)
|
|
87
|
+
.optional(),
|
|
88
|
+
minThroughput: z.nullable(z.number()).optional(),
|
|
89
|
+
maxLatency: z.nullable(z.number()).optional(),
|
|
90
|
+
}).transform((v) => {
|
|
91
|
+
return remap$(v, {
|
|
92
|
+
allowFallbacks: "allow_fallbacks",
|
|
93
|
+
requireParameters: "require_parameters",
|
|
94
|
+
dataCollection: "data_collection",
|
|
95
|
+
enforceDistillableText: "enforce_distillable_text",
|
|
96
|
+
maxPrice: "max_price",
|
|
97
|
+
minThroughput: "min_throughput",
|
|
98
|
+
maxLatency: "max_latency",
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
export function chatGenerationParamsProviderToJSON(chatGenerationParamsProvider) {
|
|
102
|
+
return JSON.stringify(ChatGenerationParamsProvider$outboundSchema.parse(chatGenerationParamsProvider));
|
|
103
|
+
}
|
|
104
|
+
/** @internal */
|
|
105
|
+
export const ChatGenerationParamsPluginResponseHealing$outboundSchema = z.object({
|
|
106
|
+
id: z.literal("response-healing"),
|
|
107
|
+
enabled: z.boolean().optional(),
|
|
108
|
+
});
|
|
109
|
+
export function chatGenerationParamsPluginResponseHealingToJSON(chatGenerationParamsPluginResponseHealing) {
|
|
110
|
+
return JSON.stringify(ChatGenerationParamsPluginResponseHealing$outboundSchema.parse(chatGenerationParamsPluginResponseHealing));
|
|
111
|
+
}
|
|
112
|
+
/** @internal */
|
|
113
|
+
export const ChatGenerationParamsPdfEngine$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsPdfEngine);
|
|
114
|
+
/** @internal */
|
|
115
|
+
export const ChatGenerationParamsPdf$outboundSchema = z.object({
|
|
116
|
+
engine: ChatGenerationParamsPdfEngine$outboundSchema.optional(),
|
|
117
|
+
});
|
|
118
|
+
export function chatGenerationParamsPdfToJSON(chatGenerationParamsPdf) {
|
|
119
|
+
return JSON.stringify(ChatGenerationParamsPdf$outboundSchema.parse(chatGenerationParamsPdf));
|
|
120
|
+
}
|
|
121
|
+
/** @internal */
|
|
122
|
+
export const ChatGenerationParamsPluginFileParser$outboundSchema = z.object({
|
|
123
|
+
id: z.literal("file-parser"),
|
|
124
|
+
enabled: z.boolean().optional(),
|
|
125
|
+
maxFiles: z.number().optional(),
|
|
126
|
+
pdf: z.lazy(() => ChatGenerationParamsPdf$outboundSchema).optional(),
|
|
127
|
+
}).transform((v) => {
|
|
128
|
+
return remap$(v, {
|
|
129
|
+
maxFiles: "max_files",
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
export function chatGenerationParamsPluginFileParserToJSON(chatGenerationParamsPluginFileParser) {
|
|
133
|
+
return JSON.stringify(ChatGenerationParamsPluginFileParser$outboundSchema.parse(chatGenerationParamsPluginFileParser));
|
|
134
|
+
}
|
|
135
|
+
/** @internal */
|
|
136
|
+
export const ChatGenerationParamsEngine$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsEngine);
|
|
137
|
+
/** @internal */
|
|
138
|
+
export const ChatGenerationParamsPluginWeb$outboundSchema = z.object({
|
|
139
|
+
id: z.literal("web"),
|
|
140
|
+
enabled: z.boolean().optional(),
|
|
141
|
+
maxResults: z.number().optional(),
|
|
142
|
+
searchPrompt: z.string().optional(),
|
|
143
|
+
engine: ChatGenerationParamsEngine$outboundSchema.optional(),
|
|
144
|
+
}).transform((v) => {
|
|
145
|
+
return remap$(v, {
|
|
146
|
+
maxResults: "max_results",
|
|
147
|
+
searchPrompt: "search_prompt",
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
export function chatGenerationParamsPluginWebToJSON(chatGenerationParamsPluginWeb) {
|
|
151
|
+
return JSON.stringify(ChatGenerationParamsPluginWeb$outboundSchema.parse(chatGenerationParamsPluginWeb));
|
|
152
|
+
}
|
|
153
|
+
/** @internal */
|
|
154
|
+
export const ChatGenerationParamsPluginModeration$outboundSchema = z.object({
|
|
155
|
+
id: z.literal("moderation"),
|
|
156
|
+
});
|
|
157
|
+
export function chatGenerationParamsPluginModerationToJSON(chatGenerationParamsPluginModeration) {
|
|
158
|
+
return JSON.stringify(ChatGenerationParamsPluginModeration$outboundSchema.parse(chatGenerationParamsPluginModeration));
|
|
159
|
+
}
|
|
160
|
+
/** @internal */
|
|
161
|
+
export const ChatGenerationParamsPluginUnion$outboundSchema = z.union([
|
|
162
|
+
z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema),
|
|
163
|
+
z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema),
|
|
164
|
+
z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema),
|
|
165
|
+
z.lazy(() => ChatGenerationParamsPluginResponseHealing$outboundSchema),
|
|
166
|
+
]);
|
|
167
|
+
export function chatGenerationParamsPluginUnionToJSON(chatGenerationParamsPluginUnion) {
|
|
168
|
+
return JSON.stringify(ChatGenerationParamsPluginUnion$outboundSchema.parse(chatGenerationParamsPluginUnion));
|
|
169
|
+
}
|
|
170
|
+
/** @internal */
|
|
171
|
+
export const ChatGenerationParamsRoute$outboundSchema = openEnums.outboundSchema(ChatGenerationParamsRoute);
|
|
172
|
+
/** @internal */
|
|
21
173
|
export const Effort$outboundSchema = openEnums
|
|
22
174
|
.outboundSchema(Effort);
|
|
23
175
|
/** @internal */
|
|
@@ -66,7 +218,28 @@ export function chatGenerationParamsStopToJSON(chatGenerationParamsStop) {
|
|
|
66
218
|
return JSON.stringify(ChatGenerationParamsStop$outboundSchema.parse(chatGenerationParamsStop));
|
|
67
219
|
}
|
|
68
220
|
/** @internal */
|
|
221
|
+
export const Debug$outboundSchema = z.object({
|
|
222
|
+
echoUpstreamBody: z.boolean().optional(),
|
|
223
|
+
}).transform((v) => {
|
|
224
|
+
return remap$(v, {
|
|
225
|
+
echoUpstreamBody: "echo_upstream_body",
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
export function debugToJSON(debug) {
|
|
229
|
+
return JSON.stringify(Debug$outboundSchema.parse(debug));
|
|
230
|
+
}
|
|
231
|
+
/** @internal */
|
|
69
232
|
export const ChatGenerationParams$outboundSchema = z.object({
|
|
233
|
+
provider: z.nullable(z.lazy(() => ChatGenerationParamsProvider$outboundSchema)).optional(),
|
|
234
|
+
plugins: z.array(z.union([
|
|
235
|
+
z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema),
|
|
236
|
+
z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema),
|
|
237
|
+
z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema),
|
|
238
|
+
z.lazy(() => ChatGenerationParamsPluginResponseHealing$outboundSchema),
|
|
239
|
+
])).optional(),
|
|
240
|
+
route: z.nullable(ChatGenerationParamsRoute$outboundSchema).optional(),
|
|
241
|
+
user: z.string().optional(),
|
|
242
|
+
sessionId: z.string().optional(),
|
|
70
243
|
messages: z.array(Message$outboundSchema),
|
|
71
244
|
model: z.string().optional(),
|
|
72
245
|
models: z.array(z.string()).optional(),
|
|
@@ -94,9 +267,10 @@ export const ChatGenerationParams$outboundSchema = z.object({
|
|
|
94
267
|
toolChoice: z.any().optional(),
|
|
95
268
|
tools: z.array(ToolDefinitionJson$outboundSchema).optional(),
|
|
96
269
|
topP: z.nullable(z.number()).optional(),
|
|
97
|
-
|
|
270
|
+
debug: z.lazy(() => Debug$outboundSchema).optional(),
|
|
98
271
|
}).transform((v) => {
|
|
99
272
|
return remap$(v, {
|
|
273
|
+
sessionId: "session_id",
|
|
100
274
|
frequencyPenalty: "frequency_penalty",
|
|
101
275
|
logitBias: "logit_bias",
|
|
102
276
|
topLogprobs: "top_logprobs",
|
|
@@ -1,30 +1,15 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { OpenEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const ChatMessageContentItemAudioFormat: {
|
|
6
|
-
readonly Wav: "wav";
|
|
7
|
-
readonly Mp3: "mp3";
|
|
8
|
-
readonly Flac: "flac";
|
|
9
|
-
readonly M4a: "m4a";
|
|
10
|
-
readonly Ogg: "ogg";
|
|
11
|
-
readonly Pcm16: "pcm16";
|
|
12
|
-
readonly Pcm24: "pcm24";
|
|
13
|
-
};
|
|
14
|
-
export type ChatMessageContentItemAudioFormat = OpenEnum<typeof ChatMessageContentItemAudioFormat>;
|
|
15
4
|
export type ChatMessageContentItemAudioInputAudio = {
|
|
16
5
|
data: string;
|
|
17
|
-
format:
|
|
6
|
+
format: string;
|
|
18
7
|
};
|
|
19
8
|
export type ChatMessageContentItemAudio = {
|
|
20
9
|
type: "input_audio";
|
|
21
10
|
inputAudio: ChatMessageContentItemAudioInputAudio;
|
|
22
11
|
};
|
|
23
12
|
/** @internal */
|
|
24
|
-
export declare const ChatMessageContentItemAudioFormat$inboundSchema: z.ZodType<ChatMessageContentItemAudioFormat, unknown>;
|
|
25
|
-
/** @internal */
|
|
26
|
-
export declare const ChatMessageContentItemAudioFormat$outboundSchema: z.ZodType<string, ChatMessageContentItemAudioFormat>;
|
|
27
|
-
/** @internal */
|
|
28
13
|
export declare const ChatMessageContentItemAudioInputAudio$inboundSchema: z.ZodType<ChatMessageContentItemAudioInputAudio, unknown>;
|
|
29
14
|
/** @internal */
|
|
30
15
|
export type ChatMessageContentItemAudioInputAudio$Outbound = {
|
|
@@ -4,29 +4,15 @@
|
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
import * as openEnums from "../types/enums.js";
|
|
8
|
-
export const ChatMessageContentItemAudioFormat = {
|
|
9
|
-
Wav: "wav",
|
|
10
|
-
Mp3: "mp3",
|
|
11
|
-
Flac: "flac",
|
|
12
|
-
M4a: "m4a",
|
|
13
|
-
Ogg: "ogg",
|
|
14
|
-
Pcm16: "pcm16",
|
|
15
|
-
Pcm24: "pcm24",
|
|
16
|
-
};
|
|
17
|
-
/** @internal */
|
|
18
|
-
export const ChatMessageContentItemAudioFormat$inboundSchema = openEnums.inboundSchema(ChatMessageContentItemAudioFormat);
|
|
19
|
-
/** @internal */
|
|
20
|
-
export const ChatMessageContentItemAudioFormat$outboundSchema = openEnums.outboundSchema(ChatMessageContentItemAudioFormat);
|
|
21
7
|
/** @internal */
|
|
22
8
|
export const ChatMessageContentItemAudioInputAudio$inboundSchema = z.object({
|
|
23
9
|
data: z.string(),
|
|
24
|
-
format:
|
|
10
|
+
format: z.string(),
|
|
25
11
|
});
|
|
26
12
|
/** @internal */
|
|
27
13
|
export const ChatMessageContentItemAudioInputAudio$outboundSchema = z.object({
|
|
28
14
|
data: z.string(),
|
|
29
|
-
format:
|
|
15
|
+
format: z.string(),
|
|
30
16
|
});
|
|
31
17
|
export function chatMessageContentItemAudioInputAudioToJSON(chatMessageContentItemAudioInputAudio) {
|
|
32
18
|
return JSON.stringify(ChatMessageContentItemAudioInputAudio$outboundSchema.parse(chatMessageContentItemAudioInputAudio));
|
package/esm/models/index.d.ts
CHANGED
|
@@ -128,6 +128,7 @@ export * from "./responsessearchcontextsize.js";
|
|
|
128
128
|
export * from "./responseswebsearchcalloutput.js";
|
|
129
129
|
export * from "./responseswebsearchuserlocation.js";
|
|
130
130
|
export * from "./responsetextconfig.js";
|
|
131
|
+
export * from "./schema0.js";
|
|
131
132
|
export * from "./security.js";
|
|
132
133
|
export * from "./serviceunavailableresponseerrordata.js";
|
|
133
134
|
export * from "./systemmessage.js";
|
package/esm/models/index.js
CHANGED
|
@@ -131,6 +131,7 @@ export * from "./responsessearchcontextsize.js";
|
|
|
131
131
|
export * from "./responseswebsearchcalloutput.js";
|
|
132
132
|
export * from "./responseswebsearchuserlocation.js";
|
|
133
133
|
export * from "./responsetextconfig.js";
|
|
134
|
+
export * from "./schema0.js";
|
|
134
135
|
export * from "./security.js";
|
|
135
136
|
export * from "./serviceunavailableresponseerrordata.js";
|
|
136
137
|
export * from "./systemmessage.js";
|
|
@@ -42,32 +42,32 @@ export type Ignore = ProviderName | string;
|
|
|
42
42
|
/**
|
|
43
43
|
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
44
44
|
*/
|
|
45
|
-
export type
|
|
45
|
+
export type OpenResponsesRequestMaxPrice = {
|
|
46
46
|
/**
|
|
47
|
-
* A value in string
|
|
47
|
+
* A value in string format that is a large number
|
|
48
48
|
*/
|
|
49
|
-
prompt?:
|
|
49
|
+
prompt?: string | undefined;
|
|
50
50
|
/**
|
|
51
|
-
* A value in string
|
|
51
|
+
* A value in string format that is a large number
|
|
52
52
|
*/
|
|
53
|
-
completion?:
|
|
53
|
+
completion?: string | undefined;
|
|
54
54
|
/**
|
|
55
|
-
* A value in string
|
|
55
|
+
* A value in string format that is a large number
|
|
56
56
|
*/
|
|
57
|
-
image?:
|
|
57
|
+
image?: string | undefined;
|
|
58
58
|
/**
|
|
59
|
-
* A value in string
|
|
59
|
+
* A value in string format that is a large number
|
|
60
60
|
*/
|
|
61
|
-
audio?:
|
|
61
|
+
audio?: string | undefined;
|
|
62
62
|
/**
|
|
63
|
-
* A value in string
|
|
63
|
+
* A value in string format that is a large number
|
|
64
64
|
*/
|
|
65
|
-
request?:
|
|
65
|
+
request?: string | undefined;
|
|
66
66
|
};
|
|
67
67
|
/**
|
|
68
68
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
69
69
|
*/
|
|
70
|
-
export type
|
|
70
|
+
export type OpenResponsesRequestProvider = {
|
|
71
71
|
/**
|
|
72
72
|
* Whether to allow backup providers to serve requests
|
|
73
73
|
*
|
|
@@ -120,40 +120,71 @@ export type Provider = {
|
|
|
120
120
|
/**
|
|
121
121
|
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
122
122
|
*/
|
|
123
|
-
maxPrice?:
|
|
123
|
+
maxPrice?: OpenResponsesRequestMaxPrice | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used.
|
|
126
|
+
*/
|
|
127
|
+
minThroughput?: number | null | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used.
|
|
130
|
+
*/
|
|
131
|
+
maxLatency?: number | null | undefined;
|
|
124
132
|
};
|
|
125
|
-
export type
|
|
133
|
+
export type OpenResponsesRequestPluginResponseHealing = {
|
|
126
134
|
id: "response-healing";
|
|
135
|
+
/**
|
|
136
|
+
* Set to false to disable the response-healing plugin for this request. Defaults to true.
|
|
137
|
+
*/
|
|
138
|
+
enabled?: boolean | undefined;
|
|
127
139
|
};
|
|
128
|
-
export declare const
|
|
140
|
+
export declare const OpenResponsesRequestPdfEngine: {
|
|
129
141
|
readonly MistralOcr: "mistral-ocr";
|
|
130
142
|
readonly PdfText: "pdf-text";
|
|
131
143
|
readonly Native: "native";
|
|
132
144
|
};
|
|
133
|
-
export type
|
|
134
|
-
export type
|
|
135
|
-
engine?:
|
|
145
|
+
export type OpenResponsesRequestPdfEngine = OpenEnum<typeof OpenResponsesRequestPdfEngine>;
|
|
146
|
+
export type OpenResponsesRequestPdf = {
|
|
147
|
+
engine?: OpenResponsesRequestPdfEngine | undefined;
|
|
136
148
|
};
|
|
137
|
-
export type
|
|
149
|
+
export type OpenResponsesRequestPluginFileParser = {
|
|
138
150
|
id: "file-parser";
|
|
151
|
+
/**
|
|
152
|
+
* Set to false to disable the file-parser plugin for this request. Defaults to true.
|
|
153
|
+
*/
|
|
154
|
+
enabled?: boolean | undefined;
|
|
139
155
|
maxFiles?: number | undefined;
|
|
140
|
-
pdf?:
|
|
156
|
+
pdf?: OpenResponsesRequestPdf | undefined;
|
|
141
157
|
};
|
|
142
|
-
export declare const
|
|
158
|
+
export declare const OpenResponsesRequestEngine: {
|
|
143
159
|
readonly Native: "native";
|
|
144
160
|
readonly Exa: "exa";
|
|
145
161
|
};
|
|
146
|
-
export type
|
|
147
|
-
export type
|
|
162
|
+
export type OpenResponsesRequestEngine = OpenEnum<typeof OpenResponsesRequestEngine>;
|
|
163
|
+
export type OpenResponsesRequestPluginWeb = {
|
|
148
164
|
id: "web";
|
|
165
|
+
/**
|
|
166
|
+
* Set to false to disable the web-search plugin for this request. Defaults to true.
|
|
167
|
+
*/
|
|
168
|
+
enabled?: boolean | undefined;
|
|
149
169
|
maxResults?: number | undefined;
|
|
150
170
|
searchPrompt?: string | undefined;
|
|
151
|
-
engine?:
|
|
171
|
+
engine?: OpenResponsesRequestEngine | undefined;
|
|
152
172
|
};
|
|
153
|
-
export type
|
|
173
|
+
export type OpenResponsesRequestPluginModeration = {
|
|
154
174
|
id: "moderation";
|
|
155
175
|
};
|
|
156
|
-
export type
|
|
176
|
+
export type OpenResponsesRequestPluginUnion = OpenResponsesRequestPluginModeration | OpenResponsesRequestPluginWeb | OpenResponsesRequestPluginFileParser | OpenResponsesRequestPluginResponseHealing;
|
|
177
|
+
/**
|
|
178
|
+
* Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria.
|
|
179
|
+
*/
|
|
180
|
+
export declare const OpenResponsesRequestRoute: {
|
|
181
|
+
readonly Fallback: "fallback";
|
|
182
|
+
readonly Sort: "sort";
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria.
|
|
186
|
+
*/
|
|
187
|
+
export type OpenResponsesRequestRoute = OpenEnum<typeof OpenResponsesRequestRoute>;
|
|
157
188
|
/**
|
|
158
189
|
* Request schema for Responses endpoint
|
|
159
190
|
*/
|
|
@@ -199,15 +230,23 @@ export type OpenResponsesRequest = {
|
|
|
199
230
|
/**
|
|
200
231
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
201
232
|
*/
|
|
202
|
-
provider?:
|
|
233
|
+
provider?: OpenResponsesRequestProvider | null | undefined;
|
|
203
234
|
/**
|
|
204
235
|
* Plugins you want to enable for this request, including their settings.
|
|
205
236
|
*/
|
|
206
|
-
plugins?: Array<
|
|
237
|
+
plugins?: Array<OpenResponsesRequestPluginModeration | OpenResponsesRequestPluginWeb | OpenResponsesRequestPluginFileParser | OpenResponsesRequestPluginResponseHealing> | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria.
|
|
240
|
+
*/
|
|
241
|
+
route?: OpenResponsesRequestRoute | null | undefined;
|
|
207
242
|
/**
|
|
208
243
|
* A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.
|
|
209
244
|
*/
|
|
210
245
|
user?: string | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
|
|
248
|
+
*/
|
|
249
|
+
sessionId?: string | undefined;
|
|
211
250
|
};
|
|
212
251
|
/** @internal */
|
|
213
252
|
export type OpenResponsesRequestToolFunction$Outbound = {
|
|
@@ -247,18 +286,18 @@ export type Ignore$Outbound = string | string;
|
|
|
247
286
|
export declare const Ignore$outboundSchema: z.ZodType<Ignore$Outbound, Ignore>;
|
|
248
287
|
export declare function ignoreToJSON(ignore: Ignore): string;
|
|
249
288
|
/** @internal */
|
|
250
|
-
export type
|
|
251
|
-
prompt?:
|
|
252
|
-
completion?:
|
|
253
|
-
image?:
|
|
254
|
-
audio?:
|
|
255
|
-
request?:
|
|
289
|
+
export type OpenResponsesRequestMaxPrice$Outbound = {
|
|
290
|
+
prompt?: string | undefined;
|
|
291
|
+
completion?: string | undefined;
|
|
292
|
+
image?: string | undefined;
|
|
293
|
+
audio?: string | undefined;
|
|
294
|
+
request?: string | undefined;
|
|
256
295
|
};
|
|
257
296
|
/** @internal */
|
|
258
|
-
export declare const
|
|
259
|
-
export declare function
|
|
297
|
+
export declare const OpenResponsesRequestMaxPrice$outboundSchema: z.ZodType<OpenResponsesRequestMaxPrice$Outbound, OpenResponsesRequestMaxPrice>;
|
|
298
|
+
export declare function openResponsesRequestMaxPriceToJSON(openResponsesRequestMaxPrice: OpenResponsesRequestMaxPrice): string;
|
|
260
299
|
/** @internal */
|
|
261
|
-
export type
|
|
300
|
+
export type OpenResponsesRequestProvider$Outbound = {
|
|
262
301
|
allow_fallbacks?: boolean | null | undefined;
|
|
263
302
|
require_parameters?: boolean | null | undefined;
|
|
264
303
|
data_collection?: string | null | undefined;
|
|
@@ -269,60 +308,67 @@ export type Provider$Outbound = {
|
|
|
269
308
|
ignore?: Array<string | string> | null | undefined;
|
|
270
309
|
quantizations?: Array<string> | null | undefined;
|
|
271
310
|
sort?: string | null | undefined;
|
|
272
|
-
max_price?:
|
|
311
|
+
max_price?: OpenResponsesRequestMaxPrice$Outbound | undefined;
|
|
312
|
+
min_throughput?: number | null | undefined;
|
|
313
|
+
max_latency?: number | null | undefined;
|
|
273
314
|
};
|
|
274
315
|
/** @internal */
|
|
275
|
-
export declare const
|
|
276
|
-
export declare function
|
|
316
|
+
export declare const OpenResponsesRequestProvider$outboundSchema: z.ZodType<OpenResponsesRequestProvider$Outbound, OpenResponsesRequestProvider>;
|
|
317
|
+
export declare function openResponsesRequestProviderToJSON(openResponsesRequestProvider: OpenResponsesRequestProvider): string;
|
|
277
318
|
/** @internal */
|
|
278
|
-
export type
|
|
319
|
+
export type OpenResponsesRequestPluginResponseHealing$Outbound = {
|
|
279
320
|
id: "response-healing";
|
|
321
|
+
enabled?: boolean | undefined;
|
|
280
322
|
};
|
|
281
323
|
/** @internal */
|
|
282
|
-
export declare const
|
|
283
|
-
export declare function
|
|
324
|
+
export declare const OpenResponsesRequestPluginResponseHealing$outboundSchema: z.ZodType<OpenResponsesRequestPluginResponseHealing$Outbound, OpenResponsesRequestPluginResponseHealing>;
|
|
325
|
+
export declare function openResponsesRequestPluginResponseHealingToJSON(openResponsesRequestPluginResponseHealing: OpenResponsesRequestPluginResponseHealing): string;
|
|
284
326
|
/** @internal */
|
|
285
|
-
export declare const
|
|
327
|
+
export declare const OpenResponsesRequestPdfEngine$outboundSchema: z.ZodType<string, OpenResponsesRequestPdfEngine>;
|
|
286
328
|
/** @internal */
|
|
287
|
-
export type
|
|
329
|
+
export type OpenResponsesRequestPdf$Outbound = {
|
|
288
330
|
engine?: string | undefined;
|
|
289
331
|
};
|
|
290
332
|
/** @internal */
|
|
291
|
-
export declare const
|
|
292
|
-
export declare function
|
|
333
|
+
export declare const OpenResponsesRequestPdf$outboundSchema: z.ZodType<OpenResponsesRequestPdf$Outbound, OpenResponsesRequestPdf>;
|
|
334
|
+
export declare function openResponsesRequestPdfToJSON(openResponsesRequestPdf: OpenResponsesRequestPdf): string;
|
|
293
335
|
/** @internal */
|
|
294
|
-
export type
|
|
336
|
+
export type OpenResponsesRequestPluginFileParser$Outbound = {
|
|
295
337
|
id: "file-parser";
|
|
338
|
+
enabled?: boolean | undefined;
|
|
296
339
|
max_files?: number | undefined;
|
|
297
|
-
pdf?:
|
|
340
|
+
pdf?: OpenResponsesRequestPdf$Outbound | undefined;
|
|
298
341
|
};
|
|
299
342
|
/** @internal */
|
|
300
|
-
export declare const
|
|
301
|
-
export declare function
|
|
343
|
+
export declare const OpenResponsesRequestPluginFileParser$outboundSchema: z.ZodType<OpenResponsesRequestPluginFileParser$Outbound, OpenResponsesRequestPluginFileParser>;
|
|
344
|
+
export declare function openResponsesRequestPluginFileParserToJSON(openResponsesRequestPluginFileParser: OpenResponsesRequestPluginFileParser): string;
|
|
302
345
|
/** @internal */
|
|
303
|
-
export declare const
|
|
346
|
+
export declare const OpenResponsesRequestEngine$outboundSchema: z.ZodType<string, OpenResponsesRequestEngine>;
|
|
304
347
|
/** @internal */
|
|
305
|
-
export type
|
|
348
|
+
export type OpenResponsesRequestPluginWeb$Outbound = {
|
|
306
349
|
id: "web";
|
|
350
|
+
enabled?: boolean | undefined;
|
|
307
351
|
max_results?: number | undefined;
|
|
308
352
|
search_prompt?: string | undefined;
|
|
309
353
|
engine?: string | undefined;
|
|
310
354
|
};
|
|
311
355
|
/** @internal */
|
|
312
|
-
export declare const
|
|
313
|
-
export declare function
|
|
356
|
+
export declare const OpenResponsesRequestPluginWeb$outboundSchema: z.ZodType<OpenResponsesRequestPluginWeb$Outbound, OpenResponsesRequestPluginWeb>;
|
|
357
|
+
export declare function openResponsesRequestPluginWebToJSON(openResponsesRequestPluginWeb: OpenResponsesRequestPluginWeb): string;
|
|
314
358
|
/** @internal */
|
|
315
|
-
export type
|
|
359
|
+
export type OpenResponsesRequestPluginModeration$Outbound = {
|
|
316
360
|
id: "moderation";
|
|
317
361
|
};
|
|
318
362
|
/** @internal */
|
|
319
|
-
export declare const
|
|
320
|
-
export declare function
|
|
363
|
+
export declare const OpenResponsesRequestPluginModeration$outboundSchema: z.ZodType<OpenResponsesRequestPluginModeration$Outbound, OpenResponsesRequestPluginModeration>;
|
|
364
|
+
export declare function openResponsesRequestPluginModerationToJSON(openResponsesRequestPluginModeration: OpenResponsesRequestPluginModeration): string;
|
|
365
|
+
/** @internal */
|
|
366
|
+
export type OpenResponsesRequestPluginUnion$Outbound = OpenResponsesRequestPluginModeration$Outbound | OpenResponsesRequestPluginWeb$Outbound | OpenResponsesRequestPluginFileParser$Outbound | OpenResponsesRequestPluginResponseHealing$Outbound;
|
|
321
367
|
/** @internal */
|
|
322
|
-
export
|
|
368
|
+
export declare const OpenResponsesRequestPluginUnion$outboundSchema: z.ZodType<OpenResponsesRequestPluginUnion$Outbound, OpenResponsesRequestPluginUnion>;
|
|
369
|
+
export declare function openResponsesRequestPluginUnionToJSON(openResponsesRequestPluginUnion: OpenResponsesRequestPluginUnion): string;
|
|
323
370
|
/** @internal */
|
|
324
|
-
export declare const
|
|
325
|
-
export declare function pluginToJSON(plugin: Plugin): string;
|
|
371
|
+
export declare const OpenResponsesRequestRoute$outboundSchema: z.ZodType<string, OpenResponsesRequestRoute>;
|
|
326
372
|
/** @internal */
|
|
327
373
|
export type OpenResponsesRequest$Outbound = {
|
|
328
374
|
input?: OpenResponsesInput$Outbound | undefined;
|
|
@@ -351,9 +397,11 @@ export type OpenResponsesRequest$Outbound = {
|
|
|
351
397
|
service_tier: string;
|
|
352
398
|
truncation?: string | null | undefined;
|
|
353
399
|
stream: boolean;
|
|
354
|
-
provider?:
|
|
355
|
-
plugins?: Array<
|
|
400
|
+
provider?: OpenResponsesRequestProvider$Outbound | null | undefined;
|
|
401
|
+
plugins?: Array<OpenResponsesRequestPluginModeration$Outbound | OpenResponsesRequestPluginWeb$Outbound | OpenResponsesRequestPluginFileParser$Outbound | OpenResponsesRequestPluginResponseHealing$Outbound> | undefined;
|
|
402
|
+
route?: string | null | undefined;
|
|
356
403
|
user?: string | undefined;
|
|
404
|
+
session_id?: string | undefined;
|
|
357
405
|
};
|
|
358
406
|
/** @internal */
|
|
359
407
|
export declare const OpenResponsesRequest$outboundSchema: z.ZodType<OpenResponsesRequest$Outbound, OpenResponsesRequest>;
|