@oh-my-pi/pi-ai 17.2.6 → 17.2.7
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/CHANGELOG.md +11 -0
- package/dist/types/auth-broker/client.d.ts +7 -0
- package/dist/types/auth-broker/server.d.ts +11 -0
- package/dist/types/auth-broker/wire-schema-resource.d.ts +1 -1
- package/dist/types/auth-broker/wire-schemas.d.ts +4 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/providers/anthropic-messages-server-schema.d.ts +695 -255
- package/dist/types/providers/openai-chat-server-schema.d.ts +909 -293
- package/dist/types/providers/openai-responses-server-schema.d.ts +980 -353
- package/dist/types/types.d.ts +8 -5
- package/dist/types/usage.d.ts +152 -46
- package/dist/types/utils/schema/wire.d.ts +1 -1
- package/dist/types/utils/validation.d.ts +24 -0
- package/package.json +5 -5
- package/src/auth-broker/client.ts +2 -1
- package/src/auth-broker/server.ts +2 -1
- package/src/auth-broker/wire-schema-resource.ts +1 -6
- package/src/index.ts +1 -1
- package/src/providers/anthropic-messages-server-schema.ts +1 -1
- package/src/providers/anthropic-messages-server.ts +1 -1
- package/src/providers/cursor.ts +31 -3
- package/src/providers/google-gemini-cli.ts +1 -1
- package/src/providers/openai-chat-server-schema.ts +1 -1
- package/src/providers/openai-chat-server.ts +1 -1
- package/src/providers/openai-codex-responses.ts +1 -1
- package/src/providers/openai-responses-server-schema.ts +1 -1
- package/src/providers/openai-responses-server.ts +1 -1
- package/src/types.ts +9 -6
- package/src/usage.ts +1 -1
- package/src/utils/schema/wire.ts +1 -1
- package/src/utils/validation.ts +2 -1
|
@@ -7,681 +7,1297 @@
|
|
|
7
7
|
* `stream_options.include_obfuscation`) — does not trip 400s on shapes we simply ignore.
|
|
8
8
|
*/
|
|
9
9
|
import type { ChatCompletionContentPart, ChatCompletionCreateParams, ChatCompletionMessageParam, ChatCompletionMessageToolCall, ChatCompletionTool, ChatCompletionToolChoiceOption } from "./openai-chat-wire.js";
|
|
10
|
-
export declare const textPartSchema: import("
|
|
10
|
+
export declare const textPartSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
11
|
+
text: string;
|
|
11
12
|
type: "text";
|
|
13
|
+
}, {
|
|
12
14
|
text: string;
|
|
13
|
-
|
|
15
|
+
type: "text";
|
|
16
|
+
}>;
|
|
14
17
|
/**
|
|
15
18
|
* OpenAI documents `image_url` as either `{ url: string, detail?: ... }` or —
|
|
16
19
|
* older clients — a bare string. Accept both shapes; downstream we extract a
|
|
17
20
|
* URL. `detail` is accepted for forward-compat but currently dropped (pi-ai's
|
|
18
21
|
* `ImageContent` has no detail field — TODO: plumb through if/when added).
|
|
19
22
|
*/
|
|
20
|
-
export declare const imagePartSchema: import("
|
|
21
|
-
type: "image_url";
|
|
23
|
+
export declare const imagePartSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
22
24
|
image_url: string | {
|
|
25
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
23
26
|
url: string;
|
|
27
|
+
};
|
|
28
|
+
type: "image_url";
|
|
29
|
+
}, {
|
|
30
|
+
image_url: string | {
|
|
24
31
|
detail?: "auto" | "high" | "low" | undefined;
|
|
32
|
+
url: string;
|
|
25
33
|
};
|
|
26
|
-
|
|
34
|
+
type: "image_url";
|
|
35
|
+
}>;
|
|
27
36
|
/** OpenAI audio input block (gpt-4o-audio). Accepted; currently dropped downstream. */
|
|
28
|
-
export declare const inputAudioPartSchema: import("
|
|
37
|
+
export declare const inputAudioPartSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
38
|
+
input_audio: {
|
|
39
|
+
data: string;
|
|
40
|
+
format: "mp3" | "wav";
|
|
41
|
+
};
|
|
29
42
|
type: "input_audio";
|
|
43
|
+
}, {
|
|
30
44
|
input_audio: {
|
|
31
45
|
data: string;
|
|
32
46
|
format: "mp3" | "wav";
|
|
33
47
|
};
|
|
34
|
-
|
|
48
|
+
type: "input_audio";
|
|
49
|
+
}>;
|
|
35
50
|
/** OpenAI file input block (file_search / vision-document). Accepted; currently dropped downstream. */
|
|
36
|
-
export declare const filePartSchema: import("
|
|
37
|
-
type: "file";
|
|
51
|
+
export declare const filePartSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
38
52
|
file: {
|
|
53
|
+
file_data?: string | undefined;
|
|
39
54
|
file_id?: string | undefined;
|
|
40
55
|
filename?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
type: "file";
|
|
58
|
+
}, {
|
|
59
|
+
file: {
|
|
41
60
|
file_data?: string | undefined;
|
|
61
|
+
file_id?: string | undefined;
|
|
62
|
+
filename?: string | undefined;
|
|
42
63
|
};
|
|
43
|
-
|
|
64
|
+
type: "file";
|
|
65
|
+
}>;
|
|
44
66
|
/** Replayed assistant refusal block. Accepted; currently dropped downstream. */
|
|
45
|
-
export declare const refusalPartSchema: import("
|
|
67
|
+
export declare const refusalPartSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
68
|
+
refusal: string;
|
|
46
69
|
type: "refusal";
|
|
70
|
+
}, {
|
|
47
71
|
refusal: string;
|
|
48
|
-
|
|
72
|
+
type: "refusal";
|
|
73
|
+
}>;
|
|
49
74
|
/**
|
|
50
75
|
* Forward-compat catch-all for unknown content-part types. Matches every other
|
|
51
76
|
* `{ type: string, ... }` object so a new OpenAI block kind does not 400 the
|
|
52
77
|
* whole request; the walker ignores parts whose `type` it does not know.
|
|
53
78
|
*/
|
|
54
|
-
export declare const unknownPartSchema: import("
|
|
79
|
+
export declare const unknownPartSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
55
80
|
type: string;
|
|
56
|
-
}, {
|
|
57
|
-
|
|
58
|
-
|
|
81
|
+
}, {
|
|
82
|
+
type: string;
|
|
83
|
+
}>;
|
|
84
|
+
export declare const userContentPartSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
59
85
|
text: string;
|
|
86
|
+
type: "text";
|
|
60
87
|
} | {
|
|
61
|
-
type: "image_url";
|
|
62
88
|
image_url: string | {
|
|
63
|
-
url: string;
|
|
64
89
|
detail?: "auto" | "high" | "low" | undefined;
|
|
90
|
+
url: string;
|
|
65
91
|
};
|
|
92
|
+
type: "image_url";
|
|
66
93
|
} | {
|
|
67
|
-
type: "input_audio";
|
|
68
94
|
input_audio: {
|
|
69
95
|
data: string;
|
|
70
96
|
format: "mp3" | "wav";
|
|
71
97
|
};
|
|
98
|
+
type: "input_audio";
|
|
72
99
|
} | {
|
|
73
|
-
type: "file";
|
|
74
100
|
file: {
|
|
101
|
+
file_data?: string | undefined;
|
|
75
102
|
file_id?: string | undefined;
|
|
76
103
|
filename?: string | undefined;
|
|
77
|
-
file_data?: string | undefined;
|
|
78
104
|
};
|
|
105
|
+
type: "file";
|
|
79
106
|
} | {
|
|
107
|
+
refusal: string;
|
|
80
108
|
type: "refusal";
|
|
109
|
+
} | {
|
|
110
|
+
type: string;
|
|
111
|
+
}, {
|
|
112
|
+
text: string;
|
|
113
|
+
type: "text";
|
|
114
|
+
} | {
|
|
115
|
+
image_url: string | {
|
|
116
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
117
|
+
url: string;
|
|
118
|
+
};
|
|
119
|
+
type: "image_url";
|
|
120
|
+
} | {
|
|
121
|
+
input_audio: {
|
|
122
|
+
data: string;
|
|
123
|
+
format: "mp3" | "wav";
|
|
124
|
+
};
|
|
125
|
+
type: "input_audio";
|
|
126
|
+
} | {
|
|
127
|
+
file: {
|
|
128
|
+
file_data?: string | undefined;
|
|
129
|
+
file_id?: string | undefined;
|
|
130
|
+
filename?: string | undefined;
|
|
131
|
+
};
|
|
132
|
+
type: "file";
|
|
133
|
+
} | {
|
|
81
134
|
refusal: string;
|
|
135
|
+
type: "refusal";
|
|
82
136
|
} | {
|
|
83
137
|
type: string;
|
|
84
|
-
}
|
|
85
|
-
export declare const toolCallSchema: import("
|
|
138
|
+
}>;
|
|
139
|
+
export declare const toolCallSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
140
|
+
function: {
|
|
141
|
+
arguments: string;
|
|
142
|
+
name: string;
|
|
143
|
+
};
|
|
86
144
|
id: string;
|
|
87
145
|
type?: "function" | undefined;
|
|
146
|
+
}, {
|
|
88
147
|
function: {
|
|
89
|
-
name: string;
|
|
90
148
|
arguments: string;
|
|
149
|
+
name: string;
|
|
91
150
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
151
|
+
id: string;
|
|
152
|
+
type?: "function" | undefined;
|
|
153
|
+
}>;
|
|
154
|
+
export declare const toolSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
95
155
|
function: {
|
|
156
|
+
description?: string | undefined;
|
|
96
157
|
name: string;
|
|
158
|
+
parameters?: Record<string, unknown> | undefined;
|
|
159
|
+
strict?: boolean | undefined;
|
|
160
|
+
};
|
|
161
|
+
type: "function";
|
|
162
|
+
}, {
|
|
163
|
+
function: {
|
|
97
164
|
description?: string | undefined;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
} | undefined;
|
|
165
|
+
name: string;
|
|
166
|
+
parameters?: Record<string, unknown> | undefined;
|
|
101
167
|
strict?: boolean | undefined;
|
|
102
168
|
};
|
|
103
|
-
}, {}>;
|
|
104
|
-
export declare const toolChoiceSchema: import("arktype").BaseType<"auto" | "none" | "required" | {
|
|
105
169
|
type: "function";
|
|
170
|
+
}>;
|
|
171
|
+
export declare const toolChoiceSchema: import("@oh-my-pi/omptype").FluentType<"auto" | "none" | "required" | {
|
|
106
172
|
function: {
|
|
107
173
|
name: string;
|
|
108
174
|
};
|
|
175
|
+
type: "function";
|
|
109
176
|
} | {
|
|
177
|
+
name: string;
|
|
110
178
|
type: "tool";
|
|
179
|
+
}, "auto" | "none" | "required" | {
|
|
180
|
+
function: {
|
|
181
|
+
name: string;
|
|
182
|
+
};
|
|
183
|
+
type: "function";
|
|
184
|
+
} | {
|
|
111
185
|
name: string;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
186
|
+
type: "tool";
|
|
187
|
+
}>;
|
|
188
|
+
export declare const systemMessageSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
115
189
|
content: string | ({
|
|
116
|
-
type: "text";
|
|
117
190
|
text: string;
|
|
191
|
+
type: "text";
|
|
118
192
|
} | {
|
|
119
|
-
type: "image_url";
|
|
120
193
|
image_url: string | {
|
|
121
|
-
url: string;
|
|
122
194
|
detail?: "auto" | "high" | "low" | undefined;
|
|
195
|
+
url: string;
|
|
123
196
|
};
|
|
197
|
+
type: "image_url";
|
|
124
198
|
} | {
|
|
125
|
-
type: "input_audio";
|
|
126
199
|
input_audio: {
|
|
127
200
|
data: string;
|
|
128
201
|
format: "mp3" | "wav";
|
|
129
202
|
};
|
|
203
|
+
type: "input_audio";
|
|
130
204
|
} | {
|
|
131
|
-
type: "file";
|
|
132
205
|
file: {
|
|
206
|
+
file_data?: string | undefined;
|
|
133
207
|
file_id?: string | undefined;
|
|
134
208
|
filename?: string | undefined;
|
|
135
|
-
file_data?: string | undefined;
|
|
136
209
|
};
|
|
210
|
+
type: "file";
|
|
137
211
|
} | {
|
|
138
|
-
type: "refusal";
|
|
139
212
|
refusal: string;
|
|
213
|
+
type: "refusal";
|
|
140
214
|
} | {
|
|
141
215
|
type: string;
|
|
142
216
|
})[];
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
role: "developer";
|
|
217
|
+
role: "system";
|
|
218
|
+
}, {
|
|
146
219
|
content: string | ({
|
|
147
|
-
type: "text";
|
|
148
220
|
text: string;
|
|
221
|
+
type: "text";
|
|
149
222
|
} | {
|
|
150
|
-
type: "image_url";
|
|
151
223
|
image_url: string | {
|
|
152
|
-
url: string;
|
|
153
224
|
detail?: "auto" | "high" | "low" | undefined;
|
|
225
|
+
url: string;
|
|
154
226
|
};
|
|
227
|
+
type: "image_url";
|
|
155
228
|
} | {
|
|
156
|
-
type: "input_audio";
|
|
157
229
|
input_audio: {
|
|
158
230
|
data: string;
|
|
159
231
|
format: "mp3" | "wav";
|
|
160
232
|
};
|
|
233
|
+
type: "input_audio";
|
|
161
234
|
} | {
|
|
162
|
-
type: "file";
|
|
163
235
|
file: {
|
|
236
|
+
file_data?: string | undefined;
|
|
164
237
|
file_id?: string | undefined;
|
|
165
238
|
filename?: string | undefined;
|
|
166
|
-
file_data?: string | undefined;
|
|
167
239
|
};
|
|
240
|
+
type: "file";
|
|
168
241
|
} | {
|
|
169
|
-
type: "refusal";
|
|
170
242
|
refusal: string;
|
|
243
|
+
type: "refusal";
|
|
171
244
|
} | {
|
|
172
245
|
type: string;
|
|
173
246
|
})[];
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
247
|
+
role: "system";
|
|
248
|
+
}>;
|
|
249
|
+
export declare const developerMessageSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
177
250
|
content: string | ({
|
|
178
|
-
type: "text";
|
|
179
251
|
text: string;
|
|
252
|
+
type: "text";
|
|
180
253
|
} | {
|
|
181
|
-
type: "image_url";
|
|
182
254
|
image_url: string | {
|
|
183
|
-
url: string;
|
|
184
255
|
detail?: "auto" | "high" | "low" | undefined;
|
|
256
|
+
url: string;
|
|
185
257
|
};
|
|
258
|
+
type: "image_url";
|
|
186
259
|
} | {
|
|
187
|
-
type: "input_audio";
|
|
188
260
|
input_audio: {
|
|
189
261
|
data: string;
|
|
190
262
|
format: "mp3" | "wav";
|
|
191
263
|
};
|
|
264
|
+
type: "input_audio";
|
|
192
265
|
} | {
|
|
193
|
-
type: "file";
|
|
194
266
|
file: {
|
|
267
|
+
file_data?: string | undefined;
|
|
195
268
|
file_id?: string | undefined;
|
|
196
269
|
filename?: string | undefined;
|
|
197
|
-
file_data?: string | undefined;
|
|
198
270
|
};
|
|
271
|
+
type: "file";
|
|
199
272
|
} | {
|
|
200
|
-
type: "refusal";
|
|
201
273
|
refusal: string;
|
|
274
|
+
type: "refusal";
|
|
202
275
|
} | {
|
|
203
276
|
type: string;
|
|
204
277
|
})[];
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
content?: string | ({
|
|
209
|
-
type: "text";
|
|
278
|
+
role: "developer";
|
|
279
|
+
}, {
|
|
280
|
+
content: string | ({
|
|
210
281
|
text: string;
|
|
282
|
+
type: "text";
|
|
211
283
|
} | {
|
|
212
|
-
type: "image_url";
|
|
213
284
|
image_url: string | {
|
|
214
|
-
url: string;
|
|
215
285
|
detail?: "auto" | "high" | "low" | undefined;
|
|
286
|
+
url: string;
|
|
216
287
|
};
|
|
288
|
+
type: "image_url";
|
|
217
289
|
} | {
|
|
218
|
-
type: "input_audio";
|
|
219
290
|
input_audio: {
|
|
220
291
|
data: string;
|
|
221
292
|
format: "mp3" | "wav";
|
|
222
293
|
};
|
|
294
|
+
type: "input_audio";
|
|
223
295
|
} | {
|
|
224
|
-
type: "file";
|
|
225
296
|
file: {
|
|
297
|
+
file_data?: string | undefined;
|
|
226
298
|
file_id?: string | undefined;
|
|
227
299
|
filename?: string | undefined;
|
|
228
|
-
file_data?: string | undefined;
|
|
229
300
|
};
|
|
301
|
+
type: "file";
|
|
230
302
|
} | {
|
|
231
|
-
type: "refusal";
|
|
232
303
|
refusal: string;
|
|
304
|
+
type: "refusal";
|
|
233
305
|
} | {
|
|
234
306
|
type: string;
|
|
235
|
-
})[]
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
name: string;
|
|
241
|
-
arguments: string;
|
|
242
|
-
};
|
|
243
|
-
}[] | undefined;
|
|
244
|
-
reasoning_content?: string | null | undefined;
|
|
245
|
-
}, {}>;
|
|
246
|
-
export declare const toolMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
247
|
-
role: "tool";
|
|
248
|
-
content?: string | ({
|
|
249
|
-
type: "text";
|
|
307
|
+
})[];
|
|
308
|
+
role: "developer";
|
|
309
|
+
}>;
|
|
310
|
+
export declare const userMessageSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
311
|
+
content: string | ({
|
|
250
312
|
text: string;
|
|
313
|
+
type: "text";
|
|
251
314
|
} | {
|
|
252
|
-
type: "image_url";
|
|
253
315
|
image_url: string | {
|
|
254
|
-
url: string;
|
|
255
316
|
detail?: "auto" | "high" | "low" | undefined;
|
|
317
|
+
url: string;
|
|
256
318
|
};
|
|
319
|
+
type: "image_url";
|
|
257
320
|
} | {
|
|
258
|
-
type: "input_audio";
|
|
259
321
|
input_audio: {
|
|
260
322
|
data: string;
|
|
261
323
|
format: "mp3" | "wav";
|
|
262
324
|
};
|
|
325
|
+
type: "input_audio";
|
|
263
326
|
} | {
|
|
264
|
-
type: "file";
|
|
265
327
|
file: {
|
|
328
|
+
file_data?: string | undefined;
|
|
266
329
|
file_id?: string | undefined;
|
|
267
330
|
filename?: string | undefined;
|
|
268
|
-
file_data?: string | undefined;
|
|
269
331
|
};
|
|
332
|
+
type: "file";
|
|
270
333
|
} | {
|
|
271
|
-
type: "refusal";
|
|
272
334
|
refusal: string;
|
|
335
|
+
type: "refusal";
|
|
273
336
|
} | {
|
|
274
337
|
type: string;
|
|
275
|
-
})[]
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
}, {}>;
|
|
279
|
-
/**
|
|
280
|
-
* Legacy `function` role (pre-tools API). Translated to a `tool` role
|
|
281
|
-
* canonical message in the walker so downstream providers see one shape.
|
|
282
|
-
*/
|
|
283
|
-
export declare const functionMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
284
|
-
role: "function";
|
|
285
|
-
name: string;
|
|
286
|
-
content: string | null;
|
|
287
|
-
}, {}>;
|
|
288
|
-
export declare const messageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
289
|
-
role: "system";
|
|
338
|
+
})[];
|
|
339
|
+
role: "user";
|
|
340
|
+
}, {
|
|
290
341
|
content: string | ({
|
|
291
|
-
type: "text";
|
|
292
342
|
text: string;
|
|
343
|
+
type: "text";
|
|
293
344
|
} | {
|
|
294
|
-
type: "image_url";
|
|
295
345
|
image_url: string | {
|
|
296
|
-
url: string;
|
|
297
346
|
detail?: "auto" | "high" | "low" | undefined;
|
|
347
|
+
url: string;
|
|
298
348
|
};
|
|
349
|
+
type: "image_url";
|
|
299
350
|
} | {
|
|
300
|
-
type: "input_audio";
|
|
301
351
|
input_audio: {
|
|
302
352
|
data: string;
|
|
303
353
|
format: "mp3" | "wav";
|
|
304
354
|
};
|
|
355
|
+
type: "input_audio";
|
|
305
356
|
} | {
|
|
306
|
-
type: "file";
|
|
307
357
|
file: {
|
|
358
|
+
file_data?: string | undefined;
|
|
308
359
|
file_id?: string | undefined;
|
|
309
360
|
filename?: string | undefined;
|
|
310
|
-
file_data?: string | undefined;
|
|
311
361
|
};
|
|
362
|
+
type: "file";
|
|
312
363
|
} | {
|
|
313
|
-
type: "refusal";
|
|
314
364
|
refusal: string;
|
|
365
|
+
type: "refusal";
|
|
315
366
|
} | {
|
|
316
367
|
type: string;
|
|
317
368
|
})[];
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
369
|
+
role: "user";
|
|
370
|
+
}>;
|
|
371
|
+
export declare const assistantMessageSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
372
|
+
content?: string | ({
|
|
322
373
|
text: string;
|
|
374
|
+
type: "text";
|
|
323
375
|
} | {
|
|
324
|
-
type: "image_url";
|
|
325
376
|
image_url: string | {
|
|
326
|
-
url: string;
|
|
327
377
|
detail?: "auto" | "high" | "low" | undefined;
|
|
378
|
+
url: string;
|
|
328
379
|
};
|
|
380
|
+
type: "image_url";
|
|
329
381
|
} | {
|
|
330
|
-
type: "input_audio";
|
|
331
382
|
input_audio: {
|
|
332
383
|
data: string;
|
|
333
384
|
format: "mp3" | "wav";
|
|
334
385
|
};
|
|
386
|
+
type: "input_audio";
|
|
335
387
|
} | {
|
|
336
|
-
type: "file";
|
|
337
388
|
file: {
|
|
389
|
+
file_data?: string | undefined;
|
|
338
390
|
file_id?: string | undefined;
|
|
339
391
|
filename?: string | undefined;
|
|
340
|
-
file_data?: string | undefined;
|
|
341
392
|
};
|
|
393
|
+
type: "file";
|
|
342
394
|
} | {
|
|
343
|
-
type: "refusal";
|
|
344
395
|
refusal: string;
|
|
396
|
+
type: "refusal";
|
|
345
397
|
} | {
|
|
346
398
|
type: string;
|
|
347
|
-
})[];
|
|
348
|
-
|
|
349
|
-
role: "
|
|
350
|
-
|
|
351
|
-
|
|
399
|
+
})[] | null | undefined;
|
|
400
|
+
reasoning_content?: string | null | undefined;
|
|
401
|
+
role: "assistant";
|
|
402
|
+
tool_calls?: {
|
|
403
|
+
function: {
|
|
404
|
+
arguments: string;
|
|
405
|
+
name: string;
|
|
406
|
+
};
|
|
407
|
+
id: string;
|
|
408
|
+
type?: "function" | undefined;
|
|
409
|
+
}[] | undefined;
|
|
410
|
+
}, {
|
|
411
|
+
content?: string | ({
|
|
352
412
|
text: string;
|
|
413
|
+
type: "text";
|
|
353
414
|
} | {
|
|
354
|
-
type: "image_url";
|
|
355
415
|
image_url: string | {
|
|
356
|
-
url: string;
|
|
357
416
|
detail?: "auto" | "high" | "low" | undefined;
|
|
417
|
+
url: string;
|
|
358
418
|
};
|
|
419
|
+
type: "image_url";
|
|
359
420
|
} | {
|
|
360
|
-
type: "input_audio";
|
|
361
421
|
input_audio: {
|
|
362
422
|
data: string;
|
|
363
423
|
format: "mp3" | "wav";
|
|
364
424
|
};
|
|
425
|
+
type: "input_audio";
|
|
365
426
|
} | {
|
|
366
|
-
type: "file";
|
|
367
427
|
file: {
|
|
428
|
+
file_data?: string | undefined;
|
|
368
429
|
file_id?: string | undefined;
|
|
369
430
|
filename?: string | undefined;
|
|
370
|
-
file_data?: string | undefined;
|
|
371
431
|
};
|
|
432
|
+
type: "file";
|
|
372
433
|
} | {
|
|
373
|
-
type: "refusal";
|
|
374
434
|
refusal: string;
|
|
435
|
+
type: "refusal";
|
|
375
436
|
} | {
|
|
376
437
|
type: string;
|
|
377
|
-
})[];
|
|
378
|
-
|
|
438
|
+
})[] | null | undefined;
|
|
439
|
+
reasoning_content?: string | null | undefined;
|
|
379
440
|
role: "assistant";
|
|
441
|
+
tool_calls?: {
|
|
442
|
+
function: {
|
|
443
|
+
arguments: string;
|
|
444
|
+
name: string;
|
|
445
|
+
};
|
|
446
|
+
id: string;
|
|
447
|
+
type?: "function" | undefined;
|
|
448
|
+
}[] | undefined;
|
|
449
|
+
}>;
|
|
450
|
+
export declare const toolMessageSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
451
|
+
content?: string | ({
|
|
452
|
+
text: string;
|
|
453
|
+
type: "text";
|
|
454
|
+
} | {
|
|
455
|
+
image_url: string | {
|
|
456
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
457
|
+
url: string;
|
|
458
|
+
};
|
|
459
|
+
type: "image_url";
|
|
460
|
+
} | {
|
|
461
|
+
input_audio: {
|
|
462
|
+
data: string;
|
|
463
|
+
format: "mp3" | "wav";
|
|
464
|
+
};
|
|
465
|
+
type: "input_audio";
|
|
466
|
+
} | {
|
|
467
|
+
file: {
|
|
468
|
+
file_data?: string | undefined;
|
|
469
|
+
file_id?: string | undefined;
|
|
470
|
+
filename?: string | undefined;
|
|
471
|
+
};
|
|
472
|
+
type: "file";
|
|
473
|
+
} | {
|
|
474
|
+
refusal: string;
|
|
475
|
+
type: "refusal";
|
|
476
|
+
} | {
|
|
477
|
+
type: string;
|
|
478
|
+
})[] | undefined;
|
|
479
|
+
name?: string | undefined;
|
|
480
|
+
role: "tool";
|
|
481
|
+
tool_call_id?: string | undefined;
|
|
482
|
+
}, {
|
|
380
483
|
content?: string | ({
|
|
484
|
+
text: string;
|
|
485
|
+
type: "text";
|
|
486
|
+
} | {
|
|
487
|
+
image_url: string | {
|
|
488
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
489
|
+
url: string;
|
|
490
|
+
};
|
|
491
|
+
type: "image_url";
|
|
492
|
+
} | {
|
|
493
|
+
input_audio: {
|
|
494
|
+
data: string;
|
|
495
|
+
format: "mp3" | "wav";
|
|
496
|
+
};
|
|
497
|
+
type: "input_audio";
|
|
498
|
+
} | {
|
|
499
|
+
file: {
|
|
500
|
+
file_data?: string | undefined;
|
|
501
|
+
file_id?: string | undefined;
|
|
502
|
+
filename?: string | undefined;
|
|
503
|
+
};
|
|
504
|
+
type: "file";
|
|
505
|
+
} | {
|
|
506
|
+
refusal: string;
|
|
507
|
+
type: "refusal";
|
|
508
|
+
} | {
|
|
509
|
+
type: string;
|
|
510
|
+
})[] | undefined;
|
|
511
|
+
name?: string | undefined;
|
|
512
|
+
role: "tool";
|
|
513
|
+
tool_call_id?: string | undefined;
|
|
514
|
+
}>;
|
|
515
|
+
/**
|
|
516
|
+
* Legacy `function` role (pre-tools API). Translated to a `tool` role
|
|
517
|
+
* canonical message in the walker so downstream providers see one shape.
|
|
518
|
+
*/
|
|
519
|
+
export declare const functionMessageSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
520
|
+
content: string | null;
|
|
521
|
+
name: string;
|
|
522
|
+
role: "function";
|
|
523
|
+
}, {
|
|
524
|
+
content: string | null;
|
|
525
|
+
name: string;
|
|
526
|
+
role: "function";
|
|
527
|
+
}>;
|
|
528
|
+
export declare const messageSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
529
|
+
content: string | ({
|
|
530
|
+
text: string;
|
|
531
|
+
type: "text";
|
|
532
|
+
} | {
|
|
533
|
+
image_url: string | {
|
|
534
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
535
|
+
url: string;
|
|
536
|
+
};
|
|
537
|
+
type: "image_url";
|
|
538
|
+
} | {
|
|
539
|
+
input_audio: {
|
|
540
|
+
data: string;
|
|
541
|
+
format: "mp3" | "wav";
|
|
542
|
+
};
|
|
543
|
+
type: "input_audio";
|
|
544
|
+
} | {
|
|
545
|
+
file: {
|
|
546
|
+
file_data?: string | undefined;
|
|
547
|
+
file_id?: string | undefined;
|
|
548
|
+
filename?: string | undefined;
|
|
549
|
+
};
|
|
550
|
+
type: "file";
|
|
551
|
+
} | {
|
|
552
|
+
refusal: string;
|
|
553
|
+
type: "refusal";
|
|
554
|
+
} | {
|
|
555
|
+
type: string;
|
|
556
|
+
})[];
|
|
557
|
+
role: "system";
|
|
558
|
+
} | {
|
|
559
|
+
content: string | ({
|
|
560
|
+
text: string;
|
|
381
561
|
type: "text";
|
|
562
|
+
} | {
|
|
563
|
+
image_url: string | {
|
|
564
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
565
|
+
url: string;
|
|
566
|
+
};
|
|
567
|
+
type: "image_url";
|
|
568
|
+
} | {
|
|
569
|
+
input_audio: {
|
|
570
|
+
data: string;
|
|
571
|
+
format: "mp3" | "wav";
|
|
572
|
+
};
|
|
573
|
+
type: "input_audio";
|
|
574
|
+
} | {
|
|
575
|
+
file: {
|
|
576
|
+
file_data?: string | undefined;
|
|
577
|
+
file_id?: string | undefined;
|
|
578
|
+
filename?: string | undefined;
|
|
579
|
+
};
|
|
580
|
+
type: "file";
|
|
581
|
+
} | {
|
|
582
|
+
refusal: string;
|
|
583
|
+
type: "refusal";
|
|
584
|
+
} | {
|
|
585
|
+
type: string;
|
|
586
|
+
})[];
|
|
587
|
+
role: "developer";
|
|
588
|
+
} | {
|
|
589
|
+
content: string | ({
|
|
382
590
|
text: string;
|
|
591
|
+
type: "text";
|
|
383
592
|
} | {
|
|
593
|
+
image_url: string | {
|
|
594
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
595
|
+
url: string;
|
|
596
|
+
};
|
|
384
597
|
type: "image_url";
|
|
598
|
+
} | {
|
|
599
|
+
input_audio: {
|
|
600
|
+
data: string;
|
|
601
|
+
format: "mp3" | "wav";
|
|
602
|
+
};
|
|
603
|
+
type: "input_audio";
|
|
604
|
+
} | {
|
|
605
|
+
file: {
|
|
606
|
+
file_data?: string | undefined;
|
|
607
|
+
file_id?: string | undefined;
|
|
608
|
+
filename?: string | undefined;
|
|
609
|
+
};
|
|
610
|
+
type: "file";
|
|
611
|
+
} | {
|
|
612
|
+
refusal: string;
|
|
613
|
+
type: "refusal";
|
|
614
|
+
} | {
|
|
615
|
+
type: string;
|
|
616
|
+
})[];
|
|
617
|
+
role: "user";
|
|
618
|
+
} | {
|
|
619
|
+
content?: string | ({
|
|
620
|
+
text: string;
|
|
621
|
+
type: "text";
|
|
622
|
+
} | {
|
|
385
623
|
image_url: string | {
|
|
624
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
386
625
|
url: string;
|
|
626
|
+
};
|
|
627
|
+
type: "image_url";
|
|
628
|
+
} | {
|
|
629
|
+
input_audio: {
|
|
630
|
+
data: string;
|
|
631
|
+
format: "mp3" | "wav";
|
|
632
|
+
};
|
|
633
|
+
type: "input_audio";
|
|
634
|
+
} | {
|
|
635
|
+
file: {
|
|
636
|
+
file_data?: string | undefined;
|
|
637
|
+
file_id?: string | undefined;
|
|
638
|
+
filename?: string | undefined;
|
|
639
|
+
};
|
|
640
|
+
type: "file";
|
|
641
|
+
} | {
|
|
642
|
+
refusal: string;
|
|
643
|
+
type: "refusal";
|
|
644
|
+
} | {
|
|
645
|
+
type: string;
|
|
646
|
+
})[] | null | undefined;
|
|
647
|
+
reasoning_content?: string | null | undefined;
|
|
648
|
+
role: "assistant";
|
|
649
|
+
tool_calls?: {
|
|
650
|
+
function: {
|
|
651
|
+
arguments: string;
|
|
652
|
+
name: string;
|
|
653
|
+
};
|
|
654
|
+
id: string;
|
|
655
|
+
type?: "function" | undefined;
|
|
656
|
+
}[] | undefined;
|
|
657
|
+
} | {
|
|
658
|
+
content?: string | ({
|
|
659
|
+
text: string;
|
|
660
|
+
type: "text";
|
|
661
|
+
} | {
|
|
662
|
+
image_url: string | {
|
|
387
663
|
detail?: "auto" | "high" | "low" | undefined;
|
|
664
|
+
url: string;
|
|
388
665
|
};
|
|
666
|
+
type: "image_url";
|
|
389
667
|
} | {
|
|
668
|
+
input_audio: {
|
|
669
|
+
data: string;
|
|
670
|
+
format: "mp3" | "wav";
|
|
671
|
+
};
|
|
390
672
|
type: "input_audio";
|
|
673
|
+
} | {
|
|
674
|
+
file: {
|
|
675
|
+
file_data?: string | undefined;
|
|
676
|
+
file_id?: string | undefined;
|
|
677
|
+
filename?: string | undefined;
|
|
678
|
+
};
|
|
679
|
+
type: "file";
|
|
680
|
+
} | {
|
|
681
|
+
refusal: string;
|
|
682
|
+
type: "refusal";
|
|
683
|
+
} | {
|
|
684
|
+
type: string;
|
|
685
|
+
})[] | undefined;
|
|
686
|
+
name?: string | undefined;
|
|
687
|
+
role: "tool";
|
|
688
|
+
tool_call_id?: string | undefined;
|
|
689
|
+
} | {
|
|
690
|
+
content: string | null;
|
|
691
|
+
name: string;
|
|
692
|
+
role: "function";
|
|
693
|
+
}, {
|
|
694
|
+
content: string | ({
|
|
695
|
+
text: string;
|
|
696
|
+
type: "text";
|
|
697
|
+
} | {
|
|
698
|
+
image_url: string | {
|
|
699
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
700
|
+
url: string;
|
|
701
|
+
};
|
|
702
|
+
type: "image_url";
|
|
703
|
+
} | {
|
|
391
704
|
input_audio: {
|
|
392
705
|
data: string;
|
|
393
706
|
format: "mp3" | "wav";
|
|
394
707
|
};
|
|
708
|
+
type: "input_audio";
|
|
709
|
+
} | {
|
|
710
|
+
file: {
|
|
711
|
+
file_data?: string | undefined;
|
|
712
|
+
file_id?: string | undefined;
|
|
713
|
+
filename?: string | undefined;
|
|
714
|
+
};
|
|
715
|
+
type: "file";
|
|
716
|
+
} | {
|
|
717
|
+
refusal: string;
|
|
718
|
+
type: "refusal";
|
|
719
|
+
} | {
|
|
720
|
+
type: string;
|
|
721
|
+
})[];
|
|
722
|
+
role: "system";
|
|
723
|
+
} | {
|
|
724
|
+
content: string | ({
|
|
725
|
+
text: string;
|
|
726
|
+
type: "text";
|
|
727
|
+
} | {
|
|
728
|
+
image_url: string | {
|
|
729
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
730
|
+
url: string;
|
|
731
|
+
};
|
|
732
|
+
type: "image_url";
|
|
733
|
+
} | {
|
|
734
|
+
input_audio: {
|
|
735
|
+
data: string;
|
|
736
|
+
format: "mp3" | "wav";
|
|
737
|
+
};
|
|
738
|
+
type: "input_audio";
|
|
739
|
+
} | {
|
|
740
|
+
file: {
|
|
741
|
+
file_data?: string | undefined;
|
|
742
|
+
file_id?: string | undefined;
|
|
743
|
+
filename?: string | undefined;
|
|
744
|
+
};
|
|
745
|
+
type: "file";
|
|
746
|
+
} | {
|
|
747
|
+
refusal: string;
|
|
748
|
+
type: "refusal";
|
|
749
|
+
} | {
|
|
750
|
+
type: string;
|
|
751
|
+
})[];
|
|
752
|
+
role: "developer";
|
|
753
|
+
} | {
|
|
754
|
+
content: string | ({
|
|
755
|
+
text: string;
|
|
756
|
+
type: "text";
|
|
757
|
+
} | {
|
|
758
|
+
image_url: string | {
|
|
759
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
760
|
+
url: string;
|
|
761
|
+
};
|
|
762
|
+
type: "image_url";
|
|
763
|
+
} | {
|
|
764
|
+
input_audio: {
|
|
765
|
+
data: string;
|
|
766
|
+
format: "mp3" | "wav";
|
|
767
|
+
};
|
|
768
|
+
type: "input_audio";
|
|
769
|
+
} | {
|
|
770
|
+
file: {
|
|
771
|
+
file_data?: string | undefined;
|
|
772
|
+
file_id?: string | undefined;
|
|
773
|
+
filename?: string | undefined;
|
|
774
|
+
};
|
|
775
|
+
type: "file";
|
|
776
|
+
} | {
|
|
777
|
+
refusal: string;
|
|
778
|
+
type: "refusal";
|
|
779
|
+
} | {
|
|
780
|
+
type: string;
|
|
781
|
+
})[];
|
|
782
|
+
role: "user";
|
|
783
|
+
} | {
|
|
784
|
+
content?: string | ({
|
|
785
|
+
text: string;
|
|
786
|
+
type: "text";
|
|
787
|
+
} | {
|
|
788
|
+
image_url: string | {
|
|
789
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
790
|
+
url: string;
|
|
791
|
+
};
|
|
792
|
+
type: "image_url";
|
|
793
|
+
} | {
|
|
794
|
+
input_audio: {
|
|
795
|
+
data: string;
|
|
796
|
+
format: "mp3" | "wav";
|
|
797
|
+
};
|
|
798
|
+
type: "input_audio";
|
|
799
|
+
} | {
|
|
800
|
+
file: {
|
|
801
|
+
file_data?: string | undefined;
|
|
802
|
+
file_id?: string | undefined;
|
|
803
|
+
filename?: string | undefined;
|
|
804
|
+
};
|
|
805
|
+
type: "file";
|
|
806
|
+
} | {
|
|
807
|
+
refusal: string;
|
|
808
|
+
type: "refusal";
|
|
809
|
+
} | {
|
|
810
|
+
type: string;
|
|
811
|
+
})[] | null | undefined;
|
|
812
|
+
reasoning_content?: string | null | undefined;
|
|
813
|
+
role: "assistant";
|
|
814
|
+
tool_calls?: {
|
|
815
|
+
function: {
|
|
816
|
+
arguments: string;
|
|
817
|
+
name: string;
|
|
818
|
+
};
|
|
819
|
+
id: string;
|
|
820
|
+
type?: "function" | undefined;
|
|
821
|
+
}[] | undefined;
|
|
822
|
+
} | {
|
|
823
|
+
content?: string | ({
|
|
824
|
+
text: string;
|
|
825
|
+
type: "text";
|
|
826
|
+
} | {
|
|
827
|
+
image_url: string | {
|
|
828
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
829
|
+
url: string;
|
|
830
|
+
};
|
|
831
|
+
type: "image_url";
|
|
832
|
+
} | {
|
|
833
|
+
input_audio: {
|
|
834
|
+
data: string;
|
|
835
|
+
format: "mp3" | "wav";
|
|
836
|
+
};
|
|
837
|
+
type: "input_audio";
|
|
838
|
+
} | {
|
|
839
|
+
file: {
|
|
840
|
+
file_data?: string | undefined;
|
|
841
|
+
file_id?: string | undefined;
|
|
842
|
+
filename?: string | undefined;
|
|
843
|
+
};
|
|
844
|
+
type: "file";
|
|
845
|
+
} | {
|
|
846
|
+
refusal: string;
|
|
847
|
+
type: "refusal";
|
|
848
|
+
} | {
|
|
849
|
+
type: string;
|
|
850
|
+
})[] | undefined;
|
|
851
|
+
name?: string | undefined;
|
|
852
|
+
role: "tool";
|
|
853
|
+
tool_call_id?: string | undefined;
|
|
854
|
+
} | {
|
|
855
|
+
content: string | null;
|
|
856
|
+
name: string;
|
|
857
|
+
role: "function";
|
|
858
|
+
}>;
|
|
859
|
+
/**
|
|
860
|
+
* Permissive: the official OpenAI SDK sets `include_obfuscation: false` by
|
|
861
|
+
* default. We only consume `include_usage`, so unknown keys are silently
|
|
862
|
+
* stripped rather than 400'd.
|
|
863
|
+
*/
|
|
864
|
+
export declare const streamOptionsSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
865
|
+
include_usage?: boolean | undefined;
|
|
866
|
+
}, {
|
|
867
|
+
include_usage?: boolean | undefined;
|
|
868
|
+
}>;
|
|
869
|
+
export declare const stopSchema: import("@oh-my-pi/omptype").FluentType<string, string>;
|
|
870
|
+
export declare const openaiChatRequestSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
871
|
+
audio?: unknown;
|
|
872
|
+
frequency_penalty?: number | undefined;
|
|
873
|
+
logit_bias?: Record<string, number> | undefined;
|
|
874
|
+
logprobs?: unknown;
|
|
875
|
+
max_completion_tokens?: number | undefined;
|
|
876
|
+
max_tokens?: number | undefined;
|
|
877
|
+
messages: ({
|
|
878
|
+
content: string | ({
|
|
879
|
+
text: string;
|
|
880
|
+
type: "text";
|
|
881
|
+
} | {
|
|
882
|
+
image_url: string | {
|
|
883
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
884
|
+
url: string;
|
|
885
|
+
};
|
|
886
|
+
type: "image_url";
|
|
887
|
+
} | {
|
|
888
|
+
input_audio: {
|
|
889
|
+
data: string;
|
|
890
|
+
format: "mp3" | "wav";
|
|
891
|
+
};
|
|
892
|
+
type: "input_audio";
|
|
893
|
+
} | {
|
|
894
|
+
file: {
|
|
895
|
+
file_data?: string | undefined;
|
|
896
|
+
file_id?: string | undefined;
|
|
897
|
+
filename?: string | undefined;
|
|
898
|
+
};
|
|
899
|
+
type: "file";
|
|
900
|
+
} | {
|
|
901
|
+
refusal: string;
|
|
902
|
+
type: "refusal";
|
|
903
|
+
} | {
|
|
904
|
+
type: string;
|
|
905
|
+
})[];
|
|
906
|
+
role: "system";
|
|
907
|
+
} | {
|
|
908
|
+
content: string | ({
|
|
909
|
+
text: string;
|
|
910
|
+
type: "text";
|
|
911
|
+
} | {
|
|
912
|
+
image_url: string | {
|
|
913
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
914
|
+
url: string;
|
|
915
|
+
};
|
|
916
|
+
type: "image_url";
|
|
917
|
+
} | {
|
|
918
|
+
input_audio: {
|
|
919
|
+
data: string;
|
|
920
|
+
format: "mp3" | "wav";
|
|
921
|
+
};
|
|
922
|
+
type: "input_audio";
|
|
923
|
+
} | {
|
|
924
|
+
file: {
|
|
925
|
+
file_data?: string | undefined;
|
|
926
|
+
file_id?: string | undefined;
|
|
927
|
+
filename?: string | undefined;
|
|
928
|
+
};
|
|
929
|
+
type: "file";
|
|
930
|
+
} | {
|
|
931
|
+
refusal: string;
|
|
932
|
+
type: "refusal";
|
|
933
|
+
} | {
|
|
934
|
+
type: string;
|
|
935
|
+
})[];
|
|
936
|
+
role: "developer";
|
|
937
|
+
} | {
|
|
938
|
+
content: string | ({
|
|
939
|
+
text: string;
|
|
940
|
+
type: "text";
|
|
941
|
+
} | {
|
|
942
|
+
image_url: string | {
|
|
943
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
944
|
+
url: string;
|
|
945
|
+
};
|
|
946
|
+
type: "image_url";
|
|
947
|
+
} | {
|
|
948
|
+
input_audio: {
|
|
949
|
+
data: string;
|
|
950
|
+
format: "mp3" | "wav";
|
|
951
|
+
};
|
|
952
|
+
type: "input_audio";
|
|
953
|
+
} | {
|
|
954
|
+
file: {
|
|
955
|
+
file_data?: string | undefined;
|
|
956
|
+
file_id?: string | undefined;
|
|
957
|
+
filename?: string | undefined;
|
|
958
|
+
};
|
|
959
|
+
type: "file";
|
|
960
|
+
} | {
|
|
961
|
+
refusal: string;
|
|
962
|
+
type: "refusal";
|
|
963
|
+
} | {
|
|
964
|
+
type: string;
|
|
965
|
+
})[];
|
|
966
|
+
role: "user";
|
|
967
|
+
} | {
|
|
968
|
+
content?: string | ({
|
|
969
|
+
text: string;
|
|
970
|
+
type: "text";
|
|
971
|
+
} | {
|
|
972
|
+
image_url: string | {
|
|
973
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
974
|
+
url: string;
|
|
975
|
+
};
|
|
976
|
+
type: "image_url";
|
|
977
|
+
} | {
|
|
978
|
+
input_audio: {
|
|
979
|
+
data: string;
|
|
980
|
+
format: "mp3" | "wav";
|
|
981
|
+
};
|
|
982
|
+
type: "input_audio";
|
|
983
|
+
} | {
|
|
984
|
+
file: {
|
|
985
|
+
file_data?: string | undefined;
|
|
986
|
+
file_id?: string | undefined;
|
|
987
|
+
filename?: string | undefined;
|
|
988
|
+
};
|
|
989
|
+
type: "file";
|
|
990
|
+
} | {
|
|
991
|
+
refusal: string;
|
|
992
|
+
type: "refusal";
|
|
993
|
+
} | {
|
|
994
|
+
type: string;
|
|
995
|
+
})[] | null | undefined;
|
|
996
|
+
reasoning_content?: string | null | undefined;
|
|
997
|
+
role: "assistant";
|
|
998
|
+
tool_calls?: {
|
|
999
|
+
function: {
|
|
1000
|
+
arguments: string;
|
|
1001
|
+
name: string;
|
|
1002
|
+
};
|
|
1003
|
+
id: string;
|
|
1004
|
+
type?: "function" | undefined;
|
|
1005
|
+
}[] | undefined;
|
|
1006
|
+
} | {
|
|
1007
|
+
content?: string | ({
|
|
1008
|
+
text: string;
|
|
1009
|
+
type: "text";
|
|
1010
|
+
} | {
|
|
1011
|
+
image_url: string | {
|
|
1012
|
+
detail?: "auto" | "high" | "low" | undefined;
|
|
1013
|
+
url: string;
|
|
1014
|
+
};
|
|
1015
|
+
type: "image_url";
|
|
1016
|
+
} | {
|
|
1017
|
+
input_audio: {
|
|
1018
|
+
data: string;
|
|
1019
|
+
format: "mp3" | "wav";
|
|
1020
|
+
};
|
|
1021
|
+
type: "input_audio";
|
|
1022
|
+
} | {
|
|
1023
|
+
file: {
|
|
1024
|
+
file_data?: string | undefined;
|
|
1025
|
+
file_id?: string | undefined;
|
|
1026
|
+
filename?: string | undefined;
|
|
1027
|
+
};
|
|
1028
|
+
type: "file";
|
|
1029
|
+
} | {
|
|
1030
|
+
refusal: string;
|
|
1031
|
+
type: "refusal";
|
|
1032
|
+
} | {
|
|
1033
|
+
type: string;
|
|
1034
|
+
})[] | undefined;
|
|
1035
|
+
name?: string | undefined;
|
|
1036
|
+
role: "tool";
|
|
1037
|
+
tool_call_id?: string | undefined;
|
|
395
1038
|
} | {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
1039
|
+
content: string | null;
|
|
1040
|
+
name: string;
|
|
1041
|
+
role: "function";
|
|
1042
|
+
})[];
|
|
1043
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1044
|
+
modalities?: unknown;
|
|
1045
|
+
model: string;
|
|
1046
|
+
n?: unknown;
|
|
1047
|
+
parallel_tool_calls?: boolean | undefined;
|
|
1048
|
+
prediction?: unknown;
|
|
1049
|
+
presence_penalty?: number | undefined;
|
|
1050
|
+
prompt_cache_key?: unknown;
|
|
1051
|
+
reasoning_effort?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
|
|
1052
|
+
response_format?: unknown;
|
|
1053
|
+
safety_identifier?: unknown;
|
|
1054
|
+
seed?: number | undefined;
|
|
1055
|
+
service_tier?: "auto" | "default" | "flex" | "priority" | "scale" | undefined;
|
|
1056
|
+
stop?: string | undefined;
|
|
1057
|
+
store?: unknown;
|
|
1058
|
+
stream?: boolean | undefined;
|
|
1059
|
+
stream_options?: {
|
|
1060
|
+
include_usage?: boolean | undefined;
|
|
1061
|
+
} | undefined;
|
|
1062
|
+
temperature?: number | undefined;
|
|
1063
|
+
tool_choice?: "auto" | "none" | "required" | {
|
|
1064
|
+
function: {
|
|
1065
|
+
name: string;
|
|
401
1066
|
};
|
|
1067
|
+
type: "function";
|
|
402
1068
|
} | {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
} |
|
|
406
|
-
|
|
407
|
-
})[] | null | undefined;
|
|
408
|
-
tool_calls?: {
|
|
409
|
-
id: string;
|
|
410
|
-
type?: "function" | undefined;
|
|
1069
|
+
name: string;
|
|
1070
|
+
type: "tool";
|
|
1071
|
+
} | undefined;
|
|
1072
|
+
tools?: {
|
|
411
1073
|
function: {
|
|
1074
|
+
description?: string | undefined;
|
|
412
1075
|
name: string;
|
|
413
|
-
|
|
1076
|
+
parameters?: Record<string, unknown> | undefined;
|
|
1077
|
+
strict?: boolean | undefined;
|
|
414
1078
|
};
|
|
1079
|
+
type: "function";
|
|
415
1080
|
}[] | undefined;
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
};
|
|
428
|
-
} | {
|
|
429
|
-
type: "input_audio";
|
|
430
|
-
input_audio: {
|
|
431
|
-
data: string;
|
|
432
|
-
format: "mp3" | "wav";
|
|
433
|
-
};
|
|
434
|
-
} | {
|
|
435
|
-
type: "file";
|
|
436
|
-
file: {
|
|
437
|
-
file_id?: string | undefined;
|
|
438
|
-
filename?: string | undefined;
|
|
439
|
-
file_data?: string | undefined;
|
|
440
|
-
};
|
|
441
|
-
} | {
|
|
442
|
-
type: "refusal";
|
|
443
|
-
refusal: string;
|
|
444
|
-
} | {
|
|
445
|
-
type: string;
|
|
446
|
-
})[] | undefined;
|
|
447
|
-
tool_call_id?: string | undefined;
|
|
448
|
-
name?: ((In: string) => import("arktype").Out<string | undefined>) | undefined;
|
|
449
|
-
} | {
|
|
450
|
-
role: "function";
|
|
451
|
-
name: string;
|
|
452
|
-
content: string | null;
|
|
453
|
-
}, {}>;
|
|
454
|
-
/**
|
|
455
|
-
* Permissive: the official OpenAI SDK sets `include_obfuscation: false` by
|
|
456
|
-
* default. We only consume `include_usage`, so unknown keys are silently
|
|
457
|
-
* stripped rather than 400'd.
|
|
458
|
-
*/
|
|
459
|
-
export declare const streamOptionsSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
460
|
-
include_usage?: boolean | undefined;
|
|
461
|
-
}, {}>;
|
|
462
|
-
export declare const stopSchema: import("arktype").BaseType<string | string[], {}>;
|
|
463
|
-
export declare const openaiChatRequestSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
464
|
-
model: string;
|
|
1081
|
+
top_logprobs?: unknown;
|
|
1082
|
+
top_p?: number | undefined;
|
|
1083
|
+
user?: string | undefined;
|
|
1084
|
+
web_search_options?: unknown;
|
|
1085
|
+
}, {
|
|
1086
|
+
audio?: unknown;
|
|
1087
|
+
frequency_penalty?: number | undefined;
|
|
1088
|
+
logit_bias?: Record<string, number> | undefined;
|
|
1089
|
+
logprobs?: unknown;
|
|
1090
|
+
max_completion_tokens?: number | undefined;
|
|
1091
|
+
max_tokens?: number | undefined;
|
|
465
1092
|
messages: ({
|
|
466
|
-
role: "system";
|
|
467
1093
|
content: string | ({
|
|
468
|
-
type: "text";
|
|
469
1094
|
text: string;
|
|
1095
|
+
type: "text";
|
|
470
1096
|
} | {
|
|
471
|
-
type: "image_url";
|
|
472
1097
|
image_url: string | {
|
|
473
|
-
url: string;
|
|
474
1098
|
detail?: "auto" | "high" | "low" | undefined;
|
|
1099
|
+
url: string;
|
|
475
1100
|
};
|
|
1101
|
+
type: "image_url";
|
|
476
1102
|
} | {
|
|
477
|
-
type: "input_audio";
|
|
478
1103
|
input_audio: {
|
|
479
1104
|
data: string;
|
|
480
1105
|
format: "mp3" | "wav";
|
|
481
1106
|
};
|
|
1107
|
+
type: "input_audio";
|
|
482
1108
|
} | {
|
|
483
|
-
type: "file";
|
|
484
1109
|
file: {
|
|
1110
|
+
file_data?: string | undefined;
|
|
485
1111
|
file_id?: string | undefined;
|
|
486
1112
|
filename?: string | undefined;
|
|
487
|
-
file_data?: string | undefined;
|
|
488
1113
|
};
|
|
1114
|
+
type: "file";
|
|
489
1115
|
} | {
|
|
490
|
-
type: "refusal";
|
|
491
1116
|
refusal: string;
|
|
1117
|
+
type: "refusal";
|
|
492
1118
|
} | {
|
|
493
1119
|
type: string;
|
|
494
1120
|
})[];
|
|
1121
|
+
role: "system";
|
|
495
1122
|
} | {
|
|
496
|
-
role: "developer";
|
|
497
1123
|
content: string | ({
|
|
498
|
-
type: "text";
|
|
499
1124
|
text: string;
|
|
1125
|
+
type: "text";
|
|
500
1126
|
} | {
|
|
501
|
-
type: "image_url";
|
|
502
1127
|
image_url: string | {
|
|
503
|
-
url: string;
|
|
504
1128
|
detail?: "auto" | "high" | "low" | undefined;
|
|
1129
|
+
url: string;
|
|
505
1130
|
};
|
|
1131
|
+
type: "image_url";
|
|
506
1132
|
} | {
|
|
507
|
-
type: "input_audio";
|
|
508
1133
|
input_audio: {
|
|
509
1134
|
data: string;
|
|
510
1135
|
format: "mp3" | "wav";
|
|
511
1136
|
};
|
|
1137
|
+
type: "input_audio";
|
|
512
1138
|
} | {
|
|
513
|
-
type: "file";
|
|
514
1139
|
file: {
|
|
1140
|
+
file_data?: string | undefined;
|
|
515
1141
|
file_id?: string | undefined;
|
|
516
1142
|
filename?: string | undefined;
|
|
517
|
-
file_data?: string | undefined;
|
|
518
1143
|
};
|
|
1144
|
+
type: "file";
|
|
519
1145
|
} | {
|
|
520
|
-
type: "refusal";
|
|
521
1146
|
refusal: string;
|
|
1147
|
+
type: "refusal";
|
|
522
1148
|
} | {
|
|
523
1149
|
type: string;
|
|
524
1150
|
})[];
|
|
1151
|
+
role: "developer";
|
|
525
1152
|
} | {
|
|
526
|
-
role: "user";
|
|
527
1153
|
content: string | ({
|
|
528
|
-
type: "text";
|
|
529
1154
|
text: string;
|
|
1155
|
+
type: "text";
|
|
530
1156
|
} | {
|
|
531
|
-
type: "image_url";
|
|
532
1157
|
image_url: string | {
|
|
533
|
-
url: string;
|
|
534
1158
|
detail?: "auto" | "high" | "low" | undefined;
|
|
1159
|
+
url: string;
|
|
535
1160
|
};
|
|
1161
|
+
type: "image_url";
|
|
536
1162
|
} | {
|
|
537
|
-
type: "input_audio";
|
|
538
1163
|
input_audio: {
|
|
539
1164
|
data: string;
|
|
540
1165
|
format: "mp3" | "wav";
|
|
541
1166
|
};
|
|
1167
|
+
type: "input_audio";
|
|
542
1168
|
} | {
|
|
543
|
-
type: "file";
|
|
544
1169
|
file: {
|
|
1170
|
+
file_data?: string | undefined;
|
|
545
1171
|
file_id?: string | undefined;
|
|
546
1172
|
filename?: string | undefined;
|
|
547
|
-
file_data?: string | undefined;
|
|
548
1173
|
};
|
|
1174
|
+
type: "file";
|
|
549
1175
|
} | {
|
|
550
|
-
type: "refusal";
|
|
551
1176
|
refusal: string;
|
|
1177
|
+
type: "refusal";
|
|
552
1178
|
} | {
|
|
553
1179
|
type: string;
|
|
554
1180
|
})[];
|
|
1181
|
+
role: "user";
|
|
555
1182
|
} | {
|
|
556
|
-
role: "assistant";
|
|
557
1183
|
content?: string | ({
|
|
558
|
-
type: "text";
|
|
559
1184
|
text: string;
|
|
1185
|
+
type: "text";
|
|
560
1186
|
} | {
|
|
561
|
-
type: "image_url";
|
|
562
1187
|
image_url: string | {
|
|
563
|
-
url: string;
|
|
564
1188
|
detail?: "auto" | "high" | "low" | undefined;
|
|
1189
|
+
url: string;
|
|
565
1190
|
};
|
|
1191
|
+
type: "image_url";
|
|
566
1192
|
} | {
|
|
567
|
-
type: "input_audio";
|
|
568
1193
|
input_audio: {
|
|
569
1194
|
data: string;
|
|
570
1195
|
format: "mp3" | "wav";
|
|
571
1196
|
};
|
|
1197
|
+
type: "input_audio";
|
|
572
1198
|
} | {
|
|
573
|
-
type: "file";
|
|
574
1199
|
file: {
|
|
1200
|
+
file_data?: string | undefined;
|
|
575
1201
|
file_id?: string | undefined;
|
|
576
1202
|
filename?: string | undefined;
|
|
577
|
-
file_data?: string | undefined;
|
|
578
1203
|
};
|
|
1204
|
+
type: "file";
|
|
579
1205
|
} | {
|
|
580
|
-
type: "refusal";
|
|
581
1206
|
refusal: string;
|
|
1207
|
+
type: "refusal";
|
|
582
1208
|
} | {
|
|
583
1209
|
type: string;
|
|
584
1210
|
})[] | null | undefined;
|
|
1211
|
+
reasoning_content?: string | null | undefined;
|
|
1212
|
+
role: "assistant";
|
|
585
1213
|
tool_calls?: {
|
|
586
|
-
id: string;
|
|
587
|
-
type?: "function" | undefined;
|
|
588
1214
|
function: {
|
|
589
|
-
name: string;
|
|
590
1215
|
arguments: string;
|
|
1216
|
+
name: string;
|
|
591
1217
|
};
|
|
1218
|
+
id: string;
|
|
1219
|
+
type?: "function" | undefined;
|
|
592
1220
|
}[] | undefined;
|
|
593
|
-
reasoning_content?: string | null | undefined;
|
|
594
1221
|
} | {
|
|
595
|
-
role: "tool";
|
|
596
1222
|
content?: string | ({
|
|
597
|
-
type: "text";
|
|
598
1223
|
text: string;
|
|
1224
|
+
type: "text";
|
|
599
1225
|
} | {
|
|
600
|
-
type: "image_url";
|
|
601
1226
|
image_url: string | {
|
|
602
|
-
url: string;
|
|
603
1227
|
detail?: "auto" | "high" | "low" | undefined;
|
|
1228
|
+
url: string;
|
|
604
1229
|
};
|
|
1230
|
+
type: "image_url";
|
|
605
1231
|
} | {
|
|
606
|
-
type: "input_audio";
|
|
607
1232
|
input_audio: {
|
|
608
1233
|
data: string;
|
|
609
1234
|
format: "mp3" | "wav";
|
|
610
1235
|
};
|
|
1236
|
+
type: "input_audio";
|
|
611
1237
|
} | {
|
|
612
|
-
type: "file";
|
|
613
1238
|
file: {
|
|
1239
|
+
file_data?: string | undefined;
|
|
614
1240
|
file_id?: string | undefined;
|
|
615
1241
|
filename?: string | undefined;
|
|
616
|
-
file_data?: string | undefined;
|
|
617
1242
|
};
|
|
1243
|
+
type: "file";
|
|
618
1244
|
} | {
|
|
619
|
-
type: "refusal";
|
|
620
1245
|
refusal: string;
|
|
1246
|
+
type: "refusal";
|
|
621
1247
|
} | {
|
|
622
1248
|
type: string;
|
|
623
1249
|
})[] | undefined;
|
|
1250
|
+
name?: string | undefined;
|
|
1251
|
+
role: "tool";
|
|
624
1252
|
tool_call_id?: string | undefined;
|
|
625
|
-
name?: ((In: string) => import("arktype").Out<string | undefined>) | undefined;
|
|
626
1253
|
} | {
|
|
627
|
-
role: "function";
|
|
628
|
-
name: string;
|
|
629
1254
|
content: string | null;
|
|
1255
|
+
name: string;
|
|
1256
|
+
role: "function";
|
|
630
1257
|
})[];
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
1258
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1259
|
+
modalities?: unknown;
|
|
1260
|
+
model: string;
|
|
1261
|
+
n?: unknown;
|
|
1262
|
+
parallel_tool_calls?: boolean | undefined;
|
|
1263
|
+
prediction?: unknown;
|
|
1264
|
+
presence_penalty?: number | undefined;
|
|
1265
|
+
prompt_cache_key?: unknown;
|
|
1266
|
+
reasoning_effort?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
|
|
1267
|
+
response_format?: unknown;
|
|
1268
|
+
safety_identifier?: unknown;
|
|
1269
|
+
seed?: number | undefined;
|
|
1270
|
+
service_tier?: "auto" | "default" | "flex" | "priority" | "scale" | undefined;
|
|
1271
|
+
stop?: string | undefined;
|
|
1272
|
+
store?: unknown;
|
|
1273
|
+
stream?: boolean | undefined;
|
|
1274
|
+
stream_options?: {
|
|
1275
|
+
include_usage?: boolean | undefined;
|
|
1276
|
+
} | undefined;
|
|
1277
|
+
temperature?: number | undefined;
|
|
642
1278
|
tool_choice?: "auto" | "none" | "required" | {
|
|
643
|
-
type: "function";
|
|
644
1279
|
function: {
|
|
645
1280
|
name: string;
|
|
646
1281
|
};
|
|
1282
|
+
type: "function";
|
|
647
1283
|
} | {
|
|
648
|
-
type: "tool";
|
|
649
1284
|
name: string;
|
|
1285
|
+
type: "tool";
|
|
650
1286
|
} | undefined;
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
1287
|
+
tools?: {
|
|
1288
|
+
function: {
|
|
1289
|
+
description?: string | undefined;
|
|
1290
|
+
name: string;
|
|
1291
|
+
parameters?: Record<string, unknown> | undefined;
|
|
1292
|
+
strict?: boolean | undefined;
|
|
1293
|
+
};
|
|
1294
|
+
type: "function";
|
|
1295
|
+
}[] | undefined;
|
|
1296
|
+
top_logprobs?: unknown;
|
|
654
1297
|
top_p?: number | undefined;
|
|
655
|
-
stop?: string | string[] | undefined;
|
|
656
|
-
stream?: boolean | undefined;
|
|
657
|
-
stream_options?: {
|
|
658
|
-
include_usage?: boolean | undefined;
|
|
659
|
-
} | undefined;
|
|
660
|
-
response_format?: unknown;
|
|
661
|
-
seed?: number | undefined;
|
|
662
|
-
presence_penalty?: number | undefined;
|
|
663
|
-
frequency_penalty?: number | undefined;
|
|
664
|
-
logit_bias?: {
|
|
665
|
-
[x: string]: number;
|
|
666
|
-
} | undefined;
|
|
667
1298
|
user?: string | undefined;
|
|
668
|
-
reasoning_effort?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
|
|
669
|
-
parallel_tool_calls?: boolean | undefined;
|
|
670
|
-
service_tier?: "auto" | "default" | "flex" | "priority" | "scale" | undefined;
|
|
671
|
-
metadata?: {
|
|
672
|
-
[x: string]: unknown;
|
|
673
|
-
} | undefined;
|
|
674
|
-
logprobs?: unknown;
|
|
675
|
-
top_logprobs?: unknown;
|
|
676
|
-
prediction?: unknown;
|
|
677
|
-
modalities?: unknown;
|
|
678
|
-
audio?: unknown;
|
|
679
|
-
store?: unknown;
|
|
680
|
-
prompt_cache_key?: unknown;
|
|
681
|
-
safety_identifier?: unknown;
|
|
682
|
-
n?: unknown;
|
|
683
1299
|
web_search_options?: unknown;
|
|
684
|
-
}
|
|
1300
|
+
}>;
|
|
685
1301
|
/**
|
|
686
1302
|
* Public types are sourced from the OpenAI SDK so the gateway stays in
|
|
687
1303
|
* lock-step with the canonical API surface; the schemas above are runtime
|