@ai-sdk/openai 3.0.129 → 3.0.131
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 +17 -0
- package/dist/index.d.mts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +68 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +212 -185
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +8 -0
- package/dist/internal/index.d.ts +8 -0
- package/dist/internal/index.js +67 -46
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +211 -184
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +3 -3
- package/package.json +2 -2
- package/src/chat/openai-chat-api.ts +1 -1
- package/src/completion/openai-completion-api.ts +1 -1
- package/src/image/openai-image-model-options.ts +40 -39
- package/src/openai-error.ts +22 -14
- package/src/responses/convert-openai-responses-usage.ts +6 -0
- package/src/responses/convert-to-openai-responses-input.ts +17 -11
- package/src/responses/openai-responses-api.ts +117 -94
- package/src/responses/openai-responses-options.ts +4 -2
- package/src/tool/file-search.ts +15 -12
- package/src/tool/mcp.ts +13 -11
- package/src/tool/shell.ts +22 -21
|
@@ -297,6 +297,10 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
297
297
|
input_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
298
298
|
cached_tokens?: number | null | undefined;
|
|
299
299
|
cache_write_tokens?: number | null | undefined;
|
|
300
|
+
cache_write_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
301
|
+
ttl_30m_tokens?: number | null | undefined;
|
|
302
|
+
ttl_12h_tokens?: number | null | undefined;
|
|
303
|
+
}) | null | undefined;
|
|
300
304
|
orchestration_input_tokens?: number | null | undefined;
|
|
301
305
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
302
306
|
}) | null | undefined;
|
|
@@ -328,6 +332,10 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
328
332
|
input_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
329
333
|
cached_tokens?: number | null | undefined;
|
|
330
334
|
cache_write_tokens?: number | null | undefined;
|
|
335
|
+
cache_write_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
336
|
+
ttl_30m_tokens?: number | null | undefined;
|
|
337
|
+
ttl_12h_tokens?: number | null | undefined;
|
|
338
|
+
}) | null | undefined;
|
|
331
339
|
orchestration_input_tokens?: number | null | undefined;
|
|
332
340
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
333
341
|
}) | null | undefined;
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -297,6 +297,10 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
297
297
|
input_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
298
298
|
cached_tokens?: number | null | undefined;
|
|
299
299
|
cache_write_tokens?: number | null | undefined;
|
|
300
|
+
cache_write_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
301
|
+
ttl_30m_tokens?: number | null | undefined;
|
|
302
|
+
ttl_12h_tokens?: number | null | undefined;
|
|
303
|
+
}) | null | undefined;
|
|
300
304
|
orchestration_input_tokens?: number | null | undefined;
|
|
301
305
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
302
306
|
}) | null | undefined;
|
|
@@ -328,6 +332,10 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
328
332
|
input_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
329
333
|
cached_tokens?: number | null | undefined;
|
|
330
334
|
cache_write_tokens?: number | null | undefined;
|
|
335
|
+
cache_write_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
336
|
+
ttl_30m_tokens?: number | null | undefined;
|
|
337
|
+
ttl_12h_tokens?: number | null | undefined;
|
|
338
|
+
}) | null | undefined;
|
|
331
339
|
orchestration_input_tokens?: number | null | undefined;
|
|
332
340
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
333
341
|
}) | null | undefined;
|
package/dist/internal/index.js
CHANGED
|
@@ -71,7 +71,7 @@ var import_provider_utils5 = require("@ai-sdk/provider-utils");
|
|
|
71
71
|
// src/openai-error.ts
|
|
72
72
|
var import_v4 = require("zod/v4");
|
|
73
73
|
var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
74
|
-
var openaiErrorDataSchema = import_v4.z.object({
|
|
74
|
+
var openaiErrorDataSchema = () => import_v4.z.object({
|
|
75
75
|
error: import_v4.z.object({
|
|
76
76
|
message: import_v4.z.string(),
|
|
77
77
|
// The additional information below is handled loosely to support
|
|
@@ -82,8 +82,11 @@ var openaiErrorDataSchema = import_v4.z.object({
|
|
|
82
82
|
code: import_v4.z.union([import_v4.z.string(), import_v4.z.number()]).nullish()
|
|
83
83
|
})
|
|
84
84
|
});
|
|
85
|
+
var openaiErrorDataSchemaValidator = (0, import_provider_utils.lazySchema)(
|
|
86
|
+
() => (0, import_provider_utils.zodSchema)(openaiErrorDataSchema())
|
|
87
|
+
);
|
|
85
88
|
var openaiFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
|
|
86
|
-
errorSchema:
|
|
89
|
+
errorSchema: openaiErrorDataSchemaValidator,
|
|
87
90
|
errorToMessage: (data) => data.error.message
|
|
88
91
|
});
|
|
89
92
|
|
|
@@ -837,7 +840,7 @@ var openaiChatChunkSchema = (0, import_provider_utils3.lazySchema)(
|
|
|
837
840
|
}).nullish()
|
|
838
841
|
}).nullish()
|
|
839
842
|
}),
|
|
840
|
-
openaiErrorDataSchema
|
|
843
|
+
openaiErrorDataSchema()
|
|
841
844
|
])
|
|
842
845
|
)
|
|
843
846
|
);
|
|
@@ -1686,7 +1689,7 @@ var openaiCompletionChunkSchema = (0, import_provider_utils6.lazySchema)(
|
|
|
1686
1689
|
total_tokens: import_v44.z.number()
|
|
1687
1690
|
}).nullish()
|
|
1688
1691
|
}),
|
|
1689
|
-
openaiErrorDataSchema
|
|
1692
|
+
openaiErrorDataSchema()
|
|
1690
1693
|
])
|
|
1691
1694
|
)
|
|
1692
1695
|
);
|
|
@@ -2144,7 +2147,7 @@ function getMaxImagesPerCall(modelId) {
|
|
|
2144
2147
|
var _a2;
|
|
2145
2148
|
return (_a2 = modelMaxImagesPerCall[modelId]) != null ? _a2 : modelId.startsWith("gpt-image-") ? 10 : 1;
|
|
2146
2149
|
}
|
|
2147
|
-
var baseImageModelOptionsObject = import_v49.z.object({
|
|
2150
|
+
var baseImageModelOptionsObject = () => import_v49.z.object({
|
|
2148
2151
|
/**
|
|
2149
2152
|
* Quality of the generated image(s).
|
|
2150
2153
|
*
|
|
@@ -2175,11 +2178,11 @@ var baseImageModelOptionsObject = import_v49.z.object({
|
|
|
2175
2178
|
user: import_v49.z.string().optional()
|
|
2176
2179
|
});
|
|
2177
2180
|
var openaiImageModelOptions = (0, import_provider_utils13.lazySchema)(
|
|
2178
|
-
() => (0, import_provider_utils13.zodSchema)(baseImageModelOptionsObject)
|
|
2181
|
+
() => (0, import_provider_utils13.zodSchema)(baseImageModelOptionsObject())
|
|
2179
2182
|
);
|
|
2180
2183
|
var openaiImageModelGenerationOptions = (0, import_provider_utils13.lazySchema)(
|
|
2181
2184
|
() => (0, import_provider_utils13.zodSchema)(
|
|
2182
|
-
baseImageModelOptionsObject.extend({
|
|
2185
|
+
baseImageModelOptionsObject().extend({
|
|
2183
2186
|
/**
|
|
2184
2187
|
* Style of the generated image. `vivid` produces hyper-real and
|
|
2185
2188
|
* dramatic images; `natural` produces more subdued, less hyper-real
|
|
@@ -2196,7 +2199,7 @@ var openaiImageModelGenerationOptions = (0, import_provider_utils13.lazySchema)(
|
|
|
2196
2199
|
);
|
|
2197
2200
|
var openaiImageModelEditOptions = (0, import_provider_utils13.lazySchema)(
|
|
2198
2201
|
() => (0, import_provider_utils13.zodSchema)(
|
|
2199
|
-
baseImageModelOptionsObject.extend({
|
|
2202
|
+
baseImageModelOptionsObject().extend({
|
|
2200
2203
|
/**
|
|
2201
2204
|
* Fidelity of the output image(s) to the input image(s).
|
|
2202
2205
|
*/
|
|
@@ -2967,11 +2970,13 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils20.lazy
|
|
|
2967
2970
|
/**
|
|
2968
2971
|
* Prompt cache behavior for GPT-5.6 and later models.
|
|
2969
2972
|
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
2970
|
-
* `ttl` sets the minimum cache lifetime
|
|
2973
|
+
* `ttl` sets the minimum cache lifetime: `'30m'` (default) or `'12h'`.
|
|
2974
|
+
* `prewarm` writes the prompt to the cache without generating output.
|
|
2971
2975
|
*/
|
|
2972
2976
|
promptCacheOptions: import_v413.z.object({
|
|
2973
2977
|
mode: import_v413.z.enum(["implicit", "explicit"]).optional(),
|
|
2974
|
-
ttl: import_v413.z.
|
|
2978
|
+
ttl: import_v413.z.enum(["30m", "12h"]).optional(),
|
|
2979
|
+
prewarm: import_v413.z.boolean().optional()
|
|
2975
2980
|
}).optional(),
|
|
2976
2981
|
/**
|
|
2977
2982
|
* The retention policy for the prompt cache.
|
|
@@ -3217,7 +3222,7 @@ var shellOutputSchema = (0, import_provider_utils23.lazySchema)(
|
|
|
3217
3222
|
})
|
|
3218
3223
|
)
|
|
3219
3224
|
);
|
|
3220
|
-
var shellSkillsSchema = import_v416.z.array(
|
|
3225
|
+
var shellSkillsSchema = () => import_v416.z.array(
|
|
3221
3226
|
import_v416.z.discriminatedUnion("type", [
|
|
3222
3227
|
import_v416.z.object({
|
|
3223
3228
|
type: import_v416.z.literal("skillReference"),
|
|
@@ -3258,7 +3263,7 @@ var shellArgsSchema = (0, import_provider_utils23.lazySchema)(
|
|
|
3258
3263
|
).optional()
|
|
3259
3264
|
})
|
|
3260
3265
|
]).optional(),
|
|
3261
|
-
skills: shellSkillsSchema
|
|
3266
|
+
skills: shellSkillsSchema()
|
|
3262
3267
|
}),
|
|
3263
3268
|
import_v416.z.object({
|
|
3264
3269
|
type: import_v416.z.literal("containerReference"),
|
|
@@ -4487,10 +4492,14 @@ ${text}`,
|
|
|
4487
4492
|
}
|
|
4488
4493
|
return { input, warnings };
|
|
4489
4494
|
}
|
|
4490
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4495
|
+
var openaiResponsesReasoningProviderOptionsSchema = (0, import_provider_utils27.lazySchema)(
|
|
4496
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
4497
|
+
import_v419.z.object({
|
|
4498
|
+
itemId: import_v419.z.string().nullish(),
|
|
4499
|
+
reasoningEncryptedContent: import_v419.z.string().nullish()
|
|
4500
|
+
})
|
|
4501
|
+
)
|
|
4502
|
+
);
|
|
4494
4503
|
|
|
4495
4504
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
4496
4505
|
function mapOpenAIResponseFinishReason({
|
|
@@ -4513,33 +4522,41 @@ function mapOpenAIResponseFinishReason({
|
|
|
4513
4522
|
// src/responses/openai-responses-api.ts
|
|
4514
4523
|
var import_provider_utils28 = require("@ai-sdk/provider-utils");
|
|
4515
4524
|
var import_v420 = require("zod/v4");
|
|
4516
|
-
var
|
|
4525
|
+
var cachedJsonValueSchema;
|
|
4526
|
+
var jsonValueSchema = () => cachedJsonValueSchema != null ? cachedJsonValueSchema : cachedJsonValueSchema = import_v420.z.lazy(
|
|
4517
4527
|
() => import_v420.z.union([
|
|
4518
4528
|
import_v420.z.string(),
|
|
4519
4529
|
import_v420.z.number(),
|
|
4520
4530
|
import_v420.z.boolean(),
|
|
4521
4531
|
import_v420.z.null(),
|
|
4522
|
-
import_v420.z.array(jsonValueSchema),
|
|
4523
|
-
import_v420.z.record(import_v420.z.string(), jsonValueSchema.optional())
|
|
4532
|
+
import_v420.z.array(jsonValueSchema()),
|
|
4533
|
+
import_v420.z.record(import_v420.z.string(), jsonValueSchema().optional())
|
|
4524
4534
|
])
|
|
4525
4535
|
);
|
|
4526
|
-
var jsonObjectSchema = import_v420.z.record(import_v420.z.string(), jsonValueSchema.optional());
|
|
4527
|
-
var openaiResponsesUsageSchema = import_v420.z.intersection(
|
|
4528
|
-
jsonObjectSchema,
|
|
4536
|
+
var jsonObjectSchema = () => import_v420.z.record(import_v420.z.string(), jsonValueSchema().optional());
|
|
4537
|
+
var openaiResponsesUsageSchema = () => import_v420.z.intersection(
|
|
4538
|
+
jsonObjectSchema(),
|
|
4529
4539
|
import_v420.z.object({
|
|
4530
4540
|
input_tokens: import_v420.z.number(),
|
|
4531
4541
|
input_tokens_details: import_v420.z.intersection(
|
|
4532
|
-
jsonObjectSchema,
|
|
4542
|
+
jsonObjectSchema(),
|
|
4533
4543
|
import_v420.z.object({
|
|
4534
4544
|
cached_tokens: import_v420.z.number().nullish(),
|
|
4535
4545
|
cache_write_tokens: import_v420.z.number().nullish(),
|
|
4546
|
+
cache_write_tokens_details: import_v420.z.intersection(
|
|
4547
|
+
jsonObjectSchema(),
|
|
4548
|
+
import_v420.z.object({
|
|
4549
|
+
ttl_30m_tokens: import_v420.z.number().nullish(),
|
|
4550
|
+
ttl_12h_tokens: import_v420.z.number().nullish()
|
|
4551
|
+
})
|
|
4552
|
+
).nullish(),
|
|
4536
4553
|
orchestration_input_tokens: import_v420.z.number().nullish(),
|
|
4537
4554
|
orchestration_input_cached_tokens: import_v420.z.number().nullish()
|
|
4538
4555
|
})
|
|
4539
4556
|
).nullish(),
|
|
4540
4557
|
output_tokens: import_v420.z.number(),
|
|
4541
4558
|
output_tokens_details: import_v420.z.intersection(
|
|
4542
|
-
jsonObjectSchema,
|
|
4559
|
+
jsonObjectSchema(),
|
|
4543
4560
|
import_v420.z.object({
|
|
4544
4561
|
reasoning_tokens: import_v420.z.number().nullish(),
|
|
4545
4562
|
orchestration_output_tokens: import_v420.z.number().nullish()
|
|
@@ -4551,7 +4568,7 @@ var openaiResponsesUsageSchema = import_v420.z.intersection(
|
|
|
4551
4568
|
function isRecord(value) {
|
|
4552
4569
|
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
4553
4570
|
}
|
|
4554
|
-
var openaiResponsesLocalShellCallSchema = import_v420.z.object({
|
|
4571
|
+
var openaiResponsesLocalShellCallSchema = () => import_v420.z.object({
|
|
4555
4572
|
type: import_v420.z.literal("local_shell_call"),
|
|
4556
4573
|
id: import_v420.z.string(),
|
|
4557
4574
|
call_id: import_v420.z.string(),
|
|
@@ -4564,7 +4581,7 @@ var openaiResponsesLocalShellCallSchema = import_v420.z.object({
|
|
|
4564
4581
|
env: import_v420.z.record(import_v420.z.string(), import_v420.z.string()).optional()
|
|
4565
4582
|
})
|
|
4566
4583
|
});
|
|
4567
|
-
var openaiResponsesNestedErrorChunkSchema = import_v420.z.object({
|
|
4584
|
+
var openaiResponsesNestedErrorChunkSchema = () => import_v420.z.object({
|
|
4568
4585
|
type: import_v420.z.literal("error"),
|
|
4569
4586
|
sequence_number: import_v420.z.number(),
|
|
4570
4587
|
error: import_v420.z.object({
|
|
@@ -4574,7 +4591,7 @@ var openaiResponsesNestedErrorChunkSchema = import_v420.z.object({
|
|
|
4574
4591
|
param: import_v420.z.string().nullish()
|
|
4575
4592
|
})
|
|
4576
4593
|
});
|
|
4577
|
-
var openaiResponsesErrorChunkSchema = import_v420.z.object({
|
|
4594
|
+
var openaiResponsesErrorChunkSchema = () => import_v420.z.object({
|
|
4578
4595
|
type: import_v420.z.literal("error"),
|
|
4579
4596
|
sequence_number: import_v420.z.number(),
|
|
4580
4597
|
code: import_v420.z.string().nullish(),
|
|
@@ -4659,7 +4676,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
4659
4676
|
type: import_v420.z.enum(["response.completed", "response.incomplete"]),
|
|
4660
4677
|
response: import_v420.z.object({
|
|
4661
4678
|
incomplete_details: import_v420.z.object({ reason: import_v420.z.string() }).nullish(),
|
|
4662
|
-
usage: openaiResponsesUsageSchema.nullish(),
|
|
4679
|
+
usage: openaiResponsesUsageSchema().nullish(),
|
|
4663
4680
|
reasoning: import_v420.z.object({
|
|
4664
4681
|
context: import_v420.z.string().nullish()
|
|
4665
4682
|
}).nullish(),
|
|
@@ -4675,7 +4692,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
4675
4692
|
message: import_v420.z.string()
|
|
4676
4693
|
}).nullish(),
|
|
4677
4694
|
incomplete_details: import_v420.z.object({ reason: import_v420.z.string() }).nullish(),
|
|
4678
|
-
usage: openaiResponsesUsageSchema.nullish(),
|
|
4695
|
+
usage: openaiResponsesUsageSchema().nullish(),
|
|
4679
4696
|
reasoning: import_v420.z.object({
|
|
4680
4697
|
context: import_v420.z.string().nullish()
|
|
4681
4698
|
}).nullish(),
|
|
@@ -4728,7 +4745,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
4728
4745
|
type: import_v420.z.literal("file_search_call"),
|
|
4729
4746
|
id: import_v420.z.string()
|
|
4730
4747
|
}),
|
|
4731
|
-
openaiResponsesLocalShellCallSchema,
|
|
4748
|
+
openaiResponsesLocalShellCallSchema(),
|
|
4732
4749
|
import_v420.z.object({
|
|
4733
4750
|
type: import_v420.z.literal("image_generation_call"),
|
|
4734
4751
|
id: import_v420.z.string()
|
|
@@ -4832,7 +4849,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
4832
4849
|
execution: import_v420.z.enum(["server", "client"]),
|
|
4833
4850
|
call_id: import_v420.z.string().nullable(),
|
|
4834
4851
|
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4835
|
-
tools: import_v420.z.array(import_v420.z.record(import_v420.z.string(), jsonValueSchema.optional()))
|
|
4852
|
+
tools: import_v420.z.array(import_v420.z.record(import_v420.z.string(), jsonValueSchema().optional()))
|
|
4836
4853
|
})
|
|
4837
4854
|
])
|
|
4838
4855
|
}),
|
|
@@ -4930,7 +4947,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
4930
4947
|
})
|
|
4931
4948
|
).nullish()
|
|
4932
4949
|
}),
|
|
4933
|
-
openaiResponsesLocalShellCallSchema,
|
|
4950
|
+
openaiResponsesLocalShellCallSchema(),
|
|
4934
4951
|
import_v420.z.object({
|
|
4935
4952
|
type: import_v420.z.literal("computer_call"),
|
|
4936
4953
|
id: import_v420.z.string(),
|
|
@@ -5047,7 +5064,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
5047
5064
|
execution: import_v420.z.enum(["server", "client"]),
|
|
5048
5065
|
call_id: import_v420.z.string().nullable(),
|
|
5049
5066
|
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5050
|
-
tools: import_v420.z.array(import_v420.z.record(import_v420.z.string(), jsonValueSchema.optional()))
|
|
5067
|
+
tools: import_v420.z.array(import_v420.z.record(import_v420.z.string(), jsonValueSchema().optional()))
|
|
5051
5068
|
})
|
|
5052
5069
|
])
|
|
5053
5070
|
}),
|
|
@@ -5149,8 +5166,8 @@ var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
5149
5166
|
output_index: import_v420.z.number(),
|
|
5150
5167
|
diff: import_v420.z.string()
|
|
5151
5168
|
}),
|
|
5152
|
-
openaiResponsesNestedErrorChunkSchema,
|
|
5153
|
-
openaiResponsesErrorChunkSchema,
|
|
5169
|
+
openaiResponsesNestedErrorChunkSchema(),
|
|
5170
|
+
openaiResponsesErrorChunkSchema(),
|
|
5154
5171
|
import_v420.z.object({ type: import_v420.z.string() }).loose().refine((value) => !isModeledOpenAIResponsesChunk(value), {
|
|
5155
5172
|
message: "Known response chunk failed schema validation"
|
|
5156
5173
|
}).transform((value) => ({
|
|
@@ -5293,7 +5310,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
5293
5310
|
id: import_v420.z.string(),
|
|
5294
5311
|
result: import_v420.z.string()
|
|
5295
5312
|
}),
|
|
5296
|
-
openaiResponsesLocalShellCallSchema,
|
|
5313
|
+
openaiResponsesLocalShellCallSchema(),
|
|
5297
5314
|
import_v420.z.object({
|
|
5298
5315
|
type: import_v420.z.literal("function_call"),
|
|
5299
5316
|
call_id: import_v420.z.string(),
|
|
@@ -5438,7 +5455,9 @@ var openaiResponsesResponseSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
5438
5455
|
execution: import_v420.z.enum(["server", "client"]),
|
|
5439
5456
|
call_id: import_v420.z.string().nullable(),
|
|
5440
5457
|
status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
|
|
5441
|
-
tools: import_v420.z.array(
|
|
5458
|
+
tools: import_v420.z.array(
|
|
5459
|
+
import_v420.z.record(import_v420.z.string(), jsonValueSchema().optional())
|
|
5460
|
+
)
|
|
5442
5461
|
})
|
|
5443
5462
|
])
|
|
5444
5463
|
).optional(),
|
|
@@ -5447,7 +5466,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
5447
5466
|
context: import_v420.z.string().nullish()
|
|
5448
5467
|
}).nullish(),
|
|
5449
5468
|
incomplete_details: import_v420.z.object({ reason: import_v420.z.string() }).nullish(),
|
|
5450
|
-
usage: openaiResponsesUsageSchema.nullish()
|
|
5469
|
+
usage: openaiResponsesUsageSchema().nullish()
|
|
5451
5470
|
})
|
|
5452
5471
|
)
|
|
5453
5472
|
);
|
|
@@ -5503,15 +5522,16 @@ var codeInterpreter = (args = {}) => {
|
|
|
5503
5522
|
// src/tool/file-search.ts
|
|
5504
5523
|
var import_provider_utils30 = require("@ai-sdk/provider-utils");
|
|
5505
5524
|
var import_v422 = require("zod/v4");
|
|
5506
|
-
var comparisonFilterSchema = import_v422.z.object({
|
|
5525
|
+
var comparisonFilterSchema = () => import_v422.z.object({
|
|
5507
5526
|
key: import_v422.z.string(),
|
|
5508
5527
|
type: import_v422.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
5509
5528
|
value: import_v422.z.union([import_v422.z.string(), import_v422.z.number(), import_v422.z.boolean(), import_v422.z.array(import_v422.z.string())])
|
|
5510
5529
|
});
|
|
5511
|
-
var
|
|
5530
|
+
var cachedCompoundFilterSchema;
|
|
5531
|
+
var compoundFilterSchema = () => cachedCompoundFilterSchema != null ? cachedCompoundFilterSchema : cachedCompoundFilterSchema = import_v422.z.object({
|
|
5512
5532
|
type: import_v422.z.enum(["and", "or"]),
|
|
5513
5533
|
filters: import_v422.z.array(
|
|
5514
|
-
import_v422.z.union([comparisonFilterSchema, import_v422.z.lazy(() => compoundFilterSchema)])
|
|
5534
|
+
import_v422.z.union([comparisonFilterSchema(), import_v422.z.lazy(() => compoundFilterSchema())])
|
|
5515
5535
|
)
|
|
5516
5536
|
});
|
|
5517
5537
|
var fileSearchArgsSchema = (0, import_provider_utils30.lazySchema)(
|
|
@@ -5523,7 +5543,7 @@ var fileSearchArgsSchema = (0, import_provider_utils30.lazySchema)(
|
|
|
5523
5543
|
ranker: import_v422.z.string().optional(),
|
|
5524
5544
|
scoreThreshold: import_v422.z.number().optional()
|
|
5525
5545
|
}).optional(),
|
|
5526
|
-
filters: import_v422.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
5546
|
+
filters: import_v422.z.union([comparisonFilterSchema(), compoundFilterSchema()]).optional()
|
|
5527
5547
|
})
|
|
5528
5548
|
)
|
|
5529
5549
|
);
|
|
@@ -5615,14 +5635,15 @@ var customToolFactory = (0, import_provider_utils32.createProviderToolFactory)({
|
|
|
5615
5635
|
// src/tool/mcp.ts
|
|
5616
5636
|
var import_provider_utils33 = require("@ai-sdk/provider-utils");
|
|
5617
5637
|
var import_v425 = require("zod/v4");
|
|
5618
|
-
var
|
|
5638
|
+
var cachedJsonValueSchema2;
|
|
5639
|
+
var jsonValueSchema2 = () => cachedJsonValueSchema2 != null ? cachedJsonValueSchema2 : cachedJsonValueSchema2 = import_v425.z.lazy(
|
|
5619
5640
|
() => import_v425.z.union([
|
|
5620
5641
|
import_v425.z.string(),
|
|
5621
5642
|
import_v425.z.number(),
|
|
5622
5643
|
import_v425.z.boolean(),
|
|
5623
5644
|
import_v425.z.null(),
|
|
5624
|
-
import_v425.z.array(jsonValueSchema2),
|
|
5625
|
-
import_v425.z.record(import_v425.z.string(), jsonValueSchema2)
|
|
5645
|
+
import_v425.z.array(jsonValueSchema2()),
|
|
5646
|
+
import_v425.z.record(import_v425.z.string(), jsonValueSchema2())
|
|
5626
5647
|
])
|
|
5627
5648
|
);
|
|
5628
5649
|
var mcpArgsSchema = (0, import_provider_utils33.lazySchema)(
|
|
@@ -5664,7 +5685,7 @@ var mcpOutputSchema = (0, import_provider_utils33.lazySchema)(
|
|
|
5664
5685
|
name: import_v425.z.string(),
|
|
5665
5686
|
arguments: import_v425.z.string(),
|
|
5666
5687
|
output: import_v425.z.string().nullish(),
|
|
5667
|
-
error: import_v425.z.union([import_v425.z.string(), jsonValueSchema2]).optional()
|
|
5688
|
+
error: import_v425.z.union([import_v425.z.string(), jsonValueSchema2()]).optional()
|
|
5668
5689
|
})
|
|
5669
5690
|
)
|
|
5670
5691
|
);
|