@ai-sdk/openai 2.0.46 → 2.0.48
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 +13 -0
- package/dist/index.js +673 -665
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -22
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +672 -664
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +39 -21
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/internal/index.ts
|
|
@@ -63,17 +53,17 @@ var import_provider3 = require("@ai-sdk/provider");
|
|
|
63
53
|
var import_provider_utils5 = require("@ai-sdk/provider-utils");
|
|
64
54
|
|
|
65
55
|
// src/openai-error.ts
|
|
66
|
-
var
|
|
56
|
+
var import_v4 = require("zod/v4");
|
|
67
57
|
var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
68
|
-
var openaiErrorDataSchema = z.object({
|
|
69
|
-
error: z.object({
|
|
70
|
-
message: z.string(),
|
|
58
|
+
var openaiErrorDataSchema = import_v4.z.object({
|
|
59
|
+
error: import_v4.z.object({
|
|
60
|
+
message: import_v4.z.string(),
|
|
71
61
|
// The additional information below is handled loosely to support
|
|
72
62
|
// OpenAI-compatible providers that have slightly different error
|
|
73
63
|
// responses:
|
|
74
|
-
type: z.string().nullish(),
|
|
75
|
-
param: z.any().nullish(),
|
|
76
|
-
code: z.union([z.string(), z.number()]).nullish()
|
|
64
|
+
type: import_v4.z.string().nullish(),
|
|
65
|
+
param: import_v4.z.any().nullish(),
|
|
66
|
+
code: import_v4.z.union([import_v4.z.string(), import_v4.z.number()]).nullish()
|
|
77
67
|
})
|
|
78
68
|
});
|
|
79
69
|
var openaiFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
|
|
@@ -291,67 +281,67 @@ function mapOpenAIFinishReason(finishReason) {
|
|
|
291
281
|
|
|
292
282
|
// src/chat/openai-chat-api.ts
|
|
293
283
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
294
|
-
var
|
|
284
|
+
var import_v42 = require("zod/v4");
|
|
295
285
|
var openaiChatResponseSchema = (0, import_provider_utils3.lazyValidator)(
|
|
296
286
|
() => (0, import_provider_utils3.zodSchema)(
|
|
297
|
-
|
|
298
|
-
id:
|
|
299
|
-
created:
|
|
300
|
-
model:
|
|
301
|
-
choices:
|
|
302
|
-
|
|
303
|
-
message:
|
|
304
|
-
role:
|
|
305
|
-
content:
|
|
306
|
-
tool_calls:
|
|
307
|
-
|
|
308
|
-
id:
|
|
309
|
-
type:
|
|
310
|
-
function:
|
|
311
|
-
name:
|
|
312
|
-
arguments:
|
|
287
|
+
import_v42.z.object({
|
|
288
|
+
id: import_v42.z.string().nullish(),
|
|
289
|
+
created: import_v42.z.number().nullish(),
|
|
290
|
+
model: import_v42.z.string().nullish(),
|
|
291
|
+
choices: import_v42.z.array(
|
|
292
|
+
import_v42.z.object({
|
|
293
|
+
message: import_v42.z.object({
|
|
294
|
+
role: import_v42.z.literal("assistant").nullish(),
|
|
295
|
+
content: import_v42.z.string().nullish(),
|
|
296
|
+
tool_calls: import_v42.z.array(
|
|
297
|
+
import_v42.z.object({
|
|
298
|
+
id: import_v42.z.string().nullish(),
|
|
299
|
+
type: import_v42.z.literal("function"),
|
|
300
|
+
function: import_v42.z.object({
|
|
301
|
+
name: import_v42.z.string(),
|
|
302
|
+
arguments: import_v42.z.string()
|
|
313
303
|
})
|
|
314
304
|
})
|
|
315
305
|
).nullish(),
|
|
316
|
-
annotations:
|
|
317
|
-
|
|
318
|
-
type:
|
|
319
|
-
start_index:
|
|
320
|
-
end_index:
|
|
321
|
-
url:
|
|
322
|
-
title:
|
|
306
|
+
annotations: import_v42.z.array(
|
|
307
|
+
import_v42.z.object({
|
|
308
|
+
type: import_v42.z.literal("url_citation"),
|
|
309
|
+
start_index: import_v42.z.number(),
|
|
310
|
+
end_index: import_v42.z.number(),
|
|
311
|
+
url: import_v42.z.string(),
|
|
312
|
+
title: import_v42.z.string()
|
|
323
313
|
})
|
|
324
314
|
).nullish()
|
|
325
315
|
}),
|
|
326
|
-
index:
|
|
327
|
-
logprobs:
|
|
328
|
-
content:
|
|
329
|
-
|
|
330
|
-
token:
|
|
331
|
-
logprob:
|
|
332
|
-
top_logprobs:
|
|
333
|
-
|
|
334
|
-
token:
|
|
335
|
-
logprob:
|
|
316
|
+
index: import_v42.z.number(),
|
|
317
|
+
logprobs: import_v42.z.object({
|
|
318
|
+
content: import_v42.z.array(
|
|
319
|
+
import_v42.z.object({
|
|
320
|
+
token: import_v42.z.string(),
|
|
321
|
+
logprob: import_v42.z.number(),
|
|
322
|
+
top_logprobs: import_v42.z.array(
|
|
323
|
+
import_v42.z.object({
|
|
324
|
+
token: import_v42.z.string(),
|
|
325
|
+
logprob: import_v42.z.number()
|
|
336
326
|
})
|
|
337
327
|
)
|
|
338
328
|
})
|
|
339
329
|
).nullish()
|
|
340
330
|
}).nullish(),
|
|
341
|
-
finish_reason:
|
|
331
|
+
finish_reason: import_v42.z.string().nullish()
|
|
342
332
|
})
|
|
343
333
|
),
|
|
344
|
-
usage:
|
|
345
|
-
prompt_tokens:
|
|
346
|
-
completion_tokens:
|
|
347
|
-
total_tokens:
|
|
348
|
-
prompt_tokens_details:
|
|
349
|
-
cached_tokens:
|
|
334
|
+
usage: import_v42.z.object({
|
|
335
|
+
prompt_tokens: import_v42.z.number().nullish(),
|
|
336
|
+
completion_tokens: import_v42.z.number().nullish(),
|
|
337
|
+
total_tokens: import_v42.z.number().nullish(),
|
|
338
|
+
prompt_tokens_details: import_v42.z.object({
|
|
339
|
+
cached_tokens: import_v42.z.number().nullish()
|
|
350
340
|
}).nullish(),
|
|
351
|
-
completion_tokens_details:
|
|
352
|
-
reasoning_tokens:
|
|
353
|
-
accepted_prediction_tokens:
|
|
354
|
-
rejected_prediction_tokens:
|
|
341
|
+
completion_tokens_details: import_v42.z.object({
|
|
342
|
+
reasoning_tokens: import_v42.z.number().nullish(),
|
|
343
|
+
accepted_prediction_tokens: import_v42.z.number().nullish(),
|
|
344
|
+
rejected_prediction_tokens: import_v42.z.number().nullish()
|
|
355
345
|
}).nullish()
|
|
356
346
|
}).nullish()
|
|
357
347
|
})
|
|
@@ -359,66 +349,66 @@ var openaiChatResponseSchema = (0, import_provider_utils3.lazyValidator)(
|
|
|
359
349
|
);
|
|
360
350
|
var openaiChatChunkSchema = (0, import_provider_utils3.lazyValidator)(
|
|
361
351
|
() => (0, import_provider_utils3.zodSchema)(
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
id:
|
|
365
|
-
created:
|
|
366
|
-
model:
|
|
367
|
-
choices:
|
|
368
|
-
|
|
369
|
-
delta:
|
|
370
|
-
role:
|
|
371
|
-
content:
|
|
372
|
-
tool_calls:
|
|
373
|
-
|
|
374
|
-
index:
|
|
375
|
-
id:
|
|
376
|
-
type:
|
|
377
|
-
function:
|
|
378
|
-
name:
|
|
379
|
-
arguments:
|
|
352
|
+
import_v42.z.union([
|
|
353
|
+
import_v42.z.object({
|
|
354
|
+
id: import_v42.z.string().nullish(),
|
|
355
|
+
created: import_v42.z.number().nullish(),
|
|
356
|
+
model: import_v42.z.string().nullish(),
|
|
357
|
+
choices: import_v42.z.array(
|
|
358
|
+
import_v42.z.object({
|
|
359
|
+
delta: import_v42.z.object({
|
|
360
|
+
role: import_v42.z.enum(["assistant"]).nullish(),
|
|
361
|
+
content: import_v42.z.string().nullish(),
|
|
362
|
+
tool_calls: import_v42.z.array(
|
|
363
|
+
import_v42.z.object({
|
|
364
|
+
index: import_v42.z.number(),
|
|
365
|
+
id: import_v42.z.string().nullish(),
|
|
366
|
+
type: import_v42.z.literal("function").nullish(),
|
|
367
|
+
function: import_v42.z.object({
|
|
368
|
+
name: import_v42.z.string().nullish(),
|
|
369
|
+
arguments: import_v42.z.string().nullish()
|
|
380
370
|
})
|
|
381
371
|
})
|
|
382
372
|
).nullish(),
|
|
383
|
-
annotations:
|
|
384
|
-
|
|
385
|
-
type:
|
|
386
|
-
start_index:
|
|
387
|
-
end_index:
|
|
388
|
-
url:
|
|
389
|
-
title:
|
|
373
|
+
annotations: import_v42.z.array(
|
|
374
|
+
import_v42.z.object({
|
|
375
|
+
type: import_v42.z.literal("url_citation"),
|
|
376
|
+
start_index: import_v42.z.number(),
|
|
377
|
+
end_index: import_v42.z.number(),
|
|
378
|
+
url: import_v42.z.string(),
|
|
379
|
+
title: import_v42.z.string()
|
|
390
380
|
})
|
|
391
381
|
).nullish()
|
|
392
382
|
}).nullish(),
|
|
393
|
-
logprobs:
|
|
394
|
-
content:
|
|
395
|
-
|
|
396
|
-
token:
|
|
397
|
-
logprob:
|
|
398
|
-
top_logprobs:
|
|
399
|
-
|
|
400
|
-
token:
|
|
401
|
-
logprob:
|
|
383
|
+
logprobs: import_v42.z.object({
|
|
384
|
+
content: import_v42.z.array(
|
|
385
|
+
import_v42.z.object({
|
|
386
|
+
token: import_v42.z.string(),
|
|
387
|
+
logprob: import_v42.z.number(),
|
|
388
|
+
top_logprobs: import_v42.z.array(
|
|
389
|
+
import_v42.z.object({
|
|
390
|
+
token: import_v42.z.string(),
|
|
391
|
+
logprob: import_v42.z.number()
|
|
402
392
|
})
|
|
403
393
|
)
|
|
404
394
|
})
|
|
405
395
|
).nullish()
|
|
406
396
|
}).nullish(),
|
|
407
|
-
finish_reason:
|
|
408
|
-
index:
|
|
397
|
+
finish_reason: import_v42.z.string().nullish(),
|
|
398
|
+
index: import_v42.z.number()
|
|
409
399
|
})
|
|
410
400
|
),
|
|
411
|
-
usage:
|
|
412
|
-
prompt_tokens:
|
|
413
|
-
completion_tokens:
|
|
414
|
-
total_tokens:
|
|
415
|
-
prompt_tokens_details:
|
|
416
|
-
cached_tokens:
|
|
401
|
+
usage: import_v42.z.object({
|
|
402
|
+
prompt_tokens: import_v42.z.number().nullish(),
|
|
403
|
+
completion_tokens: import_v42.z.number().nullish(),
|
|
404
|
+
total_tokens: import_v42.z.number().nullish(),
|
|
405
|
+
prompt_tokens_details: import_v42.z.object({
|
|
406
|
+
cached_tokens: import_v42.z.number().nullish()
|
|
417
407
|
}).nullish(),
|
|
418
|
-
completion_tokens_details:
|
|
419
|
-
reasoning_tokens:
|
|
420
|
-
accepted_prediction_tokens:
|
|
421
|
-
rejected_prediction_tokens:
|
|
408
|
+
completion_tokens_details: import_v42.z.object({
|
|
409
|
+
reasoning_tokens: import_v42.z.number().nullish(),
|
|
410
|
+
accepted_prediction_tokens: import_v42.z.number().nullish(),
|
|
411
|
+
rejected_prediction_tokens: import_v42.z.number().nullish()
|
|
422
412
|
}).nullish()
|
|
423
413
|
}).nullish()
|
|
424
414
|
}),
|
|
@@ -429,17 +419,17 @@ var openaiChatChunkSchema = (0, import_provider_utils3.lazyValidator)(
|
|
|
429
419
|
|
|
430
420
|
// src/chat/openai-chat-options.ts
|
|
431
421
|
var import_provider_utils4 = require("@ai-sdk/provider-utils");
|
|
432
|
-
var
|
|
422
|
+
var import_v43 = require("zod/v4");
|
|
433
423
|
var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazyValidator)(
|
|
434
424
|
() => (0, import_provider_utils4.zodSchema)(
|
|
435
|
-
|
|
425
|
+
import_v43.z.object({
|
|
436
426
|
/**
|
|
437
427
|
* Modify the likelihood of specified tokens appearing in the completion.
|
|
438
428
|
*
|
|
439
429
|
* Accepts a JSON object that maps tokens (specified by their token ID in
|
|
440
430
|
* the GPT tokenizer) to an associated bias value from -100 to 100.
|
|
441
431
|
*/
|
|
442
|
-
logitBias:
|
|
432
|
+
logitBias: import_v43.z.record(import_v43.z.coerce.number(), import_v43.z.number()).optional(),
|
|
443
433
|
/**
|
|
444
434
|
* Return the log probabilities of the tokens.
|
|
445
435
|
*
|
|
@@ -449,42 +439,42 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazyValidator)(
|
|
|
449
439
|
* Setting to a number will return the log probabilities of the top n
|
|
450
440
|
* tokens that were generated.
|
|
451
441
|
*/
|
|
452
|
-
logprobs:
|
|
442
|
+
logprobs: import_v43.z.union([import_v43.z.boolean(), import_v43.z.number()]).optional(),
|
|
453
443
|
/**
|
|
454
444
|
* Whether to enable parallel function calling during tool use. Default to true.
|
|
455
445
|
*/
|
|
456
|
-
parallelToolCalls:
|
|
446
|
+
parallelToolCalls: import_v43.z.boolean().optional(),
|
|
457
447
|
/**
|
|
458
448
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
459
449
|
* monitor and detect abuse.
|
|
460
450
|
*/
|
|
461
|
-
user:
|
|
451
|
+
user: import_v43.z.string().optional(),
|
|
462
452
|
/**
|
|
463
453
|
* Reasoning effort for reasoning models. Defaults to `medium`.
|
|
464
454
|
*/
|
|
465
|
-
reasoningEffort:
|
|
455
|
+
reasoningEffort: import_v43.z.enum(["minimal", "low", "medium", "high"]).optional(),
|
|
466
456
|
/**
|
|
467
457
|
* Maximum number of completion tokens to generate. Useful for reasoning models.
|
|
468
458
|
*/
|
|
469
|
-
maxCompletionTokens:
|
|
459
|
+
maxCompletionTokens: import_v43.z.number().optional(),
|
|
470
460
|
/**
|
|
471
461
|
* Whether to enable persistence in responses API.
|
|
472
462
|
*/
|
|
473
|
-
store:
|
|
463
|
+
store: import_v43.z.boolean().optional(),
|
|
474
464
|
/**
|
|
475
465
|
* Metadata to associate with the request.
|
|
476
466
|
*/
|
|
477
|
-
metadata:
|
|
467
|
+
metadata: import_v43.z.record(import_v43.z.string().max(64), import_v43.z.string().max(512)).optional(),
|
|
478
468
|
/**
|
|
479
469
|
* Parameters for prediction mode.
|
|
480
470
|
*/
|
|
481
|
-
prediction:
|
|
471
|
+
prediction: import_v43.z.record(import_v43.z.string(), import_v43.z.any()).optional(),
|
|
482
472
|
/**
|
|
483
473
|
* Whether to use structured outputs.
|
|
484
474
|
*
|
|
485
475
|
* @default true
|
|
486
476
|
*/
|
|
487
|
-
structuredOutputs:
|
|
477
|
+
structuredOutputs: import_v43.z.boolean().optional(),
|
|
488
478
|
/**
|
|
489
479
|
* Service tier for the request.
|
|
490
480
|
* - 'auto': Default service tier. The request will be processed with the service tier configured in the
|
|
@@ -495,23 +485,23 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazyValidator)(
|
|
|
495
485
|
*
|
|
496
486
|
* @default 'auto'
|
|
497
487
|
*/
|
|
498
|
-
serviceTier:
|
|
488
|
+
serviceTier: import_v43.z.enum(["auto", "flex", "priority", "default"]).optional(),
|
|
499
489
|
/**
|
|
500
490
|
* Whether to use strict JSON schema validation.
|
|
501
491
|
*
|
|
502
492
|
* @default false
|
|
503
493
|
*/
|
|
504
|
-
strictJsonSchema:
|
|
494
|
+
strictJsonSchema: import_v43.z.boolean().optional(),
|
|
505
495
|
/**
|
|
506
496
|
* Controls the verbosity of the model's responses.
|
|
507
497
|
* Lower values will result in more concise responses, while higher values will result in more verbose responses.
|
|
508
498
|
*/
|
|
509
|
-
textVerbosity:
|
|
499
|
+
textVerbosity: import_v43.z.enum(["low", "medium", "high"]).optional(),
|
|
510
500
|
/**
|
|
511
501
|
* A cache key for prompt caching. Allows manual control over prompt caching behavior.
|
|
512
502
|
* Useful for improving cache hit rates and working around automatic caching issues.
|
|
513
503
|
*/
|
|
514
|
-
promptCacheKey:
|
|
504
|
+
promptCacheKey: import_v43.z.string().optional(),
|
|
515
505
|
/**
|
|
516
506
|
* A stable identifier used to help detect users of your application
|
|
517
507
|
* that may be violating OpenAI's usage policies. The IDs should be a
|
|
@@ -519,7 +509,7 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazyValidator)(
|
|
|
519
509
|
* username or email address, in order to avoid sending us any identifying
|
|
520
510
|
* information.
|
|
521
511
|
*/
|
|
522
|
-
safetyIdentifier:
|
|
512
|
+
safetyIdentifier: import_v43.z.string().optional()
|
|
523
513
|
})
|
|
524
514
|
)
|
|
525
515
|
);
|
|
@@ -1236,56 +1226,56 @@ function mapOpenAIFinishReason2(finishReason) {
|
|
|
1236
1226
|
}
|
|
1237
1227
|
|
|
1238
1228
|
// src/completion/openai-completion-api.ts
|
|
1239
|
-
var
|
|
1229
|
+
var import_v44 = require("zod/v4");
|
|
1240
1230
|
var import_provider_utils6 = require("@ai-sdk/provider-utils");
|
|
1241
1231
|
var openaiCompletionResponseSchema = (0, import_provider_utils6.lazyValidator)(
|
|
1242
1232
|
() => (0, import_provider_utils6.zodSchema)(
|
|
1243
|
-
|
|
1244
|
-
id:
|
|
1245
|
-
created:
|
|
1246
|
-
model:
|
|
1247
|
-
choices:
|
|
1248
|
-
|
|
1249
|
-
text:
|
|
1250
|
-
finish_reason:
|
|
1251
|
-
logprobs:
|
|
1252
|
-
tokens:
|
|
1253
|
-
token_logprobs:
|
|
1254
|
-
top_logprobs:
|
|
1233
|
+
import_v44.z.object({
|
|
1234
|
+
id: import_v44.z.string().nullish(),
|
|
1235
|
+
created: import_v44.z.number().nullish(),
|
|
1236
|
+
model: import_v44.z.string().nullish(),
|
|
1237
|
+
choices: import_v44.z.array(
|
|
1238
|
+
import_v44.z.object({
|
|
1239
|
+
text: import_v44.z.string(),
|
|
1240
|
+
finish_reason: import_v44.z.string(),
|
|
1241
|
+
logprobs: import_v44.z.object({
|
|
1242
|
+
tokens: import_v44.z.array(import_v44.z.string()),
|
|
1243
|
+
token_logprobs: import_v44.z.array(import_v44.z.number()),
|
|
1244
|
+
top_logprobs: import_v44.z.array(import_v44.z.record(import_v44.z.string(), import_v44.z.number())).nullish()
|
|
1255
1245
|
}).nullish()
|
|
1256
1246
|
})
|
|
1257
1247
|
),
|
|
1258
|
-
usage:
|
|
1259
|
-
prompt_tokens:
|
|
1260
|
-
completion_tokens:
|
|
1261
|
-
total_tokens:
|
|
1248
|
+
usage: import_v44.z.object({
|
|
1249
|
+
prompt_tokens: import_v44.z.number(),
|
|
1250
|
+
completion_tokens: import_v44.z.number(),
|
|
1251
|
+
total_tokens: import_v44.z.number()
|
|
1262
1252
|
}).nullish()
|
|
1263
1253
|
})
|
|
1264
1254
|
)
|
|
1265
1255
|
);
|
|
1266
1256
|
var openaiCompletionChunkSchema = (0, import_provider_utils6.lazyValidator)(
|
|
1267
1257
|
() => (0, import_provider_utils6.zodSchema)(
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
id:
|
|
1271
|
-
created:
|
|
1272
|
-
model:
|
|
1273
|
-
choices:
|
|
1274
|
-
|
|
1275
|
-
text:
|
|
1276
|
-
finish_reason:
|
|
1277
|
-
index:
|
|
1278
|
-
logprobs:
|
|
1279
|
-
tokens:
|
|
1280
|
-
token_logprobs:
|
|
1281
|
-
top_logprobs:
|
|
1258
|
+
import_v44.z.union([
|
|
1259
|
+
import_v44.z.object({
|
|
1260
|
+
id: import_v44.z.string().nullish(),
|
|
1261
|
+
created: import_v44.z.number().nullish(),
|
|
1262
|
+
model: import_v44.z.string().nullish(),
|
|
1263
|
+
choices: import_v44.z.array(
|
|
1264
|
+
import_v44.z.object({
|
|
1265
|
+
text: import_v44.z.string(),
|
|
1266
|
+
finish_reason: import_v44.z.string().nullish(),
|
|
1267
|
+
index: import_v44.z.number(),
|
|
1268
|
+
logprobs: import_v44.z.object({
|
|
1269
|
+
tokens: import_v44.z.array(import_v44.z.string()),
|
|
1270
|
+
token_logprobs: import_v44.z.array(import_v44.z.number()),
|
|
1271
|
+
top_logprobs: import_v44.z.array(import_v44.z.record(import_v44.z.string(), import_v44.z.number())).nullish()
|
|
1282
1272
|
}).nullish()
|
|
1283
1273
|
})
|
|
1284
1274
|
),
|
|
1285
|
-
usage:
|
|
1286
|
-
prompt_tokens:
|
|
1287
|
-
completion_tokens:
|
|
1288
|
-
total_tokens:
|
|
1275
|
+
usage: import_v44.z.object({
|
|
1276
|
+
prompt_tokens: import_v44.z.number(),
|
|
1277
|
+
completion_tokens: import_v44.z.number(),
|
|
1278
|
+
total_tokens: import_v44.z.number()
|
|
1289
1279
|
}).nullish()
|
|
1290
1280
|
}),
|
|
1291
1281
|
openaiErrorDataSchema
|
|
@@ -1295,14 +1285,14 @@ var openaiCompletionChunkSchema = (0, import_provider_utils6.lazyValidator)(
|
|
|
1295
1285
|
|
|
1296
1286
|
// src/completion/openai-completion-options.ts
|
|
1297
1287
|
var import_provider_utils7 = require("@ai-sdk/provider-utils");
|
|
1298
|
-
var
|
|
1288
|
+
var import_v45 = require("zod/v4");
|
|
1299
1289
|
var openaiCompletionProviderOptions = (0, import_provider_utils7.lazyValidator)(
|
|
1300
1290
|
() => (0, import_provider_utils7.zodSchema)(
|
|
1301
|
-
|
|
1291
|
+
import_v45.z.object({
|
|
1302
1292
|
/**
|
|
1303
1293
|
Echo back the prompt in addition to the completion.
|
|
1304
1294
|
*/
|
|
1305
|
-
echo:
|
|
1295
|
+
echo: import_v45.z.boolean().optional(),
|
|
1306
1296
|
/**
|
|
1307
1297
|
Modify the likelihood of specified tokens appearing in the completion.
|
|
1308
1298
|
|
|
@@ -1317,16 +1307,16 @@ var openaiCompletionProviderOptions = (0, import_provider_utils7.lazyValidator)(
|
|
|
1317
1307
|
As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
|
|
1318
1308
|
token from being generated.
|
|
1319
1309
|
*/
|
|
1320
|
-
logitBias:
|
|
1310
|
+
logitBias: import_v45.z.record(import_v45.z.string(), import_v45.z.number()).optional(),
|
|
1321
1311
|
/**
|
|
1322
1312
|
The suffix that comes after a completion of inserted text.
|
|
1323
1313
|
*/
|
|
1324
|
-
suffix:
|
|
1314
|
+
suffix: import_v45.z.string().optional(),
|
|
1325
1315
|
/**
|
|
1326
1316
|
A unique identifier representing your end-user, which can help OpenAI to
|
|
1327
1317
|
monitor and detect abuse. Learn more.
|
|
1328
1318
|
*/
|
|
1329
|
-
user:
|
|
1319
|
+
user: import_v45.z.string().optional(),
|
|
1330
1320
|
/**
|
|
1331
1321
|
Return the log probabilities of the tokens. Including logprobs will increase
|
|
1332
1322
|
the response size and can slow down response times. However, it can
|
|
@@ -1336,7 +1326,7 @@ var openaiCompletionProviderOptions = (0, import_provider_utils7.lazyValidator)(
|
|
|
1336
1326
|
Setting to a number will return the log probabilities of the top n
|
|
1337
1327
|
tokens that were generated.
|
|
1338
1328
|
*/
|
|
1339
|
-
logprobs:
|
|
1329
|
+
logprobs: import_v45.z.union([import_v45.z.boolean(), import_v45.z.number()]).optional()
|
|
1340
1330
|
})
|
|
1341
1331
|
)
|
|
1342
1332
|
);
|
|
@@ -1577,32 +1567,32 @@ var import_provider_utils11 = require("@ai-sdk/provider-utils");
|
|
|
1577
1567
|
|
|
1578
1568
|
// src/embedding/openai-embedding-options.ts
|
|
1579
1569
|
var import_provider_utils9 = require("@ai-sdk/provider-utils");
|
|
1580
|
-
var
|
|
1570
|
+
var import_v46 = require("zod/v4");
|
|
1581
1571
|
var openaiEmbeddingProviderOptions = (0, import_provider_utils9.lazyValidator)(
|
|
1582
1572
|
() => (0, import_provider_utils9.zodSchema)(
|
|
1583
|
-
|
|
1573
|
+
import_v46.z.object({
|
|
1584
1574
|
/**
|
|
1585
1575
|
The number of dimensions the resulting output embeddings should have.
|
|
1586
1576
|
Only supported in text-embedding-3 and later models.
|
|
1587
1577
|
*/
|
|
1588
|
-
dimensions:
|
|
1578
|
+
dimensions: import_v46.z.number().optional(),
|
|
1589
1579
|
/**
|
|
1590
1580
|
A unique identifier representing your end-user, which can help OpenAI to
|
|
1591
1581
|
monitor and detect abuse. Learn more.
|
|
1592
1582
|
*/
|
|
1593
|
-
user:
|
|
1583
|
+
user: import_v46.z.string().optional()
|
|
1594
1584
|
})
|
|
1595
1585
|
)
|
|
1596
1586
|
);
|
|
1597
1587
|
|
|
1598
1588
|
// src/embedding/openai-embedding-api.ts
|
|
1599
1589
|
var import_provider_utils10 = require("@ai-sdk/provider-utils");
|
|
1600
|
-
var
|
|
1590
|
+
var import_v47 = require("zod/v4");
|
|
1601
1591
|
var openaiTextEmbeddingResponseSchema = (0, import_provider_utils10.lazyValidator)(
|
|
1602
1592
|
() => (0, import_provider_utils10.zodSchema)(
|
|
1603
|
-
|
|
1604
|
-
data:
|
|
1605
|
-
usage:
|
|
1593
|
+
import_v47.z.object({
|
|
1594
|
+
data: import_v47.z.array(import_v47.z.object({ embedding: import_v47.z.array(import_v47.z.number()) })),
|
|
1595
|
+
usage: import_v47.z.object({ prompt_tokens: import_v47.z.number() }).nullish()
|
|
1606
1596
|
})
|
|
1607
1597
|
)
|
|
1608
1598
|
);
|
|
@@ -1676,14 +1666,14 @@ var import_provider_utils13 = require("@ai-sdk/provider-utils");
|
|
|
1676
1666
|
|
|
1677
1667
|
// src/image/openai-image-api.ts
|
|
1678
1668
|
var import_provider_utils12 = require("@ai-sdk/provider-utils");
|
|
1679
|
-
var
|
|
1669
|
+
var import_v48 = require("zod/v4");
|
|
1680
1670
|
var openaiImageResponseSchema = (0, import_provider_utils12.lazyValidator)(
|
|
1681
1671
|
() => (0, import_provider_utils12.zodSchema)(
|
|
1682
|
-
|
|
1683
|
-
data:
|
|
1684
|
-
|
|
1685
|
-
b64_json:
|
|
1686
|
-
revised_prompt:
|
|
1672
|
+
import_v48.z.object({
|
|
1673
|
+
data: import_v48.z.array(
|
|
1674
|
+
import_v48.z.object({
|
|
1675
|
+
b64_json: import_v48.z.string(),
|
|
1676
|
+
revised_prompt: import_v48.z.string().optional()
|
|
1687
1677
|
})
|
|
1688
1678
|
)
|
|
1689
1679
|
})
|
|
@@ -1786,32 +1776,32 @@ var import_provider_utils16 = require("@ai-sdk/provider-utils");
|
|
|
1786
1776
|
|
|
1787
1777
|
// src/transcription/openai-transcription-api.ts
|
|
1788
1778
|
var import_provider_utils14 = require("@ai-sdk/provider-utils");
|
|
1789
|
-
var
|
|
1779
|
+
var import_v49 = require("zod/v4");
|
|
1790
1780
|
var openaiTranscriptionResponseSchema = (0, import_provider_utils14.lazyValidator)(
|
|
1791
1781
|
() => (0, import_provider_utils14.zodSchema)(
|
|
1792
|
-
|
|
1793
|
-
text:
|
|
1794
|
-
language:
|
|
1795
|
-
duration:
|
|
1796
|
-
words:
|
|
1797
|
-
|
|
1798
|
-
word:
|
|
1799
|
-
start:
|
|
1800
|
-
end:
|
|
1782
|
+
import_v49.z.object({
|
|
1783
|
+
text: import_v49.z.string(),
|
|
1784
|
+
language: import_v49.z.string().nullish(),
|
|
1785
|
+
duration: import_v49.z.number().nullish(),
|
|
1786
|
+
words: import_v49.z.array(
|
|
1787
|
+
import_v49.z.object({
|
|
1788
|
+
word: import_v49.z.string(),
|
|
1789
|
+
start: import_v49.z.number(),
|
|
1790
|
+
end: import_v49.z.number()
|
|
1801
1791
|
})
|
|
1802
1792
|
).nullish(),
|
|
1803
|
-
segments:
|
|
1804
|
-
|
|
1805
|
-
id:
|
|
1806
|
-
seek:
|
|
1807
|
-
start:
|
|
1808
|
-
end:
|
|
1809
|
-
text:
|
|
1810
|
-
tokens:
|
|
1811
|
-
temperature:
|
|
1812
|
-
avg_logprob:
|
|
1813
|
-
compression_ratio:
|
|
1814
|
-
no_speech_prob:
|
|
1793
|
+
segments: import_v49.z.array(
|
|
1794
|
+
import_v49.z.object({
|
|
1795
|
+
id: import_v49.z.number(),
|
|
1796
|
+
seek: import_v49.z.number(),
|
|
1797
|
+
start: import_v49.z.number(),
|
|
1798
|
+
end: import_v49.z.number(),
|
|
1799
|
+
text: import_v49.z.string(),
|
|
1800
|
+
tokens: import_v49.z.array(import_v49.z.number()),
|
|
1801
|
+
temperature: import_v49.z.number(),
|
|
1802
|
+
avg_logprob: import_v49.z.number(),
|
|
1803
|
+
compression_ratio: import_v49.z.number(),
|
|
1804
|
+
no_speech_prob: import_v49.z.number()
|
|
1815
1805
|
})
|
|
1816
1806
|
).nullish()
|
|
1817
1807
|
})
|
|
@@ -1820,32 +1810,32 @@ var openaiTranscriptionResponseSchema = (0, import_provider_utils14.lazyValidato
|
|
|
1820
1810
|
|
|
1821
1811
|
// src/transcription/openai-transcription-options.ts
|
|
1822
1812
|
var import_provider_utils15 = require("@ai-sdk/provider-utils");
|
|
1823
|
-
var
|
|
1813
|
+
var import_v410 = require("zod/v4");
|
|
1824
1814
|
var openAITranscriptionProviderOptions = (0, import_provider_utils15.lazyValidator)(
|
|
1825
1815
|
() => (0, import_provider_utils15.zodSchema)(
|
|
1826
|
-
|
|
1816
|
+
import_v410.z.object({
|
|
1827
1817
|
/**
|
|
1828
1818
|
* Additional information to include in the transcription response.
|
|
1829
1819
|
*/
|
|
1830
|
-
include:
|
|
1820
|
+
include: import_v410.z.array(import_v410.z.string()).optional(),
|
|
1831
1821
|
/**
|
|
1832
1822
|
* The language of the input audio in ISO-639-1 format.
|
|
1833
1823
|
*/
|
|
1834
|
-
language:
|
|
1824
|
+
language: import_v410.z.string().optional(),
|
|
1835
1825
|
/**
|
|
1836
1826
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
1837
1827
|
*/
|
|
1838
|
-
prompt:
|
|
1828
|
+
prompt: import_v410.z.string().optional(),
|
|
1839
1829
|
/**
|
|
1840
1830
|
* The sampling temperature, between 0 and 1.
|
|
1841
1831
|
* @default 0
|
|
1842
1832
|
*/
|
|
1843
|
-
temperature:
|
|
1833
|
+
temperature: import_v410.z.number().min(0).max(1).default(0).optional(),
|
|
1844
1834
|
/**
|
|
1845
1835
|
* The timestamp granularities to populate for this transcription.
|
|
1846
1836
|
* @default ['segment']
|
|
1847
1837
|
*/
|
|
1848
|
-
timestampGranularities:
|
|
1838
|
+
timestampGranularities: import_v410.z.array(import_v410.z.enum(["word", "segment"])).default(["segment"]).optional()
|
|
1849
1839
|
})
|
|
1850
1840
|
)
|
|
1851
1841
|
);
|
|
@@ -2022,12 +2012,12 @@ var import_provider_utils18 = require("@ai-sdk/provider-utils");
|
|
|
2022
2012
|
|
|
2023
2013
|
// src/speech/openai-speech-options.ts
|
|
2024
2014
|
var import_provider_utils17 = require("@ai-sdk/provider-utils");
|
|
2025
|
-
var
|
|
2015
|
+
var import_v411 = require("zod/v4");
|
|
2026
2016
|
var openaiSpeechProviderOptionsSchema = (0, import_provider_utils17.lazyValidator)(
|
|
2027
2017
|
() => (0, import_provider_utils17.zodSchema)(
|
|
2028
|
-
|
|
2029
|
-
instructions:
|
|
2030
|
-
speed:
|
|
2018
|
+
import_v411.z.object({
|
|
2019
|
+
instructions: import_v411.z.string().nullish(),
|
|
2020
|
+
speed: import_v411.z.number().min(0.25).max(4).default(1).nullish()
|
|
2031
2021
|
})
|
|
2032
2022
|
)
|
|
2033
2023
|
);
|
|
@@ -2140,27 +2130,27 @@ var import_provider_utils29 = require("@ai-sdk/provider-utils");
|
|
|
2140
2130
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2141
2131
|
var import_provider6 = require("@ai-sdk/provider");
|
|
2142
2132
|
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
2143
|
-
var
|
|
2133
|
+
var import_v413 = require("zod/v4");
|
|
2144
2134
|
|
|
2145
2135
|
// src/tool/local-shell.ts
|
|
2146
2136
|
var import_provider_utils19 = require("@ai-sdk/provider-utils");
|
|
2147
|
-
var
|
|
2137
|
+
var import_v412 = require("zod/v4");
|
|
2148
2138
|
var localShellInputSchema = (0, import_provider_utils19.lazySchema)(
|
|
2149
2139
|
() => (0, import_provider_utils19.zodSchema)(
|
|
2150
|
-
|
|
2151
|
-
action:
|
|
2152
|
-
type:
|
|
2153
|
-
command:
|
|
2154
|
-
timeoutMs:
|
|
2155
|
-
user:
|
|
2156
|
-
workingDirectory:
|
|
2157
|
-
env:
|
|
2140
|
+
import_v412.z.object({
|
|
2141
|
+
action: import_v412.z.object({
|
|
2142
|
+
type: import_v412.z.literal("exec"),
|
|
2143
|
+
command: import_v412.z.array(import_v412.z.string()),
|
|
2144
|
+
timeoutMs: import_v412.z.number().optional(),
|
|
2145
|
+
user: import_v412.z.string().optional(),
|
|
2146
|
+
workingDirectory: import_v412.z.string().optional(),
|
|
2147
|
+
env: import_v412.z.record(import_v412.z.string(), import_v412.z.string()).optional()
|
|
2158
2148
|
})
|
|
2159
2149
|
})
|
|
2160
2150
|
)
|
|
2161
2151
|
);
|
|
2162
2152
|
var localShellOutputSchema = (0, import_provider_utils19.lazySchema)(
|
|
2163
|
-
() => (0, import_provider_utils19.zodSchema)(
|
|
2153
|
+
() => (0, import_provider_utils19.zodSchema)(import_v412.z.object({ output: import_v412.z.string() }))
|
|
2164
2154
|
);
|
|
2165
2155
|
var localShell = (0, import_provider_utils19.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
2166
2156
|
id: "openai.local_shell",
|
|
@@ -2391,11 +2381,29 @@ async function convertToOpenAIResponsesInput({
|
|
|
2391
2381
|
case "error-text":
|
|
2392
2382
|
contentValue = output.value;
|
|
2393
2383
|
break;
|
|
2394
|
-
case "content":
|
|
2395
2384
|
case "json":
|
|
2396
2385
|
case "error-json":
|
|
2397
2386
|
contentValue = JSON.stringify(output.value);
|
|
2398
2387
|
break;
|
|
2388
|
+
case "content":
|
|
2389
|
+
contentValue = output.value.map((item) => {
|
|
2390
|
+
switch (item.type) {
|
|
2391
|
+
case "text": {
|
|
2392
|
+
return { type: "input_text", text: item.text };
|
|
2393
|
+
}
|
|
2394
|
+
case "media": {
|
|
2395
|
+
return item.mediaType.startsWith("image/") ? {
|
|
2396
|
+
type: "input_image",
|
|
2397
|
+
image_url: `data:${item.mediaType};base64,${item.data}`
|
|
2398
|
+
} : {
|
|
2399
|
+
type: "input_file",
|
|
2400
|
+
filename: "data",
|
|
2401
|
+
file_data: `data:${item.mediaType};base64,${item.data}`
|
|
2402
|
+
};
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
});
|
|
2406
|
+
break;
|
|
2399
2407
|
}
|
|
2400
2408
|
input.push({
|
|
2401
2409
|
type: "function_call_output",
|
|
@@ -2413,9 +2421,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
2413
2421
|
}
|
|
2414
2422
|
return { input, warnings };
|
|
2415
2423
|
}
|
|
2416
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
2417
|
-
itemId:
|
|
2418
|
-
reasoningEncryptedContent:
|
|
2424
|
+
var openaiResponsesReasoningProviderOptionsSchema = import_v413.z.object({
|
|
2425
|
+
itemId: import_v413.z.string().nullish(),
|
|
2426
|
+
reasoningEncryptedContent: import_v413.z.string().nullish()
|
|
2419
2427
|
});
|
|
2420
2428
|
|
|
2421
2429
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -2438,260 +2446,260 @@ function mapOpenAIResponseFinishReason({
|
|
|
2438
2446
|
|
|
2439
2447
|
// src/responses/openai-responses-api.ts
|
|
2440
2448
|
var import_provider_utils21 = require("@ai-sdk/provider-utils");
|
|
2441
|
-
var
|
|
2449
|
+
var import_v414 = require("zod/v4");
|
|
2442
2450
|
var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
|
|
2443
2451
|
() => (0, import_provider_utils21.zodSchema)(
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
type:
|
|
2447
|
-
item_id:
|
|
2448
|
-
delta:
|
|
2449
|
-
logprobs:
|
|
2450
|
-
|
|
2451
|
-
token:
|
|
2452
|
-
logprob:
|
|
2453
|
-
top_logprobs:
|
|
2454
|
-
|
|
2455
|
-
token:
|
|
2456
|
-
logprob:
|
|
2452
|
+
import_v414.z.union([
|
|
2453
|
+
import_v414.z.object({
|
|
2454
|
+
type: import_v414.z.literal("response.output_text.delta"),
|
|
2455
|
+
item_id: import_v414.z.string(),
|
|
2456
|
+
delta: import_v414.z.string(),
|
|
2457
|
+
logprobs: import_v414.z.array(
|
|
2458
|
+
import_v414.z.object({
|
|
2459
|
+
token: import_v414.z.string(),
|
|
2460
|
+
logprob: import_v414.z.number(),
|
|
2461
|
+
top_logprobs: import_v414.z.array(
|
|
2462
|
+
import_v414.z.object({
|
|
2463
|
+
token: import_v414.z.string(),
|
|
2464
|
+
logprob: import_v414.z.number()
|
|
2457
2465
|
})
|
|
2458
2466
|
)
|
|
2459
2467
|
})
|
|
2460
2468
|
).nullish()
|
|
2461
2469
|
}),
|
|
2462
|
-
|
|
2463
|
-
type:
|
|
2464
|
-
response:
|
|
2465
|
-
incomplete_details:
|
|
2466
|
-
usage:
|
|
2467
|
-
input_tokens:
|
|
2468
|
-
input_tokens_details:
|
|
2469
|
-
output_tokens:
|
|
2470
|
-
output_tokens_details:
|
|
2470
|
+
import_v414.z.object({
|
|
2471
|
+
type: import_v414.z.enum(["response.completed", "response.incomplete"]),
|
|
2472
|
+
response: import_v414.z.object({
|
|
2473
|
+
incomplete_details: import_v414.z.object({ reason: import_v414.z.string() }).nullish(),
|
|
2474
|
+
usage: import_v414.z.object({
|
|
2475
|
+
input_tokens: import_v414.z.number(),
|
|
2476
|
+
input_tokens_details: import_v414.z.object({ cached_tokens: import_v414.z.number().nullish() }).nullish(),
|
|
2477
|
+
output_tokens: import_v414.z.number(),
|
|
2478
|
+
output_tokens_details: import_v414.z.object({ reasoning_tokens: import_v414.z.number().nullish() }).nullish()
|
|
2471
2479
|
}),
|
|
2472
|
-
service_tier:
|
|
2480
|
+
service_tier: import_v414.z.string().nullish()
|
|
2473
2481
|
})
|
|
2474
2482
|
}),
|
|
2475
|
-
|
|
2476
|
-
type:
|
|
2477
|
-
response:
|
|
2478
|
-
id:
|
|
2479
|
-
created_at:
|
|
2480
|
-
model:
|
|
2481
|
-
service_tier:
|
|
2483
|
+
import_v414.z.object({
|
|
2484
|
+
type: import_v414.z.literal("response.created"),
|
|
2485
|
+
response: import_v414.z.object({
|
|
2486
|
+
id: import_v414.z.string(),
|
|
2487
|
+
created_at: import_v414.z.number(),
|
|
2488
|
+
model: import_v414.z.string(),
|
|
2489
|
+
service_tier: import_v414.z.string().nullish()
|
|
2482
2490
|
})
|
|
2483
2491
|
}),
|
|
2484
|
-
|
|
2485
|
-
type:
|
|
2486
|
-
output_index:
|
|
2487
|
-
item:
|
|
2488
|
-
|
|
2489
|
-
type:
|
|
2490
|
-
id:
|
|
2492
|
+
import_v414.z.object({
|
|
2493
|
+
type: import_v414.z.literal("response.output_item.added"),
|
|
2494
|
+
output_index: import_v414.z.number(),
|
|
2495
|
+
item: import_v414.z.discriminatedUnion("type", [
|
|
2496
|
+
import_v414.z.object({
|
|
2497
|
+
type: import_v414.z.literal("message"),
|
|
2498
|
+
id: import_v414.z.string()
|
|
2491
2499
|
}),
|
|
2492
|
-
|
|
2493
|
-
type:
|
|
2494
|
-
id:
|
|
2495
|
-
encrypted_content:
|
|
2500
|
+
import_v414.z.object({
|
|
2501
|
+
type: import_v414.z.literal("reasoning"),
|
|
2502
|
+
id: import_v414.z.string(),
|
|
2503
|
+
encrypted_content: import_v414.z.string().nullish()
|
|
2496
2504
|
}),
|
|
2497
|
-
|
|
2498
|
-
type:
|
|
2499
|
-
id:
|
|
2500
|
-
call_id:
|
|
2501
|
-
name:
|
|
2502
|
-
arguments:
|
|
2505
|
+
import_v414.z.object({
|
|
2506
|
+
type: import_v414.z.literal("function_call"),
|
|
2507
|
+
id: import_v414.z.string(),
|
|
2508
|
+
call_id: import_v414.z.string(),
|
|
2509
|
+
name: import_v414.z.string(),
|
|
2510
|
+
arguments: import_v414.z.string()
|
|
2503
2511
|
}),
|
|
2504
|
-
|
|
2505
|
-
type:
|
|
2506
|
-
id:
|
|
2507
|
-
status:
|
|
2508
|
-
action:
|
|
2509
|
-
type:
|
|
2510
|
-
query:
|
|
2512
|
+
import_v414.z.object({
|
|
2513
|
+
type: import_v414.z.literal("web_search_call"),
|
|
2514
|
+
id: import_v414.z.string(),
|
|
2515
|
+
status: import_v414.z.string(),
|
|
2516
|
+
action: import_v414.z.object({
|
|
2517
|
+
type: import_v414.z.literal("search"),
|
|
2518
|
+
query: import_v414.z.string().optional()
|
|
2511
2519
|
}).nullish()
|
|
2512
2520
|
}),
|
|
2513
|
-
|
|
2514
|
-
type:
|
|
2515
|
-
id:
|
|
2516
|
-
status:
|
|
2521
|
+
import_v414.z.object({
|
|
2522
|
+
type: import_v414.z.literal("computer_call"),
|
|
2523
|
+
id: import_v414.z.string(),
|
|
2524
|
+
status: import_v414.z.string()
|
|
2517
2525
|
}),
|
|
2518
|
-
|
|
2519
|
-
type:
|
|
2520
|
-
id:
|
|
2526
|
+
import_v414.z.object({
|
|
2527
|
+
type: import_v414.z.literal("file_search_call"),
|
|
2528
|
+
id: import_v414.z.string()
|
|
2521
2529
|
}),
|
|
2522
|
-
|
|
2523
|
-
type:
|
|
2524
|
-
id:
|
|
2530
|
+
import_v414.z.object({
|
|
2531
|
+
type: import_v414.z.literal("image_generation_call"),
|
|
2532
|
+
id: import_v414.z.string()
|
|
2525
2533
|
}),
|
|
2526
|
-
|
|
2527
|
-
type:
|
|
2528
|
-
id:
|
|
2529
|
-
container_id:
|
|
2530
|
-
code:
|
|
2531
|
-
outputs:
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2534
|
+
import_v414.z.object({
|
|
2535
|
+
type: import_v414.z.literal("code_interpreter_call"),
|
|
2536
|
+
id: import_v414.z.string(),
|
|
2537
|
+
container_id: import_v414.z.string(),
|
|
2538
|
+
code: import_v414.z.string().nullable(),
|
|
2539
|
+
outputs: import_v414.z.array(
|
|
2540
|
+
import_v414.z.discriminatedUnion("type", [
|
|
2541
|
+
import_v414.z.object({ type: import_v414.z.literal("logs"), logs: import_v414.z.string() }),
|
|
2542
|
+
import_v414.z.object({ type: import_v414.z.literal("image"), url: import_v414.z.string() })
|
|
2535
2543
|
])
|
|
2536
2544
|
).nullable(),
|
|
2537
|
-
status:
|
|
2545
|
+
status: import_v414.z.string()
|
|
2538
2546
|
})
|
|
2539
2547
|
])
|
|
2540
2548
|
}),
|
|
2541
|
-
|
|
2542
|
-
type:
|
|
2543
|
-
output_index:
|
|
2544
|
-
item:
|
|
2545
|
-
|
|
2546
|
-
type:
|
|
2547
|
-
id:
|
|
2549
|
+
import_v414.z.object({
|
|
2550
|
+
type: import_v414.z.literal("response.output_item.done"),
|
|
2551
|
+
output_index: import_v414.z.number(),
|
|
2552
|
+
item: import_v414.z.discriminatedUnion("type", [
|
|
2553
|
+
import_v414.z.object({
|
|
2554
|
+
type: import_v414.z.literal("message"),
|
|
2555
|
+
id: import_v414.z.string()
|
|
2548
2556
|
}),
|
|
2549
|
-
|
|
2550
|
-
type:
|
|
2551
|
-
id:
|
|
2552
|
-
encrypted_content:
|
|
2557
|
+
import_v414.z.object({
|
|
2558
|
+
type: import_v414.z.literal("reasoning"),
|
|
2559
|
+
id: import_v414.z.string(),
|
|
2560
|
+
encrypted_content: import_v414.z.string().nullish()
|
|
2553
2561
|
}),
|
|
2554
|
-
|
|
2555
|
-
type:
|
|
2556
|
-
id:
|
|
2557
|
-
call_id:
|
|
2558
|
-
name:
|
|
2559
|
-
arguments:
|
|
2560
|
-
status:
|
|
2562
|
+
import_v414.z.object({
|
|
2563
|
+
type: import_v414.z.literal("function_call"),
|
|
2564
|
+
id: import_v414.z.string(),
|
|
2565
|
+
call_id: import_v414.z.string(),
|
|
2566
|
+
name: import_v414.z.string(),
|
|
2567
|
+
arguments: import_v414.z.string(),
|
|
2568
|
+
status: import_v414.z.literal("completed")
|
|
2561
2569
|
}),
|
|
2562
|
-
|
|
2563
|
-
type:
|
|
2564
|
-
id:
|
|
2565
|
-
code:
|
|
2566
|
-
container_id:
|
|
2567
|
-
outputs:
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2570
|
+
import_v414.z.object({
|
|
2571
|
+
type: import_v414.z.literal("code_interpreter_call"),
|
|
2572
|
+
id: import_v414.z.string(),
|
|
2573
|
+
code: import_v414.z.string().nullable(),
|
|
2574
|
+
container_id: import_v414.z.string(),
|
|
2575
|
+
outputs: import_v414.z.array(
|
|
2576
|
+
import_v414.z.discriminatedUnion("type", [
|
|
2577
|
+
import_v414.z.object({ type: import_v414.z.literal("logs"), logs: import_v414.z.string() }),
|
|
2578
|
+
import_v414.z.object({ type: import_v414.z.literal("image"), url: import_v414.z.string() })
|
|
2571
2579
|
])
|
|
2572
2580
|
).nullable()
|
|
2573
2581
|
}),
|
|
2574
|
-
|
|
2575
|
-
type:
|
|
2576
|
-
id:
|
|
2577
|
-
result:
|
|
2582
|
+
import_v414.z.object({
|
|
2583
|
+
type: import_v414.z.literal("image_generation_call"),
|
|
2584
|
+
id: import_v414.z.string(),
|
|
2585
|
+
result: import_v414.z.string()
|
|
2578
2586
|
}),
|
|
2579
|
-
|
|
2580
|
-
type:
|
|
2581
|
-
id:
|
|
2582
|
-
status:
|
|
2583
|
-
action:
|
|
2584
|
-
|
|
2585
|
-
type:
|
|
2586
|
-
query:
|
|
2587
|
+
import_v414.z.object({
|
|
2588
|
+
type: import_v414.z.literal("web_search_call"),
|
|
2589
|
+
id: import_v414.z.string(),
|
|
2590
|
+
status: import_v414.z.string(),
|
|
2591
|
+
action: import_v414.z.discriminatedUnion("type", [
|
|
2592
|
+
import_v414.z.object({
|
|
2593
|
+
type: import_v414.z.literal("search"),
|
|
2594
|
+
query: import_v414.z.string().nullish()
|
|
2587
2595
|
}),
|
|
2588
|
-
|
|
2589
|
-
type:
|
|
2590
|
-
url:
|
|
2596
|
+
import_v414.z.object({
|
|
2597
|
+
type: import_v414.z.literal("open_page"),
|
|
2598
|
+
url: import_v414.z.string()
|
|
2591
2599
|
}),
|
|
2592
|
-
|
|
2593
|
-
type:
|
|
2594
|
-
url:
|
|
2595
|
-
pattern:
|
|
2600
|
+
import_v414.z.object({
|
|
2601
|
+
type: import_v414.z.literal("find"),
|
|
2602
|
+
url: import_v414.z.string(),
|
|
2603
|
+
pattern: import_v414.z.string()
|
|
2596
2604
|
})
|
|
2597
2605
|
]).nullish()
|
|
2598
2606
|
}),
|
|
2599
|
-
|
|
2600
|
-
type:
|
|
2601
|
-
id:
|
|
2602
|
-
queries:
|
|
2603
|
-
results:
|
|
2604
|
-
|
|
2605
|
-
attributes:
|
|
2606
|
-
file_id:
|
|
2607
|
-
filename:
|
|
2608
|
-
score:
|
|
2609
|
-
text:
|
|
2607
|
+
import_v414.z.object({
|
|
2608
|
+
type: import_v414.z.literal("file_search_call"),
|
|
2609
|
+
id: import_v414.z.string(),
|
|
2610
|
+
queries: import_v414.z.array(import_v414.z.string()),
|
|
2611
|
+
results: import_v414.z.array(
|
|
2612
|
+
import_v414.z.object({
|
|
2613
|
+
attributes: import_v414.z.record(import_v414.z.string(), import_v414.z.unknown()),
|
|
2614
|
+
file_id: import_v414.z.string(),
|
|
2615
|
+
filename: import_v414.z.string(),
|
|
2616
|
+
score: import_v414.z.number(),
|
|
2617
|
+
text: import_v414.z.string()
|
|
2610
2618
|
})
|
|
2611
2619
|
).nullish()
|
|
2612
2620
|
}),
|
|
2613
|
-
|
|
2614
|
-
type:
|
|
2615
|
-
id:
|
|
2616
|
-
call_id:
|
|
2617
|
-
action:
|
|
2618
|
-
type:
|
|
2619
|
-
command:
|
|
2620
|
-
timeout_ms:
|
|
2621
|
-
user:
|
|
2622
|
-
working_directory:
|
|
2623
|
-
env:
|
|
2621
|
+
import_v414.z.object({
|
|
2622
|
+
type: import_v414.z.literal("local_shell_call"),
|
|
2623
|
+
id: import_v414.z.string(),
|
|
2624
|
+
call_id: import_v414.z.string(),
|
|
2625
|
+
action: import_v414.z.object({
|
|
2626
|
+
type: import_v414.z.literal("exec"),
|
|
2627
|
+
command: import_v414.z.array(import_v414.z.string()),
|
|
2628
|
+
timeout_ms: import_v414.z.number().optional(),
|
|
2629
|
+
user: import_v414.z.string().optional(),
|
|
2630
|
+
working_directory: import_v414.z.string().optional(),
|
|
2631
|
+
env: import_v414.z.record(import_v414.z.string(), import_v414.z.string()).optional()
|
|
2624
2632
|
})
|
|
2625
2633
|
}),
|
|
2626
|
-
|
|
2627
|
-
type:
|
|
2628
|
-
id:
|
|
2629
|
-
status:
|
|
2634
|
+
import_v414.z.object({
|
|
2635
|
+
type: import_v414.z.literal("computer_call"),
|
|
2636
|
+
id: import_v414.z.string(),
|
|
2637
|
+
status: import_v414.z.literal("completed")
|
|
2630
2638
|
})
|
|
2631
2639
|
])
|
|
2632
2640
|
}),
|
|
2633
|
-
|
|
2634
|
-
type:
|
|
2635
|
-
item_id:
|
|
2636
|
-
output_index:
|
|
2637
|
-
delta:
|
|
2641
|
+
import_v414.z.object({
|
|
2642
|
+
type: import_v414.z.literal("response.function_call_arguments.delta"),
|
|
2643
|
+
item_id: import_v414.z.string(),
|
|
2644
|
+
output_index: import_v414.z.number(),
|
|
2645
|
+
delta: import_v414.z.string()
|
|
2638
2646
|
}),
|
|
2639
|
-
|
|
2640
|
-
type:
|
|
2641
|
-
item_id:
|
|
2642
|
-
output_index:
|
|
2643
|
-
partial_image_b64:
|
|
2647
|
+
import_v414.z.object({
|
|
2648
|
+
type: import_v414.z.literal("response.image_generation_call.partial_image"),
|
|
2649
|
+
item_id: import_v414.z.string(),
|
|
2650
|
+
output_index: import_v414.z.number(),
|
|
2651
|
+
partial_image_b64: import_v414.z.string()
|
|
2644
2652
|
}),
|
|
2645
|
-
|
|
2646
|
-
type:
|
|
2647
|
-
item_id:
|
|
2648
|
-
output_index:
|
|
2649
|
-
delta:
|
|
2653
|
+
import_v414.z.object({
|
|
2654
|
+
type: import_v414.z.literal("response.code_interpreter_call_code.delta"),
|
|
2655
|
+
item_id: import_v414.z.string(),
|
|
2656
|
+
output_index: import_v414.z.number(),
|
|
2657
|
+
delta: import_v414.z.string()
|
|
2650
2658
|
}),
|
|
2651
|
-
|
|
2652
|
-
type:
|
|
2653
|
-
item_id:
|
|
2654
|
-
output_index:
|
|
2655
|
-
code:
|
|
2659
|
+
import_v414.z.object({
|
|
2660
|
+
type: import_v414.z.literal("response.code_interpreter_call_code.done"),
|
|
2661
|
+
item_id: import_v414.z.string(),
|
|
2662
|
+
output_index: import_v414.z.number(),
|
|
2663
|
+
code: import_v414.z.string()
|
|
2656
2664
|
}),
|
|
2657
|
-
|
|
2658
|
-
type:
|
|
2659
|
-
annotation:
|
|
2660
|
-
|
|
2661
|
-
type:
|
|
2662
|
-
url:
|
|
2663
|
-
title:
|
|
2665
|
+
import_v414.z.object({
|
|
2666
|
+
type: import_v414.z.literal("response.output_text.annotation.added"),
|
|
2667
|
+
annotation: import_v414.z.discriminatedUnion("type", [
|
|
2668
|
+
import_v414.z.object({
|
|
2669
|
+
type: import_v414.z.literal("url_citation"),
|
|
2670
|
+
url: import_v414.z.string(),
|
|
2671
|
+
title: import_v414.z.string()
|
|
2664
2672
|
}),
|
|
2665
|
-
|
|
2666
|
-
type:
|
|
2667
|
-
file_id:
|
|
2668
|
-
filename:
|
|
2669
|
-
index:
|
|
2670
|
-
start_index:
|
|
2671
|
-
end_index:
|
|
2672
|
-
quote:
|
|
2673
|
+
import_v414.z.object({
|
|
2674
|
+
type: import_v414.z.literal("file_citation"),
|
|
2675
|
+
file_id: import_v414.z.string(),
|
|
2676
|
+
filename: import_v414.z.string().nullish(),
|
|
2677
|
+
index: import_v414.z.number().nullish(),
|
|
2678
|
+
start_index: import_v414.z.number().nullish(),
|
|
2679
|
+
end_index: import_v414.z.number().nullish(),
|
|
2680
|
+
quote: import_v414.z.string().nullish()
|
|
2673
2681
|
})
|
|
2674
2682
|
])
|
|
2675
2683
|
}),
|
|
2676
|
-
|
|
2677
|
-
type:
|
|
2678
|
-
item_id:
|
|
2679
|
-
summary_index:
|
|
2684
|
+
import_v414.z.object({
|
|
2685
|
+
type: import_v414.z.literal("response.reasoning_summary_part.added"),
|
|
2686
|
+
item_id: import_v414.z.string(),
|
|
2687
|
+
summary_index: import_v414.z.number()
|
|
2680
2688
|
}),
|
|
2681
|
-
|
|
2682
|
-
type:
|
|
2683
|
-
item_id:
|
|
2684
|
-
summary_index:
|
|
2685
|
-
delta:
|
|
2689
|
+
import_v414.z.object({
|
|
2690
|
+
type: import_v414.z.literal("response.reasoning_summary_text.delta"),
|
|
2691
|
+
item_id: import_v414.z.string(),
|
|
2692
|
+
summary_index: import_v414.z.number(),
|
|
2693
|
+
delta: import_v414.z.string()
|
|
2686
2694
|
}),
|
|
2687
|
-
|
|
2688
|
-
type:
|
|
2689
|
-
code:
|
|
2690
|
-
message:
|
|
2691
|
-
param:
|
|
2692
|
-
sequence_number:
|
|
2695
|
+
import_v414.z.object({
|
|
2696
|
+
type: import_v414.z.literal("error"),
|
|
2697
|
+
code: import_v414.z.string(),
|
|
2698
|
+
message: import_v414.z.string(),
|
|
2699
|
+
param: import_v414.z.string().nullish(),
|
|
2700
|
+
sequence_number: import_v414.z.number()
|
|
2693
2701
|
}),
|
|
2694
|
-
|
|
2702
|
+
import_v414.z.object({ type: import_v414.z.string() }).loose().transform((value) => ({
|
|
2695
2703
|
type: "unknown_chunk",
|
|
2696
2704
|
message: value.type
|
|
2697
2705
|
}))
|
|
@@ -2701,158 +2709,158 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
|
|
|
2701
2709
|
);
|
|
2702
2710
|
var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
|
|
2703
2711
|
() => (0, import_provider_utils21.zodSchema)(
|
|
2704
|
-
|
|
2705
|
-
id:
|
|
2706
|
-
created_at:
|
|
2707
|
-
error:
|
|
2708
|
-
code:
|
|
2709
|
-
message:
|
|
2712
|
+
import_v414.z.object({
|
|
2713
|
+
id: import_v414.z.string(),
|
|
2714
|
+
created_at: import_v414.z.number(),
|
|
2715
|
+
error: import_v414.z.object({
|
|
2716
|
+
code: import_v414.z.string(),
|
|
2717
|
+
message: import_v414.z.string()
|
|
2710
2718
|
}).nullish(),
|
|
2711
|
-
model:
|
|
2712
|
-
output:
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
type:
|
|
2716
|
-
role:
|
|
2717
|
-
id:
|
|
2718
|
-
content:
|
|
2719
|
-
|
|
2720
|
-
type:
|
|
2721
|
-
text:
|
|
2722
|
-
logprobs:
|
|
2723
|
-
|
|
2724
|
-
token:
|
|
2725
|
-
logprob:
|
|
2726
|
-
top_logprobs:
|
|
2727
|
-
|
|
2728
|
-
token:
|
|
2729
|
-
logprob:
|
|
2719
|
+
model: import_v414.z.string(),
|
|
2720
|
+
output: import_v414.z.array(
|
|
2721
|
+
import_v414.z.discriminatedUnion("type", [
|
|
2722
|
+
import_v414.z.object({
|
|
2723
|
+
type: import_v414.z.literal("message"),
|
|
2724
|
+
role: import_v414.z.literal("assistant"),
|
|
2725
|
+
id: import_v414.z.string(),
|
|
2726
|
+
content: import_v414.z.array(
|
|
2727
|
+
import_v414.z.object({
|
|
2728
|
+
type: import_v414.z.literal("output_text"),
|
|
2729
|
+
text: import_v414.z.string(),
|
|
2730
|
+
logprobs: import_v414.z.array(
|
|
2731
|
+
import_v414.z.object({
|
|
2732
|
+
token: import_v414.z.string(),
|
|
2733
|
+
logprob: import_v414.z.number(),
|
|
2734
|
+
top_logprobs: import_v414.z.array(
|
|
2735
|
+
import_v414.z.object({
|
|
2736
|
+
token: import_v414.z.string(),
|
|
2737
|
+
logprob: import_v414.z.number()
|
|
2730
2738
|
})
|
|
2731
2739
|
)
|
|
2732
2740
|
})
|
|
2733
2741
|
).nullish(),
|
|
2734
|
-
annotations:
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
type:
|
|
2738
|
-
start_index:
|
|
2739
|
-
end_index:
|
|
2740
|
-
url:
|
|
2741
|
-
title:
|
|
2742
|
+
annotations: import_v414.z.array(
|
|
2743
|
+
import_v414.z.discriminatedUnion("type", [
|
|
2744
|
+
import_v414.z.object({
|
|
2745
|
+
type: import_v414.z.literal("url_citation"),
|
|
2746
|
+
start_index: import_v414.z.number(),
|
|
2747
|
+
end_index: import_v414.z.number(),
|
|
2748
|
+
url: import_v414.z.string(),
|
|
2749
|
+
title: import_v414.z.string()
|
|
2742
2750
|
}),
|
|
2743
|
-
|
|
2744
|
-
type:
|
|
2745
|
-
file_id:
|
|
2746
|
-
filename:
|
|
2747
|
-
index:
|
|
2748
|
-
start_index:
|
|
2749
|
-
end_index:
|
|
2750
|
-
quote:
|
|
2751
|
+
import_v414.z.object({
|
|
2752
|
+
type: import_v414.z.literal("file_citation"),
|
|
2753
|
+
file_id: import_v414.z.string(),
|
|
2754
|
+
filename: import_v414.z.string().nullish(),
|
|
2755
|
+
index: import_v414.z.number().nullish(),
|
|
2756
|
+
start_index: import_v414.z.number().nullish(),
|
|
2757
|
+
end_index: import_v414.z.number().nullish(),
|
|
2758
|
+
quote: import_v414.z.string().nullish()
|
|
2751
2759
|
}),
|
|
2752
|
-
|
|
2753
|
-
type:
|
|
2760
|
+
import_v414.z.object({
|
|
2761
|
+
type: import_v414.z.literal("container_file_citation")
|
|
2754
2762
|
})
|
|
2755
2763
|
])
|
|
2756
2764
|
)
|
|
2757
2765
|
})
|
|
2758
2766
|
)
|
|
2759
2767
|
}),
|
|
2760
|
-
|
|
2761
|
-
type:
|
|
2762
|
-
id:
|
|
2763
|
-
status:
|
|
2764
|
-
action:
|
|
2765
|
-
|
|
2766
|
-
type:
|
|
2767
|
-
query:
|
|
2768
|
+
import_v414.z.object({
|
|
2769
|
+
type: import_v414.z.literal("web_search_call"),
|
|
2770
|
+
id: import_v414.z.string(),
|
|
2771
|
+
status: import_v414.z.string(),
|
|
2772
|
+
action: import_v414.z.discriminatedUnion("type", [
|
|
2773
|
+
import_v414.z.object({
|
|
2774
|
+
type: import_v414.z.literal("search"),
|
|
2775
|
+
query: import_v414.z.string().nullish()
|
|
2768
2776
|
}),
|
|
2769
|
-
|
|
2770
|
-
type:
|
|
2771
|
-
url:
|
|
2777
|
+
import_v414.z.object({
|
|
2778
|
+
type: import_v414.z.literal("open_page"),
|
|
2779
|
+
url: import_v414.z.string()
|
|
2772
2780
|
}),
|
|
2773
|
-
|
|
2774
|
-
type:
|
|
2775
|
-
url:
|
|
2776
|
-
pattern:
|
|
2781
|
+
import_v414.z.object({
|
|
2782
|
+
type: import_v414.z.literal("find"),
|
|
2783
|
+
url: import_v414.z.string(),
|
|
2784
|
+
pattern: import_v414.z.string()
|
|
2777
2785
|
})
|
|
2778
2786
|
]).nullish()
|
|
2779
2787
|
}),
|
|
2780
|
-
|
|
2781
|
-
type:
|
|
2782
|
-
id:
|
|
2783
|
-
queries:
|
|
2784
|
-
results:
|
|
2785
|
-
|
|
2786
|
-
attributes:
|
|
2787
|
-
file_id:
|
|
2788
|
-
filename:
|
|
2789
|
-
score:
|
|
2790
|
-
text:
|
|
2788
|
+
import_v414.z.object({
|
|
2789
|
+
type: import_v414.z.literal("file_search_call"),
|
|
2790
|
+
id: import_v414.z.string(),
|
|
2791
|
+
queries: import_v414.z.array(import_v414.z.string()),
|
|
2792
|
+
results: import_v414.z.array(
|
|
2793
|
+
import_v414.z.object({
|
|
2794
|
+
attributes: import_v414.z.record(import_v414.z.string(), import_v414.z.unknown()),
|
|
2795
|
+
file_id: import_v414.z.string(),
|
|
2796
|
+
filename: import_v414.z.string(),
|
|
2797
|
+
score: import_v414.z.number(),
|
|
2798
|
+
text: import_v414.z.string()
|
|
2791
2799
|
})
|
|
2792
2800
|
).nullish()
|
|
2793
2801
|
}),
|
|
2794
|
-
|
|
2795
|
-
type:
|
|
2796
|
-
id:
|
|
2797
|
-
code:
|
|
2798
|
-
container_id:
|
|
2799
|
-
outputs:
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2802
|
+
import_v414.z.object({
|
|
2803
|
+
type: import_v414.z.literal("code_interpreter_call"),
|
|
2804
|
+
id: import_v414.z.string(),
|
|
2805
|
+
code: import_v414.z.string().nullable(),
|
|
2806
|
+
container_id: import_v414.z.string(),
|
|
2807
|
+
outputs: import_v414.z.array(
|
|
2808
|
+
import_v414.z.discriminatedUnion("type", [
|
|
2809
|
+
import_v414.z.object({ type: import_v414.z.literal("logs"), logs: import_v414.z.string() }),
|
|
2810
|
+
import_v414.z.object({ type: import_v414.z.literal("image"), url: import_v414.z.string() })
|
|
2803
2811
|
])
|
|
2804
2812
|
).nullable()
|
|
2805
2813
|
}),
|
|
2806
|
-
|
|
2807
|
-
type:
|
|
2808
|
-
id:
|
|
2809
|
-
result:
|
|
2814
|
+
import_v414.z.object({
|
|
2815
|
+
type: import_v414.z.literal("image_generation_call"),
|
|
2816
|
+
id: import_v414.z.string(),
|
|
2817
|
+
result: import_v414.z.string()
|
|
2810
2818
|
}),
|
|
2811
|
-
|
|
2812
|
-
type:
|
|
2813
|
-
id:
|
|
2814
|
-
call_id:
|
|
2815
|
-
action:
|
|
2816
|
-
type:
|
|
2817
|
-
command:
|
|
2818
|
-
timeout_ms:
|
|
2819
|
-
user:
|
|
2820
|
-
working_directory:
|
|
2821
|
-
env:
|
|
2819
|
+
import_v414.z.object({
|
|
2820
|
+
type: import_v414.z.literal("local_shell_call"),
|
|
2821
|
+
id: import_v414.z.string(),
|
|
2822
|
+
call_id: import_v414.z.string(),
|
|
2823
|
+
action: import_v414.z.object({
|
|
2824
|
+
type: import_v414.z.literal("exec"),
|
|
2825
|
+
command: import_v414.z.array(import_v414.z.string()),
|
|
2826
|
+
timeout_ms: import_v414.z.number().optional(),
|
|
2827
|
+
user: import_v414.z.string().optional(),
|
|
2828
|
+
working_directory: import_v414.z.string().optional(),
|
|
2829
|
+
env: import_v414.z.record(import_v414.z.string(), import_v414.z.string()).optional()
|
|
2822
2830
|
})
|
|
2823
2831
|
}),
|
|
2824
|
-
|
|
2825
|
-
type:
|
|
2826
|
-
call_id:
|
|
2827
|
-
name:
|
|
2828
|
-
arguments:
|
|
2829
|
-
id:
|
|
2832
|
+
import_v414.z.object({
|
|
2833
|
+
type: import_v414.z.literal("function_call"),
|
|
2834
|
+
call_id: import_v414.z.string(),
|
|
2835
|
+
name: import_v414.z.string(),
|
|
2836
|
+
arguments: import_v414.z.string(),
|
|
2837
|
+
id: import_v414.z.string()
|
|
2830
2838
|
}),
|
|
2831
|
-
|
|
2832
|
-
type:
|
|
2833
|
-
id:
|
|
2834
|
-
status:
|
|
2839
|
+
import_v414.z.object({
|
|
2840
|
+
type: import_v414.z.literal("computer_call"),
|
|
2841
|
+
id: import_v414.z.string(),
|
|
2842
|
+
status: import_v414.z.string().optional()
|
|
2835
2843
|
}),
|
|
2836
|
-
|
|
2837
|
-
type:
|
|
2838
|
-
id:
|
|
2839
|
-
encrypted_content:
|
|
2840
|
-
summary:
|
|
2841
|
-
|
|
2842
|
-
type:
|
|
2843
|
-
text:
|
|
2844
|
+
import_v414.z.object({
|
|
2845
|
+
type: import_v414.z.literal("reasoning"),
|
|
2846
|
+
id: import_v414.z.string(),
|
|
2847
|
+
encrypted_content: import_v414.z.string().nullish(),
|
|
2848
|
+
summary: import_v414.z.array(
|
|
2849
|
+
import_v414.z.object({
|
|
2850
|
+
type: import_v414.z.literal("summary_text"),
|
|
2851
|
+
text: import_v414.z.string()
|
|
2844
2852
|
})
|
|
2845
2853
|
)
|
|
2846
2854
|
})
|
|
2847
2855
|
])
|
|
2848
2856
|
),
|
|
2849
|
-
service_tier:
|
|
2850
|
-
incomplete_details:
|
|
2851
|
-
usage:
|
|
2852
|
-
input_tokens:
|
|
2853
|
-
input_tokens_details:
|
|
2854
|
-
output_tokens:
|
|
2855
|
-
output_tokens_details:
|
|
2857
|
+
service_tier: import_v414.z.string().nullish(),
|
|
2858
|
+
incomplete_details: import_v414.z.object({ reason: import_v414.z.string() }).nullish(),
|
|
2859
|
+
usage: import_v414.z.object({
|
|
2860
|
+
input_tokens: import_v414.z.number(),
|
|
2861
|
+
input_tokens_details: import_v414.z.object({ cached_tokens: import_v414.z.number().nullish() }).nullish(),
|
|
2862
|
+
output_tokens: import_v414.z.number(),
|
|
2863
|
+
output_tokens_details: import_v414.z.object({ reasoning_tokens: import_v414.z.number().nullish() }).nullish()
|
|
2856
2864
|
})
|
|
2857
2865
|
})
|
|
2858
2866
|
)
|
|
@@ -2860,7 +2868,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
|
|
|
2860
2868
|
|
|
2861
2869
|
// src/responses/openai-responses-options.ts
|
|
2862
2870
|
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
2863
|
-
var
|
|
2871
|
+
var import_v415 = require("zod/v4");
|
|
2864
2872
|
var TOP_LOGPROBS_MAX = 20;
|
|
2865
2873
|
var openaiResponsesReasoningModelIds = [
|
|
2866
2874
|
"o1",
|
|
@@ -2921,15 +2929,15 @@ var openaiResponsesModelIds = [
|
|
|
2921
2929
|
];
|
|
2922
2930
|
var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazyValidator)(
|
|
2923
2931
|
() => (0, import_provider_utils22.zodSchema)(
|
|
2924
|
-
|
|
2925
|
-
include:
|
|
2926
|
-
|
|
2932
|
+
import_v415.z.object({
|
|
2933
|
+
include: import_v415.z.array(
|
|
2934
|
+
import_v415.z.enum([
|
|
2927
2935
|
"reasoning.encrypted_content",
|
|
2928
2936
|
"file_search_call.results",
|
|
2929
2937
|
"message.output_text.logprobs"
|
|
2930
2938
|
])
|
|
2931
2939
|
).nullish(),
|
|
2932
|
-
instructions:
|
|
2940
|
+
instructions: import_v415.z.string().nullish(),
|
|
2933
2941
|
/**
|
|
2934
2942
|
* Return the log probabilities of the tokens.
|
|
2935
2943
|
*
|
|
@@ -2942,25 +2950,25 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazyValid
|
|
|
2942
2950
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
2943
2951
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
2944
2952
|
*/
|
|
2945
|
-
logprobs:
|
|
2953
|
+
logprobs: import_v415.z.union([import_v415.z.boolean(), import_v415.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
2946
2954
|
/**
|
|
2947
2955
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
2948
2956
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
2949
2957
|
* Any further attempts to call a tool by the model will be ignored.
|
|
2950
2958
|
*/
|
|
2951
|
-
maxToolCalls:
|
|
2952
|
-
metadata:
|
|
2953
|
-
parallelToolCalls:
|
|
2954
|
-
previousResponseId:
|
|
2955
|
-
promptCacheKey:
|
|
2956
|
-
reasoningEffort:
|
|
2957
|
-
reasoningSummary:
|
|
2958
|
-
safetyIdentifier:
|
|
2959
|
-
serviceTier:
|
|
2960
|
-
store:
|
|
2961
|
-
strictJsonSchema:
|
|
2962
|
-
textVerbosity:
|
|
2963
|
-
user:
|
|
2959
|
+
maxToolCalls: import_v415.z.number().nullish(),
|
|
2960
|
+
metadata: import_v415.z.any().nullish(),
|
|
2961
|
+
parallelToolCalls: import_v415.z.boolean().nullish(),
|
|
2962
|
+
previousResponseId: import_v415.z.string().nullish(),
|
|
2963
|
+
promptCacheKey: import_v415.z.string().nullish(),
|
|
2964
|
+
reasoningEffort: import_v415.z.string().nullish(),
|
|
2965
|
+
reasoningSummary: import_v415.z.string().nullish(),
|
|
2966
|
+
safetyIdentifier: import_v415.z.string().nullish(),
|
|
2967
|
+
serviceTier: import_v415.z.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
2968
|
+
store: import_v415.z.boolean().nullish(),
|
|
2969
|
+
strictJsonSchema: import_v415.z.boolean().nullish(),
|
|
2970
|
+
textVerbosity: import_v415.z.enum(["low", "medium", "high"]).nullish(),
|
|
2971
|
+
user: import_v415.z.string().nullish()
|
|
2964
2972
|
})
|
|
2965
2973
|
)
|
|
2966
2974
|
);
|
|
@@ -2970,22 +2978,22 @@ var import_provider7 = require("@ai-sdk/provider");
|
|
|
2970
2978
|
|
|
2971
2979
|
// src/tool/code-interpreter.ts
|
|
2972
2980
|
var import_provider_utils23 = require("@ai-sdk/provider-utils");
|
|
2973
|
-
var
|
|
2981
|
+
var import_v416 = require("zod/v4");
|
|
2974
2982
|
var codeInterpreterInputSchema = (0, import_provider_utils23.lazySchema)(
|
|
2975
2983
|
() => (0, import_provider_utils23.zodSchema)(
|
|
2976
|
-
|
|
2977
|
-
code:
|
|
2978
|
-
containerId:
|
|
2984
|
+
import_v416.z.object({
|
|
2985
|
+
code: import_v416.z.string().nullish(),
|
|
2986
|
+
containerId: import_v416.z.string()
|
|
2979
2987
|
})
|
|
2980
2988
|
)
|
|
2981
2989
|
);
|
|
2982
2990
|
var codeInterpreterOutputSchema = (0, import_provider_utils23.lazySchema)(
|
|
2983
2991
|
() => (0, import_provider_utils23.zodSchema)(
|
|
2984
|
-
|
|
2985
|
-
outputs:
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2992
|
+
import_v416.z.object({
|
|
2993
|
+
outputs: import_v416.z.array(
|
|
2994
|
+
import_v416.z.discriminatedUnion("type", [
|
|
2995
|
+
import_v416.z.object({ type: import_v416.z.literal("logs"), logs: import_v416.z.string() }),
|
|
2996
|
+
import_v416.z.object({ type: import_v416.z.literal("image"), url: import_v416.z.string() })
|
|
2989
2997
|
])
|
|
2990
2998
|
).nullish()
|
|
2991
2999
|
})
|
|
@@ -2993,11 +3001,11 @@ var codeInterpreterOutputSchema = (0, import_provider_utils23.lazySchema)(
|
|
|
2993
3001
|
);
|
|
2994
3002
|
var codeInterpreterArgsSchema = (0, import_provider_utils23.lazySchema)(
|
|
2995
3003
|
() => (0, import_provider_utils23.zodSchema)(
|
|
2996
|
-
|
|
2997
|
-
container:
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
fileIds:
|
|
3004
|
+
import_v416.z.object({
|
|
3005
|
+
container: import_v416.z.union([
|
|
3006
|
+
import_v416.z.string(),
|
|
3007
|
+
import_v416.z.object({
|
|
3008
|
+
fileIds: import_v416.z.array(import_v416.z.string()).optional()
|
|
3001
3009
|
})
|
|
3002
3010
|
]).optional()
|
|
3003
3011
|
})
|
|
@@ -3015,42 +3023,42 @@ var codeInterpreter = (args = {}) => {
|
|
|
3015
3023
|
|
|
3016
3024
|
// src/tool/file-search.ts
|
|
3017
3025
|
var import_provider_utils24 = require("@ai-sdk/provider-utils");
|
|
3018
|
-
var
|
|
3019
|
-
var comparisonFilterSchema =
|
|
3020
|
-
key:
|
|
3021
|
-
type:
|
|
3022
|
-
value:
|
|
3026
|
+
var import_v417 = require("zod/v4");
|
|
3027
|
+
var comparisonFilterSchema = import_v417.z.object({
|
|
3028
|
+
key: import_v417.z.string(),
|
|
3029
|
+
type: import_v417.z.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
|
|
3030
|
+
value: import_v417.z.union([import_v417.z.string(), import_v417.z.number(), import_v417.z.boolean()])
|
|
3023
3031
|
});
|
|
3024
|
-
var compoundFilterSchema =
|
|
3025
|
-
type:
|
|
3026
|
-
filters:
|
|
3027
|
-
|
|
3032
|
+
var compoundFilterSchema = import_v417.z.object({
|
|
3033
|
+
type: import_v417.z.enum(["and", "or"]),
|
|
3034
|
+
filters: import_v417.z.array(
|
|
3035
|
+
import_v417.z.union([comparisonFilterSchema, import_v417.z.lazy(() => compoundFilterSchema)])
|
|
3028
3036
|
)
|
|
3029
3037
|
});
|
|
3030
3038
|
var fileSearchArgsSchema = (0, import_provider_utils24.lazySchema)(
|
|
3031
3039
|
() => (0, import_provider_utils24.zodSchema)(
|
|
3032
|
-
|
|
3033
|
-
vectorStoreIds:
|
|
3034
|
-
maxNumResults:
|
|
3035
|
-
ranking:
|
|
3036
|
-
ranker:
|
|
3037
|
-
scoreThreshold:
|
|
3040
|
+
import_v417.z.object({
|
|
3041
|
+
vectorStoreIds: import_v417.z.array(import_v417.z.string()),
|
|
3042
|
+
maxNumResults: import_v417.z.number().optional(),
|
|
3043
|
+
ranking: import_v417.z.object({
|
|
3044
|
+
ranker: import_v417.z.string().optional(),
|
|
3045
|
+
scoreThreshold: import_v417.z.number().optional()
|
|
3038
3046
|
}).optional(),
|
|
3039
|
-
filters:
|
|
3047
|
+
filters: import_v417.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
3040
3048
|
})
|
|
3041
3049
|
)
|
|
3042
3050
|
);
|
|
3043
3051
|
var fileSearchOutputSchema = (0, import_provider_utils24.lazySchema)(
|
|
3044
3052
|
() => (0, import_provider_utils24.zodSchema)(
|
|
3045
|
-
|
|
3046
|
-
queries:
|
|
3047
|
-
results:
|
|
3048
|
-
|
|
3049
|
-
attributes:
|
|
3050
|
-
fileId:
|
|
3051
|
-
filename:
|
|
3052
|
-
score:
|
|
3053
|
-
text:
|
|
3053
|
+
import_v417.z.object({
|
|
3054
|
+
queries: import_v417.z.array(import_v417.z.string()),
|
|
3055
|
+
results: import_v417.z.array(
|
|
3056
|
+
import_v417.z.object({
|
|
3057
|
+
attributes: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()),
|
|
3058
|
+
fileId: import_v417.z.string(),
|
|
3059
|
+
filename: import_v417.z.string(),
|
|
3060
|
+
score: import_v417.z.number(),
|
|
3061
|
+
text: import_v417.z.string()
|
|
3054
3062
|
})
|
|
3055
3063
|
).nullable()
|
|
3056
3064
|
})
|
|
@@ -3059,46 +3067,46 @@ var fileSearchOutputSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
3059
3067
|
var fileSearch = (0, import_provider_utils24.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
3060
3068
|
id: "openai.file_search",
|
|
3061
3069
|
name: "file_search",
|
|
3062
|
-
inputSchema:
|
|
3070
|
+
inputSchema: import_v417.z.object({}),
|
|
3063
3071
|
outputSchema: fileSearchOutputSchema
|
|
3064
3072
|
});
|
|
3065
3073
|
|
|
3066
3074
|
// src/tool/web-search.ts
|
|
3067
3075
|
var import_provider_utils25 = require("@ai-sdk/provider-utils");
|
|
3068
|
-
var
|
|
3076
|
+
var import_v418 = require("zod/v4");
|
|
3069
3077
|
var webSearchArgsSchema = (0, import_provider_utils25.lazySchema)(
|
|
3070
3078
|
() => (0, import_provider_utils25.zodSchema)(
|
|
3071
|
-
|
|
3072
|
-
filters:
|
|
3073
|
-
allowedDomains:
|
|
3079
|
+
import_v418.z.object({
|
|
3080
|
+
filters: import_v418.z.object({
|
|
3081
|
+
allowedDomains: import_v418.z.array(import_v418.z.string()).optional()
|
|
3074
3082
|
}).optional(),
|
|
3075
|
-
searchContextSize:
|
|
3076
|
-
userLocation:
|
|
3077
|
-
type:
|
|
3078
|
-
country:
|
|
3079
|
-
city:
|
|
3080
|
-
region:
|
|
3081
|
-
timezone:
|
|
3083
|
+
searchContextSize: import_v418.z.enum(["low", "medium", "high"]).optional(),
|
|
3084
|
+
userLocation: import_v418.z.object({
|
|
3085
|
+
type: import_v418.z.literal("approximate"),
|
|
3086
|
+
country: import_v418.z.string().optional(),
|
|
3087
|
+
city: import_v418.z.string().optional(),
|
|
3088
|
+
region: import_v418.z.string().optional(),
|
|
3089
|
+
timezone: import_v418.z.string().optional()
|
|
3082
3090
|
}).optional()
|
|
3083
3091
|
})
|
|
3084
3092
|
)
|
|
3085
3093
|
);
|
|
3086
3094
|
var webSearchInputSchema = (0, import_provider_utils25.lazySchema)(
|
|
3087
3095
|
() => (0, import_provider_utils25.zodSchema)(
|
|
3088
|
-
|
|
3089
|
-
action:
|
|
3090
|
-
|
|
3091
|
-
type:
|
|
3092
|
-
query:
|
|
3096
|
+
import_v418.z.object({
|
|
3097
|
+
action: import_v418.z.discriminatedUnion("type", [
|
|
3098
|
+
import_v418.z.object({
|
|
3099
|
+
type: import_v418.z.literal("search"),
|
|
3100
|
+
query: import_v418.z.string().nullish()
|
|
3093
3101
|
}),
|
|
3094
|
-
|
|
3095
|
-
type:
|
|
3096
|
-
url:
|
|
3102
|
+
import_v418.z.object({
|
|
3103
|
+
type: import_v418.z.literal("open_page"),
|
|
3104
|
+
url: import_v418.z.string()
|
|
3097
3105
|
}),
|
|
3098
|
-
|
|
3099
|
-
type:
|
|
3100
|
-
url:
|
|
3101
|
-
pattern:
|
|
3106
|
+
import_v418.z.object({
|
|
3107
|
+
type: import_v418.z.literal("find"),
|
|
3108
|
+
url: import_v418.z.string(),
|
|
3109
|
+
pattern: import_v418.z.string()
|
|
3102
3110
|
})
|
|
3103
3111
|
]).nullish()
|
|
3104
3112
|
})
|
|
@@ -3112,61 +3120,61 @@ var webSearchToolFactory = (0, import_provider_utils25.createProviderDefinedTool
|
|
|
3112
3120
|
|
|
3113
3121
|
// src/tool/web-search-preview.ts
|
|
3114
3122
|
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
3115
|
-
var
|
|
3123
|
+
var import_v419 = require("zod/v4");
|
|
3116
3124
|
var webSearchPreviewArgsSchema = (0, import_provider_utils26.lazySchema)(
|
|
3117
3125
|
() => (0, import_provider_utils26.zodSchema)(
|
|
3118
|
-
|
|
3126
|
+
import_v419.z.object({
|
|
3119
3127
|
/**
|
|
3120
3128
|
* Search context size to use for the web search.
|
|
3121
3129
|
* - high: Most comprehensive context, highest cost, slower response
|
|
3122
3130
|
* - medium: Balanced context, cost, and latency (default)
|
|
3123
3131
|
* - low: Least context, lowest cost, fastest response
|
|
3124
3132
|
*/
|
|
3125
|
-
searchContextSize:
|
|
3133
|
+
searchContextSize: import_v419.z.enum(["low", "medium", "high"]).optional(),
|
|
3126
3134
|
/**
|
|
3127
3135
|
* User location information to provide geographically relevant search results.
|
|
3128
3136
|
*/
|
|
3129
|
-
userLocation:
|
|
3137
|
+
userLocation: import_v419.z.object({
|
|
3130
3138
|
/**
|
|
3131
3139
|
* Type of location (always 'approximate')
|
|
3132
3140
|
*/
|
|
3133
|
-
type:
|
|
3141
|
+
type: import_v419.z.literal("approximate"),
|
|
3134
3142
|
/**
|
|
3135
3143
|
* Two-letter ISO country code (e.g., 'US', 'GB')
|
|
3136
3144
|
*/
|
|
3137
|
-
country:
|
|
3145
|
+
country: import_v419.z.string().optional(),
|
|
3138
3146
|
/**
|
|
3139
3147
|
* City name (free text, e.g., 'Minneapolis')
|
|
3140
3148
|
*/
|
|
3141
|
-
city:
|
|
3149
|
+
city: import_v419.z.string().optional(),
|
|
3142
3150
|
/**
|
|
3143
3151
|
* Region name (free text, e.g., 'Minnesota')
|
|
3144
3152
|
*/
|
|
3145
|
-
region:
|
|
3153
|
+
region: import_v419.z.string().optional(),
|
|
3146
3154
|
/**
|
|
3147
3155
|
* IANA timezone (e.g., 'America/Chicago')
|
|
3148
3156
|
*/
|
|
3149
|
-
timezone:
|
|
3157
|
+
timezone: import_v419.z.string().optional()
|
|
3150
3158
|
}).optional()
|
|
3151
3159
|
})
|
|
3152
3160
|
)
|
|
3153
3161
|
);
|
|
3154
3162
|
var webSearchPreviewInputSchema = (0, import_provider_utils26.lazySchema)(
|
|
3155
3163
|
() => (0, import_provider_utils26.zodSchema)(
|
|
3156
|
-
|
|
3157
|
-
action:
|
|
3158
|
-
|
|
3159
|
-
type:
|
|
3160
|
-
query:
|
|
3164
|
+
import_v419.z.object({
|
|
3165
|
+
action: import_v419.z.discriminatedUnion("type", [
|
|
3166
|
+
import_v419.z.object({
|
|
3167
|
+
type: import_v419.z.literal("search"),
|
|
3168
|
+
query: import_v419.z.string().nullish()
|
|
3161
3169
|
}),
|
|
3162
|
-
|
|
3163
|
-
type:
|
|
3164
|
-
url:
|
|
3170
|
+
import_v419.z.object({
|
|
3171
|
+
type: import_v419.z.literal("open_page"),
|
|
3172
|
+
url: import_v419.z.string()
|
|
3165
3173
|
}),
|
|
3166
|
-
|
|
3167
|
-
type:
|
|
3168
|
-
url:
|
|
3169
|
-
pattern:
|
|
3174
|
+
import_v419.z.object({
|
|
3175
|
+
type: import_v419.z.literal("find"),
|
|
3176
|
+
url: import_v419.z.string(),
|
|
3177
|
+
pattern: import_v419.z.string()
|
|
3170
3178
|
})
|
|
3171
3179
|
]).nullish()
|
|
3172
3180
|
})
|
|
@@ -3180,29 +3188,29 @@ var webSearchPreview = (0, import_provider_utils26.createProviderDefinedToolFact
|
|
|
3180
3188
|
|
|
3181
3189
|
// src/tool/image-generation.ts
|
|
3182
3190
|
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
3183
|
-
var
|
|
3191
|
+
var import_v420 = require("zod/v4");
|
|
3184
3192
|
var imageGenerationArgsSchema = (0, import_provider_utils27.lazySchema)(
|
|
3185
3193
|
() => (0, import_provider_utils27.zodSchema)(
|
|
3186
|
-
|
|
3187
|
-
background:
|
|
3188
|
-
inputFidelity:
|
|
3189
|
-
inputImageMask:
|
|
3190
|
-
fileId:
|
|
3191
|
-
imageUrl:
|
|
3194
|
+
import_v420.z.object({
|
|
3195
|
+
background: import_v420.z.enum(["auto", "opaque", "transparent"]).optional(),
|
|
3196
|
+
inputFidelity: import_v420.z.enum(["low", "high"]).optional(),
|
|
3197
|
+
inputImageMask: import_v420.z.object({
|
|
3198
|
+
fileId: import_v420.z.string().optional(),
|
|
3199
|
+
imageUrl: import_v420.z.string().optional()
|
|
3192
3200
|
}).optional(),
|
|
3193
|
-
model:
|
|
3194
|
-
moderation:
|
|
3195
|
-
outputCompression:
|
|
3196
|
-
outputFormat:
|
|
3197
|
-
partialImages:
|
|
3198
|
-
quality:
|
|
3199
|
-
size:
|
|
3201
|
+
model: import_v420.z.string().optional(),
|
|
3202
|
+
moderation: import_v420.z.enum(["auto"]).optional(),
|
|
3203
|
+
outputCompression: import_v420.z.number().int().min(0).max(100).optional(),
|
|
3204
|
+
outputFormat: import_v420.z.enum(["png", "jpeg", "webp"]).optional(),
|
|
3205
|
+
partialImages: import_v420.z.number().int().min(0).max(3).optional(),
|
|
3206
|
+
quality: import_v420.z.enum(["auto", "low", "medium", "high"]).optional(),
|
|
3207
|
+
size: import_v420.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
3200
3208
|
}).strict()
|
|
3201
3209
|
)
|
|
3202
3210
|
);
|
|
3203
|
-
var imageGenerationInputSchema = (0, import_provider_utils27.lazySchema)(() => (0, import_provider_utils27.zodSchema)(
|
|
3211
|
+
var imageGenerationInputSchema = (0, import_provider_utils27.lazySchema)(() => (0, import_provider_utils27.zodSchema)(import_v420.z.object({})));
|
|
3204
3212
|
var imageGenerationOutputSchema = (0, import_provider_utils27.lazySchema)(
|
|
3205
|
-
() => (0, import_provider_utils27.zodSchema)(
|
|
3213
|
+
() => (0, import_provider_utils27.zodSchema)(import_v420.z.object({ result: import_v420.z.string() }))
|
|
3206
3214
|
);
|
|
3207
3215
|
var imageGenerationToolFactory = (0, import_provider_utils27.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
3208
3216
|
id: "openai.image_generation",
|