@ai-sdk/openai 4.0.0-beta.1 → 4.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +145 -0
- package/dist/index.d.mts +69 -22
- package/dist/index.d.ts +69 -22
- package/dist/index.js +1169 -873
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1123 -822
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +56 -28
- package/dist/internal/index.d.ts +56 -28
- package/dist/internal/index.js +1198 -912
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1180 -889
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +142 -3
- package/package.json +3 -3
- package/src/chat/convert-openai-chat-usage.ts +2 -2
- package/src/chat/convert-to-openai-chat-messages.ts +5 -5
- package/src/chat/map-openai-finish-reason.ts +2 -2
- package/src/chat/openai-chat-language-model.ts +22 -22
- package/src/chat/openai-chat-options.ts +1 -0
- package/src/chat/openai-chat-prepare-tools.ts +6 -6
- package/src/completion/convert-openai-completion-usage.ts +2 -2
- package/src/completion/convert-to-openai-completion-prompt.ts +2 -2
- package/src/completion/map-openai-finish-reason.ts +2 -2
- package/src/completion/openai-completion-language-model.ts +20 -20
- package/src/embedding/openai-embedding-model.ts +5 -5
- package/src/image/openai-image-model.ts +9 -9
- package/src/openai-language-model-capabilities.ts +1 -0
- package/src/openai-provider.ts +21 -21
- package/src/openai-tools.ts +12 -1
- package/src/responses/convert-openai-responses-usage.ts +2 -2
- package/src/responses/convert-to-openai-responses-input.ts +116 -12
- package/src/responses/map-openai-responses-finish-reason.ts +2 -2
- package/src/responses/openai-responses-api.ts +87 -1
- package/src/responses/openai-responses-language-model.ts +168 -33
- package/src/responses/openai-responses-options.ts +4 -2
- package/src/responses/openai-responses-prepare-tools.ts +34 -9
- package/src/speech/openai-speech-model.ts +7 -7
- package/src/tool/custom.ts +0 -6
- package/src/tool/tool-search.ts +98 -0
- package/src/transcription/openai-transcription-model.ts +8 -8
package/dist/index.mjs
CHANGED
|
@@ -44,7 +44,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
|
|
|
44
44
|
const supportsFlexProcessing = modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
|
|
45
45
|
const supportsPriorityProcessing = modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") && !modelId.startsWith("gpt-5-chat") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
|
|
46
46
|
const isReasoningModel = modelId.startsWith("o1") || modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
|
|
47
|
-
const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.4");
|
|
47
|
+
const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.3") || modelId.startsWith("gpt-5.4");
|
|
48
48
|
const systemMessageMode = isReasoningModel ? "developer" : "system";
|
|
49
49
|
return {
|
|
50
50
|
supportsFlexProcessing,
|
|
@@ -639,7 +639,7 @@ function prepareChatTools({
|
|
|
639
639
|
// src/chat/openai-chat-language-model.ts
|
|
640
640
|
var OpenAIChatLanguageModel = class {
|
|
641
641
|
constructor(modelId, config) {
|
|
642
|
-
this.specificationVersion = "
|
|
642
|
+
this.specificationVersion = "v4";
|
|
643
643
|
this.supportedUrls = {
|
|
644
644
|
"image/*": [/^https?:\/\/.*$/]
|
|
645
645
|
};
|
|
@@ -1383,7 +1383,7 @@ var openaiLanguageModelCompletionOptions = lazySchema4(
|
|
|
1383
1383
|
// src/completion/openai-completion-language-model.ts
|
|
1384
1384
|
var OpenAICompletionLanguageModel = class {
|
|
1385
1385
|
constructor(modelId, config) {
|
|
1386
|
-
this.specificationVersion = "
|
|
1386
|
+
this.specificationVersion = "v4";
|
|
1387
1387
|
this.supportedUrls = {
|
|
1388
1388
|
// No URLs are supported for completion models.
|
|
1389
1389
|
};
|
|
@@ -1655,7 +1655,7 @@ var openaiTextEmbeddingResponseSchema = lazySchema6(
|
|
|
1655
1655
|
// src/embedding/openai-embedding-model.ts
|
|
1656
1656
|
var OpenAIEmbeddingModel = class {
|
|
1657
1657
|
constructor(modelId, config) {
|
|
1658
|
-
this.specificationVersion = "
|
|
1658
|
+
this.specificationVersion = "v4";
|
|
1659
1659
|
this.maxEmbeddingsPerCall = 2048;
|
|
1660
1660
|
this.supportsParallelCalls = true;
|
|
1661
1661
|
this.modelId = modelId;
|
|
@@ -1784,7 +1784,7 @@ var OpenAIImageModel = class {
|
|
|
1784
1784
|
constructor(modelId, config) {
|
|
1785
1785
|
this.modelId = modelId;
|
|
1786
1786
|
this.config = config;
|
|
1787
|
-
this.specificationVersion = "
|
|
1787
|
+
this.specificationVersion = "v4";
|
|
1788
1788
|
}
|
|
1789
1789
|
get maxImagesPerCall() {
|
|
1790
1790
|
var _a;
|
|
@@ -2076,7 +2076,6 @@ import { z as z11 } from "zod/v4";
|
|
|
2076
2076
|
var customArgsSchema = lazySchema10(
|
|
2077
2077
|
() => zodSchema10(
|
|
2078
2078
|
z11.object({
|
|
2079
|
-
name: z11.string(),
|
|
2080
2079
|
description: z11.string().optional(),
|
|
2081
2080
|
format: z11.union([
|
|
2082
2081
|
z11.object({
|
|
@@ -2321,74 +2320,56 @@ var shell = createProviderToolFactoryWithOutputSchema6({
|
|
|
2321
2320
|
outputSchema: shellOutputSchema
|
|
2322
2321
|
});
|
|
2323
2322
|
|
|
2324
|
-
// src/tool/
|
|
2323
|
+
// src/tool/tool-search.ts
|
|
2325
2324
|
import {
|
|
2326
2325
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
2327
2326
|
lazySchema as lazySchema15,
|
|
2328
2327
|
zodSchema as zodSchema15
|
|
2329
2328
|
} from "@ai-sdk/provider-utils";
|
|
2330
2329
|
import { z as z16 } from "zod/v4";
|
|
2331
|
-
var
|
|
2330
|
+
var toolSearchArgsSchema = lazySchema15(
|
|
2332
2331
|
() => zodSchema15(
|
|
2333
2332
|
z16.object({
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
userLocation: z16.object({
|
|
2338
|
-
type: z16.literal("approximate"),
|
|
2339
|
-
country: z16.string().optional(),
|
|
2340
|
-
city: z16.string().optional(),
|
|
2341
|
-
region: z16.string().optional(),
|
|
2342
|
-
timezone: z16.string().optional()
|
|
2343
|
-
}).optional()
|
|
2333
|
+
execution: z16.enum(["server", "client"]).optional(),
|
|
2334
|
+
description: z16.string().optional(),
|
|
2335
|
+
parameters: z16.record(z16.string(), z16.unknown()).optional()
|
|
2344
2336
|
})
|
|
2345
2337
|
)
|
|
2346
2338
|
);
|
|
2347
|
-
var
|
|
2348
|
-
var webSearchOutputSchema = lazySchema15(
|
|
2339
|
+
var toolSearchInputSchema = lazySchema15(
|
|
2349
2340
|
() => zodSchema15(
|
|
2350
2341
|
z16.object({
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
type: z16.literal("search"),
|
|
2354
|
-
query: z16.string().optional()
|
|
2355
|
-
}),
|
|
2356
|
-
z16.object({
|
|
2357
|
-
type: z16.literal("openPage"),
|
|
2358
|
-
url: z16.string().nullish()
|
|
2359
|
-
}),
|
|
2360
|
-
z16.object({
|
|
2361
|
-
type: z16.literal("findInPage"),
|
|
2362
|
-
url: z16.string().nullish(),
|
|
2363
|
-
pattern: z16.string().nullish()
|
|
2364
|
-
})
|
|
2365
|
-
]).optional(),
|
|
2366
|
-
sources: z16.array(
|
|
2367
|
-
z16.discriminatedUnion("type", [
|
|
2368
|
-
z16.object({ type: z16.literal("url"), url: z16.string() }),
|
|
2369
|
-
z16.object({ type: z16.literal("api"), name: z16.string() })
|
|
2370
|
-
])
|
|
2371
|
-
).optional()
|
|
2342
|
+
arguments: z16.unknown().optional(),
|
|
2343
|
+
call_id: z16.string().nullish()
|
|
2372
2344
|
})
|
|
2373
2345
|
)
|
|
2374
2346
|
);
|
|
2375
|
-
var
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2347
|
+
var toolSearchOutputSchema = lazySchema15(
|
|
2348
|
+
() => zodSchema15(
|
|
2349
|
+
z16.object({
|
|
2350
|
+
tools: z16.array(z16.record(z16.string(), z16.unknown()))
|
|
2351
|
+
})
|
|
2352
|
+
)
|
|
2353
|
+
);
|
|
2354
|
+
var toolSearchToolFactory = createProviderToolFactoryWithOutputSchema7({
|
|
2355
|
+
id: "openai.tool_search",
|
|
2356
|
+
inputSchema: toolSearchInputSchema,
|
|
2357
|
+
outputSchema: toolSearchOutputSchema
|
|
2379
2358
|
});
|
|
2380
|
-
var
|
|
2359
|
+
var toolSearch = (args = {}) => toolSearchToolFactory(args);
|
|
2381
2360
|
|
|
2382
|
-
// src/tool/web-search
|
|
2361
|
+
// src/tool/web-search.ts
|
|
2383
2362
|
import {
|
|
2384
2363
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
2385
2364
|
lazySchema as lazySchema16,
|
|
2386
2365
|
zodSchema as zodSchema16
|
|
2387
2366
|
} from "@ai-sdk/provider-utils";
|
|
2388
2367
|
import { z as z17 } from "zod/v4";
|
|
2389
|
-
var
|
|
2368
|
+
var webSearchArgsSchema = lazySchema16(
|
|
2390
2369
|
() => zodSchema16(
|
|
2391
2370
|
z17.object({
|
|
2371
|
+
externalWebAccess: z17.boolean().optional(),
|
|
2372
|
+
filters: z17.object({ allowedDomains: z17.array(z17.string()).optional() }).optional(),
|
|
2392
2373
|
searchContextSize: z17.enum(["low", "medium", "high"]).optional(),
|
|
2393
2374
|
userLocation: z17.object({
|
|
2394
2375
|
type: z17.literal("approximate"),
|
|
@@ -2400,10 +2381,8 @@ var webSearchPreviewArgsSchema = lazySchema16(
|
|
|
2400
2381
|
})
|
|
2401
2382
|
)
|
|
2402
2383
|
);
|
|
2403
|
-
var
|
|
2404
|
-
|
|
2405
|
-
);
|
|
2406
|
-
var webSearchPreviewOutputSchema = lazySchema16(
|
|
2384
|
+
var webSearchInputSchema = lazySchema16(() => zodSchema16(z17.object({})));
|
|
2385
|
+
var webSearchOutputSchema = lazySchema16(
|
|
2407
2386
|
() => zodSchema16(
|
|
2408
2387
|
z17.object({
|
|
2409
2388
|
action: z17.discriminatedUnion("type", [
|
|
@@ -2420,77 +2399,135 @@ var webSearchPreviewOutputSchema = lazySchema16(
|
|
|
2420
2399
|
url: z17.string().nullish(),
|
|
2421
2400
|
pattern: z17.string().nullish()
|
|
2422
2401
|
})
|
|
2423
|
-
]).optional()
|
|
2402
|
+
]).optional(),
|
|
2403
|
+
sources: z17.array(
|
|
2404
|
+
z17.discriminatedUnion("type", [
|
|
2405
|
+
z17.object({ type: z17.literal("url"), url: z17.string() }),
|
|
2406
|
+
z17.object({ type: z17.literal("api"), name: z17.string() })
|
|
2407
|
+
])
|
|
2408
|
+
).optional()
|
|
2424
2409
|
})
|
|
2425
2410
|
)
|
|
2426
2411
|
);
|
|
2427
|
-
var
|
|
2428
|
-
id: "openai.
|
|
2429
|
-
inputSchema:
|
|
2430
|
-
outputSchema:
|
|
2412
|
+
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
2413
|
+
id: "openai.web_search",
|
|
2414
|
+
inputSchema: webSearchInputSchema,
|
|
2415
|
+
outputSchema: webSearchOutputSchema
|
|
2431
2416
|
});
|
|
2417
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
2432
2418
|
|
|
2433
|
-
// src/tool/
|
|
2419
|
+
// src/tool/web-search-preview.ts
|
|
2434
2420
|
import {
|
|
2435
2421
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
2436
2422
|
lazySchema as lazySchema17,
|
|
2437
2423
|
zodSchema as zodSchema17
|
|
2438
2424
|
} from "@ai-sdk/provider-utils";
|
|
2439
2425
|
import { z as z18 } from "zod/v4";
|
|
2440
|
-
var
|
|
2441
|
-
() =>
|
|
2442
|
-
z18.
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2426
|
+
var webSearchPreviewArgsSchema = lazySchema17(
|
|
2427
|
+
() => zodSchema17(
|
|
2428
|
+
z18.object({
|
|
2429
|
+
searchContextSize: z18.enum(["low", "medium", "high"]).optional(),
|
|
2430
|
+
userLocation: z18.object({
|
|
2431
|
+
type: z18.literal("approximate"),
|
|
2432
|
+
country: z18.string().optional(),
|
|
2433
|
+
city: z18.string().optional(),
|
|
2434
|
+
region: z18.string().optional(),
|
|
2435
|
+
timezone: z18.string().optional()
|
|
2436
|
+
}).optional()
|
|
2437
|
+
})
|
|
2438
|
+
)
|
|
2439
|
+
);
|
|
2440
|
+
var webSearchPreviewInputSchema = lazySchema17(
|
|
2441
|
+
() => zodSchema17(z18.object({}))
|
|
2449
2442
|
);
|
|
2450
|
-
var
|
|
2443
|
+
var webSearchPreviewOutputSchema = lazySchema17(
|
|
2451
2444
|
() => zodSchema17(
|
|
2452
2445
|
z18.object({
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2446
|
+
action: z18.discriminatedUnion("type", [
|
|
2447
|
+
z18.object({
|
|
2448
|
+
type: z18.literal("search"),
|
|
2449
|
+
query: z18.string().optional()
|
|
2450
|
+
}),
|
|
2456
2451
|
z18.object({
|
|
2457
|
-
|
|
2458
|
-
|
|
2452
|
+
type: z18.literal("openPage"),
|
|
2453
|
+
url: z18.string().nullish()
|
|
2454
|
+
}),
|
|
2455
|
+
z18.object({
|
|
2456
|
+
type: z18.literal("findInPage"),
|
|
2457
|
+
url: z18.string().nullish(),
|
|
2458
|
+
pattern: z18.string().nullish()
|
|
2459
|
+
})
|
|
2460
|
+
]).optional()
|
|
2461
|
+
})
|
|
2462
|
+
)
|
|
2463
|
+
);
|
|
2464
|
+
var webSearchPreview = createProviderToolFactoryWithOutputSchema9({
|
|
2465
|
+
id: "openai.web_search_preview",
|
|
2466
|
+
inputSchema: webSearchPreviewInputSchema,
|
|
2467
|
+
outputSchema: webSearchPreviewOutputSchema
|
|
2468
|
+
});
|
|
2469
|
+
|
|
2470
|
+
// src/tool/mcp.ts
|
|
2471
|
+
import {
|
|
2472
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
|
|
2473
|
+
lazySchema as lazySchema18,
|
|
2474
|
+
zodSchema as zodSchema18
|
|
2475
|
+
} from "@ai-sdk/provider-utils";
|
|
2476
|
+
import { z as z19 } from "zod/v4";
|
|
2477
|
+
var jsonValueSchema = z19.lazy(
|
|
2478
|
+
() => z19.union([
|
|
2479
|
+
z19.string(),
|
|
2480
|
+
z19.number(),
|
|
2481
|
+
z19.boolean(),
|
|
2482
|
+
z19.null(),
|
|
2483
|
+
z19.array(jsonValueSchema),
|
|
2484
|
+
z19.record(z19.string(), jsonValueSchema)
|
|
2485
|
+
])
|
|
2486
|
+
);
|
|
2487
|
+
var mcpArgsSchema = lazySchema18(
|
|
2488
|
+
() => zodSchema18(
|
|
2489
|
+
z19.object({
|
|
2490
|
+
serverLabel: z19.string(),
|
|
2491
|
+
allowedTools: z19.union([
|
|
2492
|
+
z19.array(z19.string()),
|
|
2493
|
+
z19.object({
|
|
2494
|
+
readOnly: z19.boolean().optional(),
|
|
2495
|
+
toolNames: z19.array(z19.string()).optional()
|
|
2459
2496
|
})
|
|
2460
2497
|
]).optional(),
|
|
2461
|
-
authorization:
|
|
2462
|
-
connectorId:
|
|
2463
|
-
headers:
|
|
2464
|
-
requireApproval:
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
never:
|
|
2468
|
-
toolNames:
|
|
2498
|
+
authorization: z19.string().optional(),
|
|
2499
|
+
connectorId: z19.string().optional(),
|
|
2500
|
+
headers: z19.record(z19.string(), z19.string()).optional(),
|
|
2501
|
+
requireApproval: z19.union([
|
|
2502
|
+
z19.enum(["always", "never"]),
|
|
2503
|
+
z19.object({
|
|
2504
|
+
never: z19.object({
|
|
2505
|
+
toolNames: z19.array(z19.string()).optional()
|
|
2469
2506
|
}).optional()
|
|
2470
2507
|
})
|
|
2471
2508
|
]).optional(),
|
|
2472
|
-
serverDescription:
|
|
2473
|
-
serverUrl:
|
|
2509
|
+
serverDescription: z19.string().optional(),
|
|
2510
|
+
serverUrl: z19.string().optional()
|
|
2474
2511
|
}).refine(
|
|
2475
2512
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
2476
2513
|
"One of serverUrl or connectorId must be provided."
|
|
2477
2514
|
)
|
|
2478
2515
|
)
|
|
2479
2516
|
);
|
|
2480
|
-
var mcpInputSchema =
|
|
2481
|
-
var mcpOutputSchema =
|
|
2482
|
-
() =>
|
|
2483
|
-
|
|
2484
|
-
type:
|
|
2485
|
-
serverLabel:
|
|
2486
|
-
name:
|
|
2487
|
-
arguments:
|
|
2488
|
-
output:
|
|
2489
|
-
error:
|
|
2517
|
+
var mcpInputSchema = lazySchema18(() => zodSchema18(z19.object({})));
|
|
2518
|
+
var mcpOutputSchema = lazySchema18(
|
|
2519
|
+
() => zodSchema18(
|
|
2520
|
+
z19.object({
|
|
2521
|
+
type: z19.literal("call"),
|
|
2522
|
+
serverLabel: z19.string(),
|
|
2523
|
+
name: z19.string(),
|
|
2524
|
+
arguments: z19.string(),
|
|
2525
|
+
output: z19.string().nullish(),
|
|
2526
|
+
error: z19.union([z19.string(), jsonValueSchema]).optional()
|
|
2490
2527
|
})
|
|
2491
2528
|
)
|
|
2492
2529
|
);
|
|
2493
|
-
var mcpToolFactory =
|
|
2530
|
+
var mcpToolFactory = createProviderToolFactoryWithOutputSchema10({
|
|
2494
2531
|
id: "openai.mcp",
|
|
2495
2532
|
inputSchema: mcpInputSchema,
|
|
2496
2533
|
outputSchema: mcpOutputSchema
|
|
@@ -2512,7 +2549,6 @@ var openaiTools = {
|
|
|
2512
2549
|
* Lark syntax). The model returns a `custom_tool_call` output item whose
|
|
2513
2550
|
* `input` field is a string matching the specified grammar.
|
|
2514
2551
|
*
|
|
2515
|
-
* @param name - The name of the custom tool.
|
|
2516
2552
|
* @param description - An optional description of the tool.
|
|
2517
2553
|
* @param format - The output format constraint (grammar type, syntax, and definition).
|
|
2518
2554
|
*/
|
|
@@ -2602,7 +2638,17 @@ var openaiTools = {
|
|
|
2602
2638
|
* @param serverDescription - Optional description of the server.
|
|
2603
2639
|
* @param serverUrl - URL for the MCP server.
|
|
2604
2640
|
*/
|
|
2605
|
-
mcp
|
|
2641
|
+
mcp,
|
|
2642
|
+
/**
|
|
2643
|
+
* Tool search allows the model to dynamically search for and load deferred
|
|
2644
|
+
* tools into the model's context as needed. This helps reduce overall token
|
|
2645
|
+
* usage, cost, and latency by only loading tools when the model needs them.
|
|
2646
|
+
*
|
|
2647
|
+
* To use tool search, mark functions or namespaces with `defer_loading: true`
|
|
2648
|
+
* in the tools array. The model will use tool search to load these tools
|
|
2649
|
+
* when it determines they are needed.
|
|
2650
|
+
*/
|
|
2651
|
+
toolSearch
|
|
2606
2652
|
};
|
|
2607
2653
|
|
|
2608
2654
|
// src/responses/openai-responses-language-model.ts
|
|
@@ -2665,10 +2711,11 @@ import {
|
|
|
2665
2711
|
import {
|
|
2666
2712
|
convertToBase64 as convertToBase642,
|
|
2667
2713
|
isNonNullable,
|
|
2714
|
+
parseJSON,
|
|
2668
2715
|
parseProviderOptions as parseProviderOptions4,
|
|
2669
2716
|
validateTypes
|
|
2670
2717
|
} from "@ai-sdk/provider-utils";
|
|
2671
|
-
import { z as
|
|
2718
|
+
import { z as z20 } from "zod/v4";
|
|
2672
2719
|
function isFileId(data, prefixes) {
|
|
2673
2720
|
if (!prefixes) return false;
|
|
2674
2721
|
return prefixes.some((prefix) => data.startsWith(prefix));
|
|
@@ -2686,8 +2733,8 @@ async function convertToOpenAIResponsesInput({
|
|
|
2686
2733
|
hasApplyPatchTool = false,
|
|
2687
2734
|
customProviderToolNames
|
|
2688
2735
|
}) {
|
|
2689
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
2690
|
-
|
|
2736
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
2737
|
+
let input = [];
|
|
2691
2738
|
const warnings = [];
|
|
2692
2739
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
2693
2740
|
for (const { role, content } of prompt) {
|
|
@@ -2790,6 +2837,32 @@ async function convertToOpenAIResponsesInput({
|
|
|
2790
2837
|
if (hasConversation && id != null) {
|
|
2791
2838
|
break;
|
|
2792
2839
|
}
|
|
2840
|
+
const resolvedToolName = toolNameMapping.toProviderToolName(
|
|
2841
|
+
part.toolName
|
|
2842
|
+
);
|
|
2843
|
+
if (resolvedToolName === "tool_search") {
|
|
2844
|
+
if (store && id != null) {
|
|
2845
|
+
input.push({ type: "item_reference", id });
|
|
2846
|
+
break;
|
|
2847
|
+
}
|
|
2848
|
+
const parsedInput = typeof part.input === "string" ? await parseJSON({
|
|
2849
|
+
text: part.input,
|
|
2850
|
+
schema: toolSearchInputSchema
|
|
2851
|
+
}) : await validateTypes({
|
|
2852
|
+
value: part.input,
|
|
2853
|
+
schema: toolSearchInputSchema
|
|
2854
|
+
});
|
|
2855
|
+
const execution = parsedInput.call_id != null ? "client" : "server";
|
|
2856
|
+
input.push({
|
|
2857
|
+
type: "tool_search_call",
|
|
2858
|
+
id: id != null ? id : part.toolCallId,
|
|
2859
|
+
execution,
|
|
2860
|
+
call_id: (_g = parsedInput.call_id) != null ? _g : null,
|
|
2861
|
+
status: "completed",
|
|
2862
|
+
arguments: parsedInput.arguments
|
|
2863
|
+
});
|
|
2864
|
+
break;
|
|
2865
|
+
}
|
|
2793
2866
|
if (part.providerExecuted) {
|
|
2794
2867
|
if (store && id != null) {
|
|
2795
2868
|
input.push({ type: "item_reference", id });
|
|
@@ -2800,9 +2873,6 @@ async function convertToOpenAIResponsesInput({
|
|
|
2800
2873
|
input.push({ type: "item_reference", id });
|
|
2801
2874
|
break;
|
|
2802
2875
|
}
|
|
2803
|
-
const resolvedToolName = toolNameMapping.toProviderToolName(
|
|
2804
|
-
part.toolName
|
|
2805
|
-
);
|
|
2806
2876
|
if (hasLocalShellTool && resolvedToolName === "local_shell") {
|
|
2807
2877
|
const parsedInput = await validateTypes({
|
|
2808
2878
|
value: part.input,
|
|
@@ -2885,6 +2955,26 @@ async function convertToOpenAIResponsesInput({
|
|
|
2885
2955
|
const resolvedResultToolName = toolNameMapping.toProviderToolName(
|
|
2886
2956
|
part.toolName
|
|
2887
2957
|
);
|
|
2958
|
+
if (resolvedResultToolName === "tool_search") {
|
|
2959
|
+
const itemId = (_j = (_i = (_h = part.providerOptions) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.itemId) != null ? _j : part.toolCallId;
|
|
2960
|
+
if (store) {
|
|
2961
|
+
input.push({ type: "item_reference", id: itemId });
|
|
2962
|
+
} else if (part.output.type === "json") {
|
|
2963
|
+
const parsedOutput = await validateTypes({
|
|
2964
|
+
value: part.output.value,
|
|
2965
|
+
schema: toolSearchOutputSchema
|
|
2966
|
+
});
|
|
2967
|
+
input.push({
|
|
2968
|
+
type: "tool_search_output",
|
|
2969
|
+
id: itemId,
|
|
2970
|
+
execution: "server",
|
|
2971
|
+
call_id: null,
|
|
2972
|
+
status: "completed",
|
|
2973
|
+
tools: parsedOutput.tools
|
|
2974
|
+
});
|
|
2975
|
+
}
|
|
2976
|
+
break;
|
|
2977
|
+
}
|
|
2888
2978
|
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
2889
2979
|
if (part.output.type === "json") {
|
|
2890
2980
|
const parsedOutput = await validateTypes({
|
|
@@ -2907,7 +2997,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2907
2997
|
break;
|
|
2908
2998
|
}
|
|
2909
2999
|
if (store) {
|
|
2910
|
-
const itemId = (
|
|
3000
|
+
const itemId = (_m = (_l = (_k = part.providerOptions) == null ? void 0 : _k[providerOptionsName]) == null ? void 0 : _l.itemId) != null ? _m : part.toolCallId;
|
|
2911
3001
|
input.push({ type: "item_reference", id: itemId });
|
|
2912
3002
|
} else {
|
|
2913
3003
|
warnings.push({
|
|
@@ -3017,7 +3107,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3017
3107
|
}
|
|
3018
3108
|
const output = part.output;
|
|
3019
3109
|
if (output.type === "execution-denied") {
|
|
3020
|
-
const approvalId = (
|
|
3110
|
+
const approvalId = (_o = (_n = output.providerOptions) == null ? void 0 : _n.openai) == null ? void 0 : _o.approvalId;
|
|
3021
3111
|
if (approvalId) {
|
|
3022
3112
|
continue;
|
|
3023
3113
|
}
|
|
@@ -3025,6 +3115,20 @@ async function convertToOpenAIResponsesInput({
|
|
|
3025
3115
|
const resolvedToolName = toolNameMapping.toProviderToolName(
|
|
3026
3116
|
part.toolName
|
|
3027
3117
|
);
|
|
3118
|
+
if (resolvedToolName === "tool_search" && output.type === "json") {
|
|
3119
|
+
const parsedOutput = await validateTypes({
|
|
3120
|
+
value: output.value,
|
|
3121
|
+
schema: toolSearchOutputSchema
|
|
3122
|
+
});
|
|
3123
|
+
input.push({
|
|
3124
|
+
type: "tool_search_output",
|
|
3125
|
+
execution: "client",
|
|
3126
|
+
call_id: part.toolCallId,
|
|
3127
|
+
status: "completed",
|
|
3128
|
+
tools: parsedOutput.tools
|
|
3129
|
+
});
|
|
3130
|
+
continue;
|
|
3131
|
+
}
|
|
3028
3132
|
if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
|
|
3029
3133
|
const parsedOutput = await validateTypes({
|
|
3030
3134
|
value: output.value,
|
|
@@ -3077,7 +3181,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3077
3181
|
outputValue = output.value;
|
|
3078
3182
|
break;
|
|
3079
3183
|
case "execution-denied":
|
|
3080
|
-
outputValue = (
|
|
3184
|
+
outputValue = (_p = output.reason) != null ? _p : "Tool execution denied.";
|
|
3081
3185
|
break;
|
|
3082
3186
|
case "json":
|
|
3083
3187
|
case "error-json":
|
|
@@ -3131,7 +3235,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3131
3235
|
contentValue = output.value;
|
|
3132
3236
|
break;
|
|
3133
3237
|
case "execution-denied":
|
|
3134
|
-
contentValue = (
|
|
3238
|
+
contentValue = (_q = output.reason) != null ? _q : "Tool execution denied.";
|
|
3135
3239
|
break;
|
|
3136
3240
|
case "json":
|
|
3137
3241
|
case "error-json":
|
|
@@ -3188,11 +3292,22 @@ async function convertToOpenAIResponsesInput({
|
|
|
3188
3292
|
}
|
|
3189
3293
|
}
|
|
3190
3294
|
}
|
|
3295
|
+
if (!store && input.some(
|
|
3296
|
+
(item) => "type" in item && item.type === "reasoning" && item.encrypted_content == null
|
|
3297
|
+
)) {
|
|
3298
|
+
warnings.push({
|
|
3299
|
+
type: "other",
|
|
3300
|
+
message: "Reasoning parts without encrypted content are not supported when store is false. Skipping reasoning parts."
|
|
3301
|
+
});
|
|
3302
|
+
input = input.filter(
|
|
3303
|
+
(item) => !("type" in item) || item.type !== "reasoning" || item.encrypted_content != null
|
|
3304
|
+
);
|
|
3305
|
+
}
|
|
3191
3306
|
return { input, warnings };
|
|
3192
3307
|
}
|
|
3193
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
3194
|
-
itemId:
|
|
3195
|
-
reasoningEncryptedContent:
|
|
3308
|
+
var openaiResponsesReasoningProviderOptionsSchema = z20.object({
|
|
3309
|
+
itemId: z20.string().nullish(),
|
|
3310
|
+
reasoningEncryptedContent: z20.string().nullish()
|
|
3196
3311
|
});
|
|
3197
3312
|
|
|
3198
3313
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -3214,483 +3329,525 @@ function mapOpenAIResponseFinishReason({
|
|
|
3214
3329
|
}
|
|
3215
3330
|
|
|
3216
3331
|
// src/responses/openai-responses-api.ts
|
|
3217
|
-
import { lazySchema as
|
|
3218
|
-
import { z as
|
|
3219
|
-
var
|
|
3220
|
-
() =>
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3332
|
+
import { lazySchema as lazySchema19, zodSchema as zodSchema19 } from "@ai-sdk/provider-utils";
|
|
3333
|
+
import { z as z21 } from "zod/v4";
|
|
3334
|
+
var jsonValueSchema2 = z21.lazy(
|
|
3335
|
+
() => z21.union([
|
|
3336
|
+
z21.string(),
|
|
3337
|
+
z21.number(),
|
|
3338
|
+
z21.boolean(),
|
|
3339
|
+
z21.null(),
|
|
3340
|
+
z21.array(jsonValueSchema2),
|
|
3341
|
+
z21.record(z21.string(), jsonValueSchema2.optional())
|
|
3342
|
+
])
|
|
3343
|
+
);
|
|
3344
|
+
var openaiResponsesChunkSchema = lazySchema19(
|
|
3345
|
+
() => zodSchema19(
|
|
3346
|
+
z21.union([
|
|
3347
|
+
z21.object({
|
|
3348
|
+
type: z21.literal("response.output_text.delta"),
|
|
3349
|
+
item_id: z21.string(),
|
|
3350
|
+
delta: z21.string(),
|
|
3351
|
+
logprobs: z21.array(
|
|
3352
|
+
z21.object({
|
|
3353
|
+
token: z21.string(),
|
|
3354
|
+
logprob: z21.number(),
|
|
3355
|
+
top_logprobs: z21.array(
|
|
3356
|
+
z21.object({
|
|
3357
|
+
token: z21.string(),
|
|
3358
|
+
logprob: z21.number()
|
|
3234
3359
|
})
|
|
3235
3360
|
)
|
|
3236
3361
|
})
|
|
3237
3362
|
).nullish()
|
|
3238
3363
|
}),
|
|
3239
|
-
|
|
3240
|
-
type:
|
|
3241
|
-
response:
|
|
3242
|
-
incomplete_details:
|
|
3243
|
-
usage:
|
|
3244
|
-
input_tokens:
|
|
3245
|
-
input_tokens_details:
|
|
3246
|
-
output_tokens:
|
|
3247
|
-
output_tokens_details:
|
|
3364
|
+
z21.object({
|
|
3365
|
+
type: z21.enum(["response.completed", "response.incomplete"]),
|
|
3366
|
+
response: z21.object({
|
|
3367
|
+
incomplete_details: z21.object({ reason: z21.string() }).nullish(),
|
|
3368
|
+
usage: z21.object({
|
|
3369
|
+
input_tokens: z21.number(),
|
|
3370
|
+
input_tokens_details: z21.object({ cached_tokens: z21.number().nullish() }).nullish(),
|
|
3371
|
+
output_tokens: z21.number(),
|
|
3372
|
+
output_tokens_details: z21.object({ reasoning_tokens: z21.number().nullish() }).nullish()
|
|
3248
3373
|
}),
|
|
3249
|
-
service_tier:
|
|
3374
|
+
service_tier: z21.string().nullish()
|
|
3250
3375
|
})
|
|
3251
3376
|
}),
|
|
3252
|
-
|
|
3253
|
-
type:
|
|
3254
|
-
response:
|
|
3255
|
-
id:
|
|
3256
|
-
created_at:
|
|
3257
|
-
model:
|
|
3258
|
-
service_tier:
|
|
3377
|
+
z21.object({
|
|
3378
|
+
type: z21.literal("response.created"),
|
|
3379
|
+
response: z21.object({
|
|
3380
|
+
id: z21.string(),
|
|
3381
|
+
created_at: z21.number(),
|
|
3382
|
+
model: z21.string(),
|
|
3383
|
+
service_tier: z21.string().nullish()
|
|
3259
3384
|
})
|
|
3260
3385
|
}),
|
|
3261
|
-
|
|
3262
|
-
type:
|
|
3263
|
-
output_index:
|
|
3264
|
-
item:
|
|
3265
|
-
|
|
3266
|
-
type:
|
|
3267
|
-
id:
|
|
3268
|
-
phase:
|
|
3386
|
+
z21.object({
|
|
3387
|
+
type: z21.literal("response.output_item.added"),
|
|
3388
|
+
output_index: z21.number(),
|
|
3389
|
+
item: z21.discriminatedUnion("type", [
|
|
3390
|
+
z21.object({
|
|
3391
|
+
type: z21.literal("message"),
|
|
3392
|
+
id: z21.string(),
|
|
3393
|
+
phase: z21.enum(["commentary", "final_answer"]).nullish()
|
|
3269
3394
|
}),
|
|
3270
|
-
|
|
3271
|
-
type:
|
|
3272
|
-
id:
|
|
3273
|
-
encrypted_content:
|
|
3395
|
+
z21.object({
|
|
3396
|
+
type: z21.literal("reasoning"),
|
|
3397
|
+
id: z21.string(),
|
|
3398
|
+
encrypted_content: z21.string().nullish()
|
|
3274
3399
|
}),
|
|
3275
|
-
|
|
3276
|
-
type:
|
|
3277
|
-
id:
|
|
3278
|
-
call_id:
|
|
3279
|
-
name:
|
|
3280
|
-
arguments:
|
|
3400
|
+
z21.object({
|
|
3401
|
+
type: z21.literal("function_call"),
|
|
3402
|
+
id: z21.string(),
|
|
3403
|
+
call_id: z21.string(),
|
|
3404
|
+
name: z21.string(),
|
|
3405
|
+
arguments: z21.string()
|
|
3281
3406
|
}),
|
|
3282
|
-
|
|
3283
|
-
type:
|
|
3284
|
-
id:
|
|
3285
|
-
status:
|
|
3407
|
+
z21.object({
|
|
3408
|
+
type: z21.literal("web_search_call"),
|
|
3409
|
+
id: z21.string(),
|
|
3410
|
+
status: z21.string()
|
|
3286
3411
|
}),
|
|
3287
|
-
|
|
3288
|
-
type:
|
|
3289
|
-
id:
|
|
3290
|
-
status:
|
|
3412
|
+
z21.object({
|
|
3413
|
+
type: z21.literal("computer_call"),
|
|
3414
|
+
id: z21.string(),
|
|
3415
|
+
status: z21.string()
|
|
3291
3416
|
}),
|
|
3292
|
-
|
|
3293
|
-
type:
|
|
3294
|
-
id:
|
|
3417
|
+
z21.object({
|
|
3418
|
+
type: z21.literal("file_search_call"),
|
|
3419
|
+
id: z21.string()
|
|
3295
3420
|
}),
|
|
3296
|
-
|
|
3297
|
-
type:
|
|
3298
|
-
id:
|
|
3421
|
+
z21.object({
|
|
3422
|
+
type: z21.literal("image_generation_call"),
|
|
3423
|
+
id: z21.string()
|
|
3299
3424
|
}),
|
|
3300
|
-
|
|
3301
|
-
type:
|
|
3302
|
-
id:
|
|
3303
|
-
container_id:
|
|
3304
|
-
code:
|
|
3305
|
-
outputs:
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3425
|
+
z21.object({
|
|
3426
|
+
type: z21.literal("code_interpreter_call"),
|
|
3427
|
+
id: z21.string(),
|
|
3428
|
+
container_id: z21.string(),
|
|
3429
|
+
code: z21.string().nullable(),
|
|
3430
|
+
outputs: z21.array(
|
|
3431
|
+
z21.discriminatedUnion("type", [
|
|
3432
|
+
z21.object({ type: z21.literal("logs"), logs: z21.string() }),
|
|
3433
|
+
z21.object({ type: z21.literal("image"), url: z21.string() })
|
|
3309
3434
|
])
|
|
3310
3435
|
).nullable(),
|
|
3311
|
-
status:
|
|
3436
|
+
status: z21.string()
|
|
3312
3437
|
}),
|
|
3313
|
-
|
|
3314
|
-
type:
|
|
3315
|
-
id:
|
|
3316
|
-
status:
|
|
3317
|
-
approval_request_id:
|
|
3438
|
+
z21.object({
|
|
3439
|
+
type: z21.literal("mcp_call"),
|
|
3440
|
+
id: z21.string(),
|
|
3441
|
+
status: z21.string(),
|
|
3442
|
+
approval_request_id: z21.string().nullish()
|
|
3318
3443
|
}),
|
|
3319
|
-
|
|
3320
|
-
type:
|
|
3321
|
-
id:
|
|
3444
|
+
z21.object({
|
|
3445
|
+
type: z21.literal("mcp_list_tools"),
|
|
3446
|
+
id: z21.string()
|
|
3322
3447
|
}),
|
|
3323
|
-
|
|
3324
|
-
type:
|
|
3325
|
-
id:
|
|
3448
|
+
z21.object({
|
|
3449
|
+
type: z21.literal("mcp_approval_request"),
|
|
3450
|
+
id: z21.string()
|
|
3326
3451
|
}),
|
|
3327
|
-
|
|
3328
|
-
type:
|
|
3329
|
-
id:
|
|
3330
|
-
call_id:
|
|
3331
|
-
status:
|
|
3332
|
-
operation:
|
|
3333
|
-
|
|
3334
|
-
type:
|
|
3335
|
-
path:
|
|
3336
|
-
diff:
|
|
3452
|
+
z21.object({
|
|
3453
|
+
type: z21.literal("apply_patch_call"),
|
|
3454
|
+
id: z21.string(),
|
|
3455
|
+
call_id: z21.string(),
|
|
3456
|
+
status: z21.enum(["in_progress", "completed"]),
|
|
3457
|
+
operation: z21.discriminatedUnion("type", [
|
|
3458
|
+
z21.object({
|
|
3459
|
+
type: z21.literal("create_file"),
|
|
3460
|
+
path: z21.string(),
|
|
3461
|
+
diff: z21.string()
|
|
3337
3462
|
}),
|
|
3338
|
-
|
|
3339
|
-
type:
|
|
3340
|
-
path:
|
|
3463
|
+
z21.object({
|
|
3464
|
+
type: z21.literal("delete_file"),
|
|
3465
|
+
path: z21.string()
|
|
3341
3466
|
}),
|
|
3342
|
-
|
|
3343
|
-
type:
|
|
3344
|
-
path:
|
|
3345
|
-
diff:
|
|
3467
|
+
z21.object({
|
|
3468
|
+
type: z21.literal("update_file"),
|
|
3469
|
+
path: z21.string(),
|
|
3470
|
+
diff: z21.string()
|
|
3346
3471
|
})
|
|
3347
3472
|
])
|
|
3348
3473
|
}),
|
|
3349
|
-
|
|
3350
|
-
type:
|
|
3351
|
-
id:
|
|
3352
|
-
call_id:
|
|
3353
|
-
name:
|
|
3354
|
-
input:
|
|
3474
|
+
z21.object({
|
|
3475
|
+
type: z21.literal("custom_tool_call"),
|
|
3476
|
+
id: z21.string(),
|
|
3477
|
+
call_id: z21.string(),
|
|
3478
|
+
name: z21.string(),
|
|
3479
|
+
input: z21.string()
|
|
3355
3480
|
}),
|
|
3356
|
-
|
|
3357
|
-
type:
|
|
3358
|
-
id:
|
|
3359
|
-
call_id:
|
|
3360
|
-
status:
|
|
3361
|
-
action:
|
|
3362
|
-
commands:
|
|
3481
|
+
z21.object({
|
|
3482
|
+
type: z21.literal("shell_call"),
|
|
3483
|
+
id: z21.string(),
|
|
3484
|
+
call_id: z21.string(),
|
|
3485
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
3486
|
+
action: z21.object({
|
|
3487
|
+
commands: z21.array(z21.string())
|
|
3363
3488
|
})
|
|
3364
3489
|
}),
|
|
3365
|
-
|
|
3366
|
-
type:
|
|
3367
|
-
id:
|
|
3368
|
-
call_id:
|
|
3369
|
-
status:
|
|
3370
|
-
output:
|
|
3371
|
-
|
|
3372
|
-
stdout:
|
|
3373
|
-
stderr:
|
|
3374
|
-
outcome:
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
type:
|
|
3378
|
-
exit_code:
|
|
3490
|
+
z21.object({
|
|
3491
|
+
type: z21.literal("shell_call_output"),
|
|
3492
|
+
id: z21.string(),
|
|
3493
|
+
call_id: z21.string(),
|
|
3494
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
3495
|
+
output: z21.array(
|
|
3496
|
+
z21.object({
|
|
3497
|
+
stdout: z21.string(),
|
|
3498
|
+
stderr: z21.string(),
|
|
3499
|
+
outcome: z21.discriminatedUnion("type", [
|
|
3500
|
+
z21.object({ type: z21.literal("timeout") }),
|
|
3501
|
+
z21.object({
|
|
3502
|
+
type: z21.literal("exit"),
|
|
3503
|
+
exit_code: z21.number()
|
|
3379
3504
|
})
|
|
3380
3505
|
])
|
|
3381
3506
|
})
|
|
3382
3507
|
)
|
|
3508
|
+
}),
|
|
3509
|
+
z21.object({
|
|
3510
|
+
type: z21.literal("tool_search_call"),
|
|
3511
|
+
id: z21.string(),
|
|
3512
|
+
execution: z21.enum(["server", "client"]),
|
|
3513
|
+
call_id: z21.string().nullable(),
|
|
3514
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
3515
|
+
arguments: z21.unknown()
|
|
3516
|
+
}),
|
|
3517
|
+
z21.object({
|
|
3518
|
+
type: z21.literal("tool_search_output"),
|
|
3519
|
+
id: z21.string(),
|
|
3520
|
+
execution: z21.enum(["server", "client"]),
|
|
3521
|
+
call_id: z21.string().nullable(),
|
|
3522
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
3523
|
+
tools: z21.array(z21.record(z21.string(), jsonValueSchema2.optional()))
|
|
3383
3524
|
})
|
|
3384
3525
|
])
|
|
3385
3526
|
}),
|
|
3386
|
-
|
|
3387
|
-
type:
|
|
3388
|
-
output_index:
|
|
3389
|
-
item:
|
|
3390
|
-
|
|
3391
|
-
type:
|
|
3392
|
-
id:
|
|
3393
|
-
phase:
|
|
3527
|
+
z21.object({
|
|
3528
|
+
type: z21.literal("response.output_item.done"),
|
|
3529
|
+
output_index: z21.number(),
|
|
3530
|
+
item: z21.discriminatedUnion("type", [
|
|
3531
|
+
z21.object({
|
|
3532
|
+
type: z21.literal("message"),
|
|
3533
|
+
id: z21.string(),
|
|
3534
|
+
phase: z21.enum(["commentary", "final_answer"]).nullish()
|
|
3394
3535
|
}),
|
|
3395
|
-
|
|
3396
|
-
type:
|
|
3397
|
-
id:
|
|
3398
|
-
encrypted_content:
|
|
3536
|
+
z21.object({
|
|
3537
|
+
type: z21.literal("reasoning"),
|
|
3538
|
+
id: z21.string(),
|
|
3539
|
+
encrypted_content: z21.string().nullish()
|
|
3399
3540
|
}),
|
|
3400
|
-
|
|
3401
|
-
type:
|
|
3402
|
-
id:
|
|
3403
|
-
call_id:
|
|
3404
|
-
name:
|
|
3405
|
-
arguments:
|
|
3406
|
-
status:
|
|
3541
|
+
z21.object({
|
|
3542
|
+
type: z21.literal("function_call"),
|
|
3543
|
+
id: z21.string(),
|
|
3544
|
+
call_id: z21.string(),
|
|
3545
|
+
name: z21.string(),
|
|
3546
|
+
arguments: z21.string(),
|
|
3547
|
+
status: z21.literal("completed")
|
|
3407
3548
|
}),
|
|
3408
|
-
|
|
3409
|
-
type:
|
|
3410
|
-
id:
|
|
3411
|
-
call_id:
|
|
3412
|
-
name:
|
|
3413
|
-
input:
|
|
3414
|
-
status:
|
|
3549
|
+
z21.object({
|
|
3550
|
+
type: z21.literal("custom_tool_call"),
|
|
3551
|
+
id: z21.string(),
|
|
3552
|
+
call_id: z21.string(),
|
|
3553
|
+
name: z21.string(),
|
|
3554
|
+
input: z21.string(),
|
|
3555
|
+
status: z21.literal("completed")
|
|
3415
3556
|
}),
|
|
3416
|
-
|
|
3417
|
-
type:
|
|
3418
|
-
id:
|
|
3419
|
-
code:
|
|
3420
|
-
container_id:
|
|
3421
|
-
outputs:
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3557
|
+
z21.object({
|
|
3558
|
+
type: z21.literal("code_interpreter_call"),
|
|
3559
|
+
id: z21.string(),
|
|
3560
|
+
code: z21.string().nullable(),
|
|
3561
|
+
container_id: z21.string(),
|
|
3562
|
+
outputs: z21.array(
|
|
3563
|
+
z21.discriminatedUnion("type", [
|
|
3564
|
+
z21.object({ type: z21.literal("logs"), logs: z21.string() }),
|
|
3565
|
+
z21.object({ type: z21.literal("image"), url: z21.string() })
|
|
3425
3566
|
])
|
|
3426
3567
|
).nullable()
|
|
3427
3568
|
}),
|
|
3428
|
-
|
|
3429
|
-
type:
|
|
3430
|
-
id:
|
|
3431
|
-
result:
|
|
3569
|
+
z21.object({
|
|
3570
|
+
type: z21.literal("image_generation_call"),
|
|
3571
|
+
id: z21.string(),
|
|
3572
|
+
result: z21.string()
|
|
3432
3573
|
}),
|
|
3433
|
-
|
|
3434
|
-
type:
|
|
3435
|
-
id:
|
|
3436
|
-
status:
|
|
3437
|
-
action:
|
|
3438
|
-
|
|
3439
|
-
type:
|
|
3440
|
-
query:
|
|
3441
|
-
sources:
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3574
|
+
z21.object({
|
|
3575
|
+
type: z21.literal("web_search_call"),
|
|
3576
|
+
id: z21.string(),
|
|
3577
|
+
status: z21.string(),
|
|
3578
|
+
action: z21.discriminatedUnion("type", [
|
|
3579
|
+
z21.object({
|
|
3580
|
+
type: z21.literal("search"),
|
|
3581
|
+
query: z21.string().nullish(),
|
|
3582
|
+
sources: z21.array(
|
|
3583
|
+
z21.discriminatedUnion("type", [
|
|
3584
|
+
z21.object({ type: z21.literal("url"), url: z21.string() }),
|
|
3585
|
+
z21.object({ type: z21.literal("api"), name: z21.string() })
|
|
3445
3586
|
])
|
|
3446
3587
|
).nullish()
|
|
3447
3588
|
}),
|
|
3448
|
-
|
|
3449
|
-
type:
|
|
3450
|
-
url:
|
|
3589
|
+
z21.object({
|
|
3590
|
+
type: z21.literal("open_page"),
|
|
3591
|
+
url: z21.string().nullish()
|
|
3451
3592
|
}),
|
|
3452
|
-
|
|
3453
|
-
type:
|
|
3454
|
-
url:
|
|
3455
|
-
pattern:
|
|
3593
|
+
z21.object({
|
|
3594
|
+
type: z21.literal("find_in_page"),
|
|
3595
|
+
url: z21.string().nullish(),
|
|
3596
|
+
pattern: z21.string().nullish()
|
|
3456
3597
|
})
|
|
3457
3598
|
]).nullish()
|
|
3458
3599
|
}),
|
|
3459
|
-
|
|
3460
|
-
type:
|
|
3461
|
-
id:
|
|
3462
|
-
queries:
|
|
3463
|
-
results:
|
|
3464
|
-
|
|
3465
|
-
attributes:
|
|
3466
|
-
|
|
3467
|
-
|
|
3600
|
+
z21.object({
|
|
3601
|
+
type: z21.literal("file_search_call"),
|
|
3602
|
+
id: z21.string(),
|
|
3603
|
+
queries: z21.array(z21.string()),
|
|
3604
|
+
results: z21.array(
|
|
3605
|
+
z21.object({
|
|
3606
|
+
attributes: z21.record(
|
|
3607
|
+
z21.string(),
|
|
3608
|
+
z21.union([z21.string(), z21.number(), z21.boolean()])
|
|
3468
3609
|
),
|
|
3469
|
-
file_id:
|
|
3470
|
-
filename:
|
|
3471
|
-
score:
|
|
3472
|
-
text:
|
|
3610
|
+
file_id: z21.string(),
|
|
3611
|
+
filename: z21.string(),
|
|
3612
|
+
score: z21.number(),
|
|
3613
|
+
text: z21.string()
|
|
3473
3614
|
})
|
|
3474
3615
|
).nullish()
|
|
3475
3616
|
}),
|
|
3476
|
-
|
|
3477
|
-
type:
|
|
3478
|
-
id:
|
|
3479
|
-
call_id:
|
|
3480
|
-
action:
|
|
3481
|
-
type:
|
|
3482
|
-
command:
|
|
3483
|
-
timeout_ms:
|
|
3484
|
-
user:
|
|
3485
|
-
working_directory:
|
|
3486
|
-
env:
|
|
3617
|
+
z21.object({
|
|
3618
|
+
type: z21.literal("local_shell_call"),
|
|
3619
|
+
id: z21.string(),
|
|
3620
|
+
call_id: z21.string(),
|
|
3621
|
+
action: z21.object({
|
|
3622
|
+
type: z21.literal("exec"),
|
|
3623
|
+
command: z21.array(z21.string()),
|
|
3624
|
+
timeout_ms: z21.number().optional(),
|
|
3625
|
+
user: z21.string().optional(),
|
|
3626
|
+
working_directory: z21.string().optional(),
|
|
3627
|
+
env: z21.record(z21.string(), z21.string()).optional()
|
|
3487
3628
|
})
|
|
3488
3629
|
}),
|
|
3489
|
-
|
|
3490
|
-
type:
|
|
3491
|
-
id:
|
|
3492
|
-
status:
|
|
3630
|
+
z21.object({
|
|
3631
|
+
type: z21.literal("computer_call"),
|
|
3632
|
+
id: z21.string(),
|
|
3633
|
+
status: z21.literal("completed")
|
|
3493
3634
|
}),
|
|
3494
|
-
|
|
3495
|
-
type:
|
|
3496
|
-
id:
|
|
3497
|
-
status:
|
|
3498
|
-
arguments:
|
|
3499
|
-
name:
|
|
3500
|
-
server_label:
|
|
3501
|
-
output:
|
|
3502
|
-
error:
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
type:
|
|
3506
|
-
code:
|
|
3507
|
-
message:
|
|
3635
|
+
z21.object({
|
|
3636
|
+
type: z21.literal("mcp_call"),
|
|
3637
|
+
id: z21.string(),
|
|
3638
|
+
status: z21.string(),
|
|
3639
|
+
arguments: z21.string(),
|
|
3640
|
+
name: z21.string(),
|
|
3641
|
+
server_label: z21.string(),
|
|
3642
|
+
output: z21.string().nullish(),
|
|
3643
|
+
error: z21.union([
|
|
3644
|
+
z21.string(),
|
|
3645
|
+
z21.object({
|
|
3646
|
+
type: z21.string().optional(),
|
|
3647
|
+
code: z21.union([z21.number(), z21.string()]).optional(),
|
|
3648
|
+
message: z21.string().optional()
|
|
3508
3649
|
}).loose()
|
|
3509
3650
|
]).nullish(),
|
|
3510
|
-
approval_request_id:
|
|
3651
|
+
approval_request_id: z21.string().nullish()
|
|
3511
3652
|
}),
|
|
3512
|
-
|
|
3513
|
-
type:
|
|
3514
|
-
id:
|
|
3515
|
-
server_label:
|
|
3516
|
-
tools:
|
|
3517
|
-
|
|
3518
|
-
name:
|
|
3519
|
-
description:
|
|
3520
|
-
input_schema:
|
|
3521
|
-
annotations:
|
|
3653
|
+
z21.object({
|
|
3654
|
+
type: z21.literal("mcp_list_tools"),
|
|
3655
|
+
id: z21.string(),
|
|
3656
|
+
server_label: z21.string(),
|
|
3657
|
+
tools: z21.array(
|
|
3658
|
+
z21.object({
|
|
3659
|
+
name: z21.string(),
|
|
3660
|
+
description: z21.string().optional(),
|
|
3661
|
+
input_schema: z21.any(),
|
|
3662
|
+
annotations: z21.record(z21.string(), z21.unknown()).optional()
|
|
3522
3663
|
})
|
|
3523
3664
|
),
|
|
3524
|
-
error:
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
type:
|
|
3528
|
-
code:
|
|
3529
|
-
message:
|
|
3665
|
+
error: z21.union([
|
|
3666
|
+
z21.string(),
|
|
3667
|
+
z21.object({
|
|
3668
|
+
type: z21.string().optional(),
|
|
3669
|
+
code: z21.union([z21.number(), z21.string()]).optional(),
|
|
3670
|
+
message: z21.string().optional()
|
|
3530
3671
|
}).loose()
|
|
3531
3672
|
]).optional()
|
|
3532
3673
|
}),
|
|
3533
|
-
|
|
3534
|
-
type:
|
|
3535
|
-
id:
|
|
3536
|
-
server_label:
|
|
3537
|
-
name:
|
|
3538
|
-
arguments:
|
|
3539
|
-
approval_request_id:
|
|
3674
|
+
z21.object({
|
|
3675
|
+
type: z21.literal("mcp_approval_request"),
|
|
3676
|
+
id: z21.string(),
|
|
3677
|
+
server_label: z21.string(),
|
|
3678
|
+
name: z21.string(),
|
|
3679
|
+
arguments: z21.string(),
|
|
3680
|
+
approval_request_id: z21.string().optional()
|
|
3540
3681
|
}),
|
|
3541
|
-
|
|
3542
|
-
type:
|
|
3543
|
-
id:
|
|
3544
|
-
call_id:
|
|
3545
|
-
status:
|
|
3546
|
-
operation:
|
|
3547
|
-
|
|
3548
|
-
type:
|
|
3549
|
-
path:
|
|
3550
|
-
diff:
|
|
3682
|
+
z21.object({
|
|
3683
|
+
type: z21.literal("apply_patch_call"),
|
|
3684
|
+
id: z21.string(),
|
|
3685
|
+
call_id: z21.string(),
|
|
3686
|
+
status: z21.enum(["in_progress", "completed"]),
|
|
3687
|
+
operation: z21.discriminatedUnion("type", [
|
|
3688
|
+
z21.object({
|
|
3689
|
+
type: z21.literal("create_file"),
|
|
3690
|
+
path: z21.string(),
|
|
3691
|
+
diff: z21.string()
|
|
3551
3692
|
}),
|
|
3552
|
-
|
|
3553
|
-
type:
|
|
3554
|
-
path:
|
|
3693
|
+
z21.object({
|
|
3694
|
+
type: z21.literal("delete_file"),
|
|
3695
|
+
path: z21.string()
|
|
3555
3696
|
}),
|
|
3556
|
-
|
|
3557
|
-
type:
|
|
3558
|
-
path:
|
|
3559
|
-
diff:
|
|
3697
|
+
z21.object({
|
|
3698
|
+
type: z21.literal("update_file"),
|
|
3699
|
+
path: z21.string(),
|
|
3700
|
+
diff: z21.string()
|
|
3560
3701
|
})
|
|
3561
3702
|
])
|
|
3562
3703
|
}),
|
|
3563
|
-
|
|
3564
|
-
type:
|
|
3565
|
-
id:
|
|
3566
|
-
call_id:
|
|
3567
|
-
status:
|
|
3568
|
-
action:
|
|
3569
|
-
commands:
|
|
3704
|
+
z21.object({
|
|
3705
|
+
type: z21.literal("shell_call"),
|
|
3706
|
+
id: z21.string(),
|
|
3707
|
+
call_id: z21.string(),
|
|
3708
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
3709
|
+
action: z21.object({
|
|
3710
|
+
commands: z21.array(z21.string())
|
|
3570
3711
|
})
|
|
3571
3712
|
}),
|
|
3572
|
-
|
|
3573
|
-
type:
|
|
3574
|
-
id:
|
|
3575
|
-
call_id:
|
|
3576
|
-
status:
|
|
3577
|
-
output:
|
|
3578
|
-
|
|
3579
|
-
stdout:
|
|
3580
|
-
stderr:
|
|
3581
|
-
outcome:
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
type:
|
|
3585
|
-
exit_code:
|
|
3713
|
+
z21.object({
|
|
3714
|
+
type: z21.literal("shell_call_output"),
|
|
3715
|
+
id: z21.string(),
|
|
3716
|
+
call_id: z21.string(),
|
|
3717
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
3718
|
+
output: z21.array(
|
|
3719
|
+
z21.object({
|
|
3720
|
+
stdout: z21.string(),
|
|
3721
|
+
stderr: z21.string(),
|
|
3722
|
+
outcome: z21.discriminatedUnion("type", [
|
|
3723
|
+
z21.object({ type: z21.literal("timeout") }),
|
|
3724
|
+
z21.object({
|
|
3725
|
+
type: z21.literal("exit"),
|
|
3726
|
+
exit_code: z21.number()
|
|
3586
3727
|
})
|
|
3587
3728
|
])
|
|
3588
3729
|
})
|
|
3589
3730
|
)
|
|
3731
|
+
}),
|
|
3732
|
+
z21.object({
|
|
3733
|
+
type: z21.literal("tool_search_call"),
|
|
3734
|
+
id: z21.string(),
|
|
3735
|
+
execution: z21.enum(["server", "client"]),
|
|
3736
|
+
call_id: z21.string().nullable(),
|
|
3737
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
3738
|
+
arguments: z21.unknown()
|
|
3739
|
+
}),
|
|
3740
|
+
z21.object({
|
|
3741
|
+
type: z21.literal("tool_search_output"),
|
|
3742
|
+
id: z21.string(),
|
|
3743
|
+
execution: z21.enum(["server", "client"]),
|
|
3744
|
+
call_id: z21.string().nullable(),
|
|
3745
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
3746
|
+
tools: z21.array(z21.record(z21.string(), jsonValueSchema2.optional()))
|
|
3590
3747
|
})
|
|
3591
3748
|
])
|
|
3592
3749
|
}),
|
|
3593
|
-
|
|
3594
|
-
type:
|
|
3595
|
-
item_id:
|
|
3596
|
-
output_index:
|
|
3597
|
-
delta:
|
|
3750
|
+
z21.object({
|
|
3751
|
+
type: z21.literal("response.function_call_arguments.delta"),
|
|
3752
|
+
item_id: z21.string(),
|
|
3753
|
+
output_index: z21.number(),
|
|
3754
|
+
delta: z21.string()
|
|
3598
3755
|
}),
|
|
3599
|
-
|
|
3600
|
-
type:
|
|
3601
|
-
item_id:
|
|
3602
|
-
output_index:
|
|
3603
|
-
delta:
|
|
3756
|
+
z21.object({
|
|
3757
|
+
type: z21.literal("response.custom_tool_call_input.delta"),
|
|
3758
|
+
item_id: z21.string(),
|
|
3759
|
+
output_index: z21.number(),
|
|
3760
|
+
delta: z21.string()
|
|
3604
3761
|
}),
|
|
3605
|
-
|
|
3606
|
-
type:
|
|
3607
|
-
item_id:
|
|
3608
|
-
output_index:
|
|
3609
|
-
partial_image_b64:
|
|
3762
|
+
z21.object({
|
|
3763
|
+
type: z21.literal("response.image_generation_call.partial_image"),
|
|
3764
|
+
item_id: z21.string(),
|
|
3765
|
+
output_index: z21.number(),
|
|
3766
|
+
partial_image_b64: z21.string()
|
|
3610
3767
|
}),
|
|
3611
|
-
|
|
3612
|
-
type:
|
|
3613
|
-
item_id:
|
|
3614
|
-
output_index:
|
|
3615
|
-
delta:
|
|
3768
|
+
z21.object({
|
|
3769
|
+
type: z21.literal("response.code_interpreter_call_code.delta"),
|
|
3770
|
+
item_id: z21.string(),
|
|
3771
|
+
output_index: z21.number(),
|
|
3772
|
+
delta: z21.string()
|
|
3616
3773
|
}),
|
|
3617
|
-
|
|
3618
|
-
type:
|
|
3619
|
-
item_id:
|
|
3620
|
-
output_index:
|
|
3621
|
-
code:
|
|
3774
|
+
z21.object({
|
|
3775
|
+
type: z21.literal("response.code_interpreter_call_code.done"),
|
|
3776
|
+
item_id: z21.string(),
|
|
3777
|
+
output_index: z21.number(),
|
|
3778
|
+
code: z21.string()
|
|
3622
3779
|
}),
|
|
3623
|
-
|
|
3624
|
-
type:
|
|
3625
|
-
annotation:
|
|
3626
|
-
|
|
3627
|
-
type:
|
|
3628
|
-
start_index:
|
|
3629
|
-
end_index:
|
|
3630
|
-
url:
|
|
3631
|
-
title:
|
|
3780
|
+
z21.object({
|
|
3781
|
+
type: z21.literal("response.output_text.annotation.added"),
|
|
3782
|
+
annotation: z21.discriminatedUnion("type", [
|
|
3783
|
+
z21.object({
|
|
3784
|
+
type: z21.literal("url_citation"),
|
|
3785
|
+
start_index: z21.number(),
|
|
3786
|
+
end_index: z21.number(),
|
|
3787
|
+
url: z21.string(),
|
|
3788
|
+
title: z21.string()
|
|
3632
3789
|
}),
|
|
3633
|
-
|
|
3634
|
-
type:
|
|
3635
|
-
file_id:
|
|
3636
|
-
filename:
|
|
3637
|
-
index:
|
|
3790
|
+
z21.object({
|
|
3791
|
+
type: z21.literal("file_citation"),
|
|
3792
|
+
file_id: z21.string(),
|
|
3793
|
+
filename: z21.string(),
|
|
3794
|
+
index: z21.number()
|
|
3638
3795
|
}),
|
|
3639
|
-
|
|
3640
|
-
type:
|
|
3641
|
-
container_id:
|
|
3642
|
-
file_id:
|
|
3643
|
-
filename:
|
|
3644
|
-
start_index:
|
|
3645
|
-
end_index:
|
|
3796
|
+
z21.object({
|
|
3797
|
+
type: z21.literal("container_file_citation"),
|
|
3798
|
+
container_id: z21.string(),
|
|
3799
|
+
file_id: z21.string(),
|
|
3800
|
+
filename: z21.string(),
|
|
3801
|
+
start_index: z21.number(),
|
|
3802
|
+
end_index: z21.number()
|
|
3646
3803
|
}),
|
|
3647
|
-
|
|
3648
|
-
type:
|
|
3649
|
-
file_id:
|
|
3650
|
-
index:
|
|
3804
|
+
z21.object({
|
|
3805
|
+
type: z21.literal("file_path"),
|
|
3806
|
+
file_id: z21.string(),
|
|
3807
|
+
index: z21.number()
|
|
3651
3808
|
})
|
|
3652
3809
|
])
|
|
3653
3810
|
}),
|
|
3654
|
-
|
|
3655
|
-
type:
|
|
3656
|
-
item_id:
|
|
3657
|
-
summary_index:
|
|
3811
|
+
z21.object({
|
|
3812
|
+
type: z21.literal("response.reasoning_summary_part.added"),
|
|
3813
|
+
item_id: z21.string(),
|
|
3814
|
+
summary_index: z21.number()
|
|
3658
3815
|
}),
|
|
3659
|
-
|
|
3660
|
-
type:
|
|
3661
|
-
item_id:
|
|
3662
|
-
summary_index:
|
|
3663
|
-
delta:
|
|
3816
|
+
z21.object({
|
|
3817
|
+
type: z21.literal("response.reasoning_summary_text.delta"),
|
|
3818
|
+
item_id: z21.string(),
|
|
3819
|
+
summary_index: z21.number(),
|
|
3820
|
+
delta: z21.string()
|
|
3664
3821
|
}),
|
|
3665
|
-
|
|
3666
|
-
type:
|
|
3667
|
-
item_id:
|
|
3668
|
-
summary_index:
|
|
3822
|
+
z21.object({
|
|
3823
|
+
type: z21.literal("response.reasoning_summary_part.done"),
|
|
3824
|
+
item_id: z21.string(),
|
|
3825
|
+
summary_index: z21.number()
|
|
3669
3826
|
}),
|
|
3670
|
-
|
|
3671
|
-
type:
|
|
3672
|
-
item_id:
|
|
3673
|
-
output_index:
|
|
3674
|
-
delta:
|
|
3675
|
-
obfuscation:
|
|
3827
|
+
z21.object({
|
|
3828
|
+
type: z21.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3829
|
+
item_id: z21.string(),
|
|
3830
|
+
output_index: z21.number(),
|
|
3831
|
+
delta: z21.string(),
|
|
3832
|
+
obfuscation: z21.string().nullish()
|
|
3676
3833
|
}),
|
|
3677
|
-
|
|
3678
|
-
type:
|
|
3679
|
-
item_id:
|
|
3680
|
-
output_index:
|
|
3681
|
-
diff:
|
|
3834
|
+
z21.object({
|
|
3835
|
+
type: z21.literal("response.apply_patch_call_operation_diff.done"),
|
|
3836
|
+
item_id: z21.string(),
|
|
3837
|
+
output_index: z21.number(),
|
|
3838
|
+
diff: z21.string()
|
|
3682
3839
|
}),
|
|
3683
|
-
|
|
3684
|
-
type:
|
|
3685
|
-
sequence_number:
|
|
3686
|
-
error:
|
|
3687
|
-
type:
|
|
3688
|
-
code:
|
|
3689
|
-
message:
|
|
3690
|
-
param:
|
|
3840
|
+
z21.object({
|
|
3841
|
+
type: z21.literal("error"),
|
|
3842
|
+
sequence_number: z21.number(),
|
|
3843
|
+
error: z21.object({
|
|
3844
|
+
type: z21.string(),
|
|
3845
|
+
code: z21.string(),
|
|
3846
|
+
message: z21.string(),
|
|
3847
|
+
param: z21.string().nullish()
|
|
3691
3848
|
})
|
|
3692
3849
|
}),
|
|
3693
|
-
|
|
3850
|
+
z21.object({ type: z21.string() }).loose().transform((value) => ({
|
|
3694
3851
|
type: "unknown_chunk",
|
|
3695
3852
|
message: value.type
|
|
3696
3853
|
}))
|
|
@@ -3698,294 +3855,310 @@ var openaiResponsesChunkSchema = lazySchema18(
|
|
|
3698
3855
|
])
|
|
3699
3856
|
)
|
|
3700
3857
|
);
|
|
3701
|
-
var openaiResponsesResponseSchema =
|
|
3702
|
-
() =>
|
|
3703
|
-
|
|
3704
|
-
id:
|
|
3705
|
-
created_at:
|
|
3706
|
-
error:
|
|
3707
|
-
message:
|
|
3708
|
-
type:
|
|
3709
|
-
param:
|
|
3710
|
-
code:
|
|
3858
|
+
var openaiResponsesResponseSchema = lazySchema19(
|
|
3859
|
+
() => zodSchema19(
|
|
3860
|
+
z21.object({
|
|
3861
|
+
id: z21.string().optional(),
|
|
3862
|
+
created_at: z21.number().optional(),
|
|
3863
|
+
error: z21.object({
|
|
3864
|
+
message: z21.string(),
|
|
3865
|
+
type: z21.string(),
|
|
3866
|
+
param: z21.string().nullish(),
|
|
3867
|
+
code: z21.string()
|
|
3711
3868
|
}).nullish(),
|
|
3712
|
-
model:
|
|
3713
|
-
output:
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
type:
|
|
3717
|
-
role:
|
|
3718
|
-
id:
|
|
3719
|
-
phase:
|
|
3720
|
-
content:
|
|
3721
|
-
|
|
3722
|
-
type:
|
|
3723
|
-
text:
|
|
3724
|
-
logprobs:
|
|
3725
|
-
|
|
3726
|
-
token:
|
|
3727
|
-
logprob:
|
|
3728
|
-
top_logprobs:
|
|
3729
|
-
|
|
3730
|
-
token:
|
|
3731
|
-
logprob:
|
|
3869
|
+
model: z21.string().optional(),
|
|
3870
|
+
output: z21.array(
|
|
3871
|
+
z21.discriminatedUnion("type", [
|
|
3872
|
+
z21.object({
|
|
3873
|
+
type: z21.literal("message"),
|
|
3874
|
+
role: z21.literal("assistant"),
|
|
3875
|
+
id: z21.string(),
|
|
3876
|
+
phase: z21.enum(["commentary", "final_answer"]).nullish(),
|
|
3877
|
+
content: z21.array(
|
|
3878
|
+
z21.object({
|
|
3879
|
+
type: z21.literal("output_text"),
|
|
3880
|
+
text: z21.string(),
|
|
3881
|
+
logprobs: z21.array(
|
|
3882
|
+
z21.object({
|
|
3883
|
+
token: z21.string(),
|
|
3884
|
+
logprob: z21.number(),
|
|
3885
|
+
top_logprobs: z21.array(
|
|
3886
|
+
z21.object({
|
|
3887
|
+
token: z21.string(),
|
|
3888
|
+
logprob: z21.number()
|
|
3732
3889
|
})
|
|
3733
3890
|
)
|
|
3734
3891
|
})
|
|
3735
3892
|
).nullish(),
|
|
3736
|
-
annotations:
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
type:
|
|
3740
|
-
start_index:
|
|
3741
|
-
end_index:
|
|
3742
|
-
url:
|
|
3743
|
-
title:
|
|
3893
|
+
annotations: z21.array(
|
|
3894
|
+
z21.discriminatedUnion("type", [
|
|
3895
|
+
z21.object({
|
|
3896
|
+
type: z21.literal("url_citation"),
|
|
3897
|
+
start_index: z21.number(),
|
|
3898
|
+
end_index: z21.number(),
|
|
3899
|
+
url: z21.string(),
|
|
3900
|
+
title: z21.string()
|
|
3744
3901
|
}),
|
|
3745
|
-
|
|
3746
|
-
type:
|
|
3747
|
-
file_id:
|
|
3748
|
-
filename:
|
|
3749
|
-
index:
|
|
3902
|
+
z21.object({
|
|
3903
|
+
type: z21.literal("file_citation"),
|
|
3904
|
+
file_id: z21.string(),
|
|
3905
|
+
filename: z21.string(),
|
|
3906
|
+
index: z21.number()
|
|
3750
3907
|
}),
|
|
3751
|
-
|
|
3752
|
-
type:
|
|
3753
|
-
container_id:
|
|
3754
|
-
file_id:
|
|
3755
|
-
filename:
|
|
3756
|
-
start_index:
|
|
3757
|
-
end_index:
|
|
3908
|
+
z21.object({
|
|
3909
|
+
type: z21.literal("container_file_citation"),
|
|
3910
|
+
container_id: z21.string(),
|
|
3911
|
+
file_id: z21.string(),
|
|
3912
|
+
filename: z21.string(),
|
|
3913
|
+
start_index: z21.number(),
|
|
3914
|
+
end_index: z21.number()
|
|
3758
3915
|
}),
|
|
3759
|
-
|
|
3760
|
-
type:
|
|
3761
|
-
file_id:
|
|
3762
|
-
index:
|
|
3916
|
+
z21.object({
|
|
3917
|
+
type: z21.literal("file_path"),
|
|
3918
|
+
file_id: z21.string(),
|
|
3919
|
+
index: z21.number()
|
|
3763
3920
|
})
|
|
3764
3921
|
])
|
|
3765
3922
|
)
|
|
3766
3923
|
})
|
|
3767
3924
|
)
|
|
3768
3925
|
}),
|
|
3769
|
-
|
|
3770
|
-
type:
|
|
3771
|
-
id:
|
|
3772
|
-
status:
|
|
3773
|
-
action:
|
|
3774
|
-
|
|
3775
|
-
type:
|
|
3776
|
-
query:
|
|
3777
|
-
sources:
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
type:
|
|
3782
|
-
name:
|
|
3926
|
+
z21.object({
|
|
3927
|
+
type: z21.literal("web_search_call"),
|
|
3928
|
+
id: z21.string(),
|
|
3929
|
+
status: z21.string(),
|
|
3930
|
+
action: z21.discriminatedUnion("type", [
|
|
3931
|
+
z21.object({
|
|
3932
|
+
type: z21.literal("search"),
|
|
3933
|
+
query: z21.string().nullish(),
|
|
3934
|
+
sources: z21.array(
|
|
3935
|
+
z21.discriminatedUnion("type", [
|
|
3936
|
+
z21.object({ type: z21.literal("url"), url: z21.string() }),
|
|
3937
|
+
z21.object({
|
|
3938
|
+
type: z21.literal("api"),
|
|
3939
|
+
name: z21.string()
|
|
3783
3940
|
})
|
|
3784
3941
|
])
|
|
3785
3942
|
).nullish()
|
|
3786
3943
|
}),
|
|
3787
|
-
|
|
3788
|
-
type:
|
|
3789
|
-
url:
|
|
3944
|
+
z21.object({
|
|
3945
|
+
type: z21.literal("open_page"),
|
|
3946
|
+
url: z21.string().nullish()
|
|
3790
3947
|
}),
|
|
3791
|
-
|
|
3792
|
-
type:
|
|
3793
|
-
url:
|
|
3794
|
-
pattern:
|
|
3948
|
+
z21.object({
|
|
3949
|
+
type: z21.literal("find_in_page"),
|
|
3950
|
+
url: z21.string().nullish(),
|
|
3951
|
+
pattern: z21.string().nullish()
|
|
3795
3952
|
})
|
|
3796
3953
|
]).nullish()
|
|
3797
3954
|
}),
|
|
3798
|
-
|
|
3799
|
-
type:
|
|
3800
|
-
id:
|
|
3801
|
-
queries:
|
|
3802
|
-
results:
|
|
3803
|
-
|
|
3804
|
-
attributes:
|
|
3805
|
-
|
|
3806
|
-
|
|
3955
|
+
z21.object({
|
|
3956
|
+
type: z21.literal("file_search_call"),
|
|
3957
|
+
id: z21.string(),
|
|
3958
|
+
queries: z21.array(z21.string()),
|
|
3959
|
+
results: z21.array(
|
|
3960
|
+
z21.object({
|
|
3961
|
+
attributes: z21.record(
|
|
3962
|
+
z21.string(),
|
|
3963
|
+
z21.union([z21.string(), z21.number(), z21.boolean()])
|
|
3807
3964
|
),
|
|
3808
|
-
file_id:
|
|
3809
|
-
filename:
|
|
3810
|
-
score:
|
|
3811
|
-
text:
|
|
3965
|
+
file_id: z21.string(),
|
|
3966
|
+
filename: z21.string(),
|
|
3967
|
+
score: z21.number(),
|
|
3968
|
+
text: z21.string()
|
|
3812
3969
|
})
|
|
3813
3970
|
).nullish()
|
|
3814
3971
|
}),
|
|
3815
|
-
|
|
3816
|
-
type:
|
|
3817
|
-
id:
|
|
3818
|
-
code:
|
|
3819
|
-
container_id:
|
|
3820
|
-
outputs:
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3972
|
+
z21.object({
|
|
3973
|
+
type: z21.literal("code_interpreter_call"),
|
|
3974
|
+
id: z21.string(),
|
|
3975
|
+
code: z21.string().nullable(),
|
|
3976
|
+
container_id: z21.string(),
|
|
3977
|
+
outputs: z21.array(
|
|
3978
|
+
z21.discriminatedUnion("type", [
|
|
3979
|
+
z21.object({ type: z21.literal("logs"), logs: z21.string() }),
|
|
3980
|
+
z21.object({ type: z21.literal("image"), url: z21.string() })
|
|
3824
3981
|
])
|
|
3825
3982
|
).nullable()
|
|
3826
3983
|
}),
|
|
3827
|
-
|
|
3828
|
-
type:
|
|
3829
|
-
id:
|
|
3830
|
-
result:
|
|
3984
|
+
z21.object({
|
|
3985
|
+
type: z21.literal("image_generation_call"),
|
|
3986
|
+
id: z21.string(),
|
|
3987
|
+
result: z21.string()
|
|
3831
3988
|
}),
|
|
3832
|
-
|
|
3833
|
-
type:
|
|
3834
|
-
id:
|
|
3835
|
-
call_id:
|
|
3836
|
-
action:
|
|
3837
|
-
type:
|
|
3838
|
-
command:
|
|
3839
|
-
timeout_ms:
|
|
3840
|
-
user:
|
|
3841
|
-
working_directory:
|
|
3842
|
-
env:
|
|
3989
|
+
z21.object({
|
|
3990
|
+
type: z21.literal("local_shell_call"),
|
|
3991
|
+
id: z21.string(),
|
|
3992
|
+
call_id: z21.string(),
|
|
3993
|
+
action: z21.object({
|
|
3994
|
+
type: z21.literal("exec"),
|
|
3995
|
+
command: z21.array(z21.string()),
|
|
3996
|
+
timeout_ms: z21.number().optional(),
|
|
3997
|
+
user: z21.string().optional(),
|
|
3998
|
+
working_directory: z21.string().optional(),
|
|
3999
|
+
env: z21.record(z21.string(), z21.string()).optional()
|
|
3843
4000
|
})
|
|
3844
4001
|
}),
|
|
3845
|
-
|
|
3846
|
-
type:
|
|
3847
|
-
call_id:
|
|
3848
|
-
name:
|
|
3849
|
-
arguments:
|
|
3850
|
-
id:
|
|
4002
|
+
z21.object({
|
|
4003
|
+
type: z21.literal("function_call"),
|
|
4004
|
+
call_id: z21.string(),
|
|
4005
|
+
name: z21.string(),
|
|
4006
|
+
arguments: z21.string(),
|
|
4007
|
+
id: z21.string()
|
|
3851
4008
|
}),
|
|
3852
|
-
|
|
3853
|
-
type:
|
|
3854
|
-
call_id:
|
|
3855
|
-
name:
|
|
3856
|
-
input:
|
|
3857
|
-
id:
|
|
4009
|
+
z21.object({
|
|
4010
|
+
type: z21.literal("custom_tool_call"),
|
|
4011
|
+
call_id: z21.string(),
|
|
4012
|
+
name: z21.string(),
|
|
4013
|
+
input: z21.string(),
|
|
4014
|
+
id: z21.string()
|
|
3858
4015
|
}),
|
|
3859
|
-
|
|
3860
|
-
type:
|
|
3861
|
-
id:
|
|
3862
|
-
status:
|
|
4016
|
+
z21.object({
|
|
4017
|
+
type: z21.literal("computer_call"),
|
|
4018
|
+
id: z21.string(),
|
|
4019
|
+
status: z21.string().optional()
|
|
3863
4020
|
}),
|
|
3864
|
-
|
|
3865
|
-
type:
|
|
3866
|
-
id:
|
|
3867
|
-
encrypted_content:
|
|
3868
|
-
summary:
|
|
3869
|
-
|
|
3870
|
-
type:
|
|
3871
|
-
text:
|
|
4021
|
+
z21.object({
|
|
4022
|
+
type: z21.literal("reasoning"),
|
|
4023
|
+
id: z21.string(),
|
|
4024
|
+
encrypted_content: z21.string().nullish(),
|
|
4025
|
+
summary: z21.array(
|
|
4026
|
+
z21.object({
|
|
4027
|
+
type: z21.literal("summary_text"),
|
|
4028
|
+
text: z21.string()
|
|
3872
4029
|
})
|
|
3873
4030
|
)
|
|
3874
4031
|
}),
|
|
3875
|
-
|
|
3876
|
-
type:
|
|
3877
|
-
id:
|
|
3878
|
-
status:
|
|
3879
|
-
arguments:
|
|
3880
|
-
name:
|
|
3881
|
-
server_label:
|
|
3882
|
-
output:
|
|
3883
|
-
error:
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
type:
|
|
3887
|
-
code:
|
|
3888
|
-
message:
|
|
4032
|
+
z21.object({
|
|
4033
|
+
type: z21.literal("mcp_call"),
|
|
4034
|
+
id: z21.string(),
|
|
4035
|
+
status: z21.string(),
|
|
4036
|
+
arguments: z21.string(),
|
|
4037
|
+
name: z21.string(),
|
|
4038
|
+
server_label: z21.string(),
|
|
4039
|
+
output: z21.string().nullish(),
|
|
4040
|
+
error: z21.union([
|
|
4041
|
+
z21.string(),
|
|
4042
|
+
z21.object({
|
|
4043
|
+
type: z21.string().optional(),
|
|
4044
|
+
code: z21.union([z21.number(), z21.string()]).optional(),
|
|
4045
|
+
message: z21.string().optional()
|
|
3889
4046
|
}).loose()
|
|
3890
4047
|
]).nullish(),
|
|
3891
|
-
approval_request_id:
|
|
4048
|
+
approval_request_id: z21.string().nullish()
|
|
3892
4049
|
}),
|
|
3893
|
-
|
|
3894
|
-
type:
|
|
3895
|
-
id:
|
|
3896
|
-
server_label:
|
|
3897
|
-
tools:
|
|
3898
|
-
|
|
3899
|
-
name:
|
|
3900
|
-
description:
|
|
3901
|
-
input_schema:
|
|
3902
|
-
annotations:
|
|
4050
|
+
z21.object({
|
|
4051
|
+
type: z21.literal("mcp_list_tools"),
|
|
4052
|
+
id: z21.string(),
|
|
4053
|
+
server_label: z21.string(),
|
|
4054
|
+
tools: z21.array(
|
|
4055
|
+
z21.object({
|
|
4056
|
+
name: z21.string(),
|
|
4057
|
+
description: z21.string().optional(),
|
|
4058
|
+
input_schema: z21.any(),
|
|
4059
|
+
annotations: z21.record(z21.string(), z21.unknown()).optional()
|
|
3903
4060
|
})
|
|
3904
4061
|
),
|
|
3905
|
-
error:
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
type:
|
|
3909
|
-
code:
|
|
3910
|
-
message:
|
|
4062
|
+
error: z21.union([
|
|
4063
|
+
z21.string(),
|
|
4064
|
+
z21.object({
|
|
4065
|
+
type: z21.string().optional(),
|
|
4066
|
+
code: z21.union([z21.number(), z21.string()]).optional(),
|
|
4067
|
+
message: z21.string().optional()
|
|
3911
4068
|
}).loose()
|
|
3912
4069
|
]).optional()
|
|
3913
4070
|
}),
|
|
3914
|
-
|
|
3915
|
-
type:
|
|
3916
|
-
id:
|
|
3917
|
-
server_label:
|
|
3918
|
-
name:
|
|
3919
|
-
arguments:
|
|
3920
|
-
approval_request_id:
|
|
4071
|
+
z21.object({
|
|
4072
|
+
type: z21.literal("mcp_approval_request"),
|
|
4073
|
+
id: z21.string(),
|
|
4074
|
+
server_label: z21.string(),
|
|
4075
|
+
name: z21.string(),
|
|
4076
|
+
arguments: z21.string(),
|
|
4077
|
+
approval_request_id: z21.string().optional()
|
|
3921
4078
|
}),
|
|
3922
|
-
|
|
3923
|
-
type:
|
|
3924
|
-
id:
|
|
3925
|
-
call_id:
|
|
3926
|
-
status:
|
|
3927
|
-
operation:
|
|
3928
|
-
|
|
3929
|
-
type:
|
|
3930
|
-
path:
|
|
3931
|
-
diff:
|
|
4079
|
+
z21.object({
|
|
4080
|
+
type: z21.literal("apply_patch_call"),
|
|
4081
|
+
id: z21.string(),
|
|
4082
|
+
call_id: z21.string(),
|
|
4083
|
+
status: z21.enum(["in_progress", "completed"]),
|
|
4084
|
+
operation: z21.discriminatedUnion("type", [
|
|
4085
|
+
z21.object({
|
|
4086
|
+
type: z21.literal("create_file"),
|
|
4087
|
+
path: z21.string(),
|
|
4088
|
+
diff: z21.string()
|
|
3932
4089
|
}),
|
|
3933
|
-
|
|
3934
|
-
type:
|
|
3935
|
-
path:
|
|
4090
|
+
z21.object({
|
|
4091
|
+
type: z21.literal("delete_file"),
|
|
4092
|
+
path: z21.string()
|
|
3936
4093
|
}),
|
|
3937
|
-
|
|
3938
|
-
type:
|
|
3939
|
-
path:
|
|
3940
|
-
diff:
|
|
4094
|
+
z21.object({
|
|
4095
|
+
type: z21.literal("update_file"),
|
|
4096
|
+
path: z21.string(),
|
|
4097
|
+
diff: z21.string()
|
|
3941
4098
|
})
|
|
3942
4099
|
])
|
|
3943
4100
|
}),
|
|
3944
|
-
|
|
3945
|
-
type:
|
|
3946
|
-
id:
|
|
3947
|
-
call_id:
|
|
3948
|
-
status:
|
|
3949
|
-
action:
|
|
3950
|
-
commands:
|
|
4101
|
+
z21.object({
|
|
4102
|
+
type: z21.literal("shell_call"),
|
|
4103
|
+
id: z21.string(),
|
|
4104
|
+
call_id: z21.string(),
|
|
4105
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
4106
|
+
action: z21.object({
|
|
4107
|
+
commands: z21.array(z21.string())
|
|
3951
4108
|
})
|
|
3952
4109
|
}),
|
|
3953
|
-
|
|
3954
|
-
type:
|
|
3955
|
-
id:
|
|
3956
|
-
call_id:
|
|
3957
|
-
status:
|
|
3958
|
-
output:
|
|
3959
|
-
|
|
3960
|
-
stdout:
|
|
3961
|
-
stderr:
|
|
3962
|
-
outcome:
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
type:
|
|
3966
|
-
exit_code:
|
|
4110
|
+
z21.object({
|
|
4111
|
+
type: z21.literal("shell_call_output"),
|
|
4112
|
+
id: z21.string(),
|
|
4113
|
+
call_id: z21.string(),
|
|
4114
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
4115
|
+
output: z21.array(
|
|
4116
|
+
z21.object({
|
|
4117
|
+
stdout: z21.string(),
|
|
4118
|
+
stderr: z21.string(),
|
|
4119
|
+
outcome: z21.discriminatedUnion("type", [
|
|
4120
|
+
z21.object({ type: z21.literal("timeout") }),
|
|
4121
|
+
z21.object({
|
|
4122
|
+
type: z21.literal("exit"),
|
|
4123
|
+
exit_code: z21.number()
|
|
3967
4124
|
})
|
|
3968
4125
|
])
|
|
3969
4126
|
})
|
|
3970
4127
|
)
|
|
4128
|
+
}),
|
|
4129
|
+
z21.object({
|
|
4130
|
+
type: z21.literal("tool_search_call"),
|
|
4131
|
+
id: z21.string(),
|
|
4132
|
+
execution: z21.enum(["server", "client"]),
|
|
4133
|
+
call_id: z21.string().nullable(),
|
|
4134
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
4135
|
+
arguments: z21.unknown()
|
|
4136
|
+
}),
|
|
4137
|
+
z21.object({
|
|
4138
|
+
type: z21.literal("tool_search_output"),
|
|
4139
|
+
id: z21.string(),
|
|
4140
|
+
execution: z21.enum(["server", "client"]),
|
|
4141
|
+
call_id: z21.string().nullable(),
|
|
4142
|
+
status: z21.enum(["in_progress", "completed", "incomplete"]),
|
|
4143
|
+
tools: z21.array(z21.record(z21.string(), jsonValueSchema2.optional()))
|
|
3971
4144
|
})
|
|
3972
4145
|
])
|
|
3973
4146
|
).optional(),
|
|
3974
|
-
service_tier:
|
|
3975
|
-
incomplete_details:
|
|
3976
|
-
usage:
|
|
3977
|
-
input_tokens:
|
|
3978
|
-
input_tokens_details:
|
|
3979
|
-
output_tokens:
|
|
3980
|
-
output_tokens_details:
|
|
4147
|
+
service_tier: z21.string().nullish(),
|
|
4148
|
+
incomplete_details: z21.object({ reason: z21.string() }).nullish(),
|
|
4149
|
+
usage: z21.object({
|
|
4150
|
+
input_tokens: z21.number(),
|
|
4151
|
+
input_tokens_details: z21.object({ cached_tokens: z21.number().nullish() }).nullish(),
|
|
4152
|
+
output_tokens: z21.number(),
|
|
4153
|
+
output_tokens_details: z21.object({ reasoning_tokens: z21.number().nullish() }).nullish()
|
|
3981
4154
|
}).optional()
|
|
3982
4155
|
})
|
|
3983
4156
|
)
|
|
3984
4157
|
);
|
|
3985
4158
|
|
|
3986
4159
|
// src/responses/openai-responses-options.ts
|
|
3987
|
-
import { lazySchema as
|
|
3988
|
-
import { z as
|
|
4160
|
+
import { lazySchema as lazySchema20, zodSchema as zodSchema20 } from "@ai-sdk/provider-utils";
|
|
4161
|
+
import { z as z22 } from "zod/v4";
|
|
3989
4162
|
var TOP_LOGPROBS_MAX = 20;
|
|
3990
4163
|
var openaiResponsesReasoningModelIds = [
|
|
3991
4164
|
"o1",
|
|
@@ -4014,11 +4187,12 @@ var openaiResponsesReasoningModelIds = [
|
|
|
4014
4187
|
"gpt-5.2-chat-latest",
|
|
4015
4188
|
"gpt-5.2-pro",
|
|
4016
4189
|
"gpt-5.2-codex",
|
|
4190
|
+
"gpt-5.3-chat-latest",
|
|
4191
|
+
"gpt-5.3-codex",
|
|
4017
4192
|
"gpt-5.4",
|
|
4018
4193
|
"gpt-5.4-2026-03-05",
|
|
4019
4194
|
"gpt-5.4-pro",
|
|
4020
|
-
"gpt-5.4-pro-2026-03-05"
|
|
4021
|
-
"gpt-5.3-codex"
|
|
4195
|
+
"gpt-5.4-pro-2026-03-05"
|
|
4022
4196
|
];
|
|
4023
4197
|
var openaiResponsesModelIds = [
|
|
4024
4198
|
"gpt-4.1",
|
|
@@ -4045,9 +4219,9 @@ var openaiResponsesModelIds = [
|
|
|
4045
4219
|
"gpt-5-chat-latest",
|
|
4046
4220
|
...openaiResponsesReasoningModelIds
|
|
4047
4221
|
];
|
|
4048
|
-
var openaiLanguageModelResponsesOptionsSchema =
|
|
4049
|
-
() =>
|
|
4050
|
-
|
|
4222
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
|
|
4223
|
+
() => zodSchema20(
|
|
4224
|
+
z22.object({
|
|
4051
4225
|
/**
|
|
4052
4226
|
* The ID of the OpenAI Conversation to continue.
|
|
4053
4227
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -4055,13 +4229,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema19(
|
|
|
4055
4229
|
* Defaults to `undefined`.
|
|
4056
4230
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
4057
4231
|
*/
|
|
4058
|
-
conversation:
|
|
4232
|
+
conversation: z22.string().nullish(),
|
|
4059
4233
|
/**
|
|
4060
4234
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
4061
4235
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
4062
4236
|
*/
|
|
4063
|
-
include:
|
|
4064
|
-
|
|
4237
|
+
include: z22.array(
|
|
4238
|
+
z22.enum([
|
|
4065
4239
|
"reasoning.encrypted_content",
|
|
4066
4240
|
// handled internally by default, only needed for unknown reasoning models
|
|
4067
4241
|
"file_search_call.results",
|
|
@@ -4073,7 +4247,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema19(
|
|
|
4073
4247
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
4074
4248
|
* Defaults to `undefined`.
|
|
4075
4249
|
*/
|
|
4076
|
-
instructions:
|
|
4250
|
+
instructions: z22.string().nullish(),
|
|
4077
4251
|
/**
|
|
4078
4252
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
4079
4253
|
* the response size and can slow down response times. However, it can
|
|
@@ -4088,30 +4262,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema19(
|
|
|
4088
4262
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
4089
4263
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
4090
4264
|
*/
|
|
4091
|
-
logprobs:
|
|
4265
|
+
logprobs: z22.union([z22.boolean(), z22.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
4092
4266
|
/**
|
|
4093
4267
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
4094
4268
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
4095
4269
|
* Any further attempts to call a tool by the model will be ignored.
|
|
4096
4270
|
*/
|
|
4097
|
-
maxToolCalls:
|
|
4271
|
+
maxToolCalls: z22.number().nullish(),
|
|
4098
4272
|
/**
|
|
4099
4273
|
* Additional metadata to store with the generation.
|
|
4100
4274
|
*/
|
|
4101
|
-
metadata:
|
|
4275
|
+
metadata: z22.any().nullish(),
|
|
4102
4276
|
/**
|
|
4103
4277
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4104
4278
|
*/
|
|
4105
|
-
parallelToolCalls:
|
|
4279
|
+
parallelToolCalls: z22.boolean().nullish(),
|
|
4106
4280
|
/**
|
|
4107
4281
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4108
4282
|
* Defaults to `undefined`.
|
|
4109
4283
|
*/
|
|
4110
|
-
previousResponseId:
|
|
4284
|
+
previousResponseId: z22.string().nullish(),
|
|
4111
4285
|
/**
|
|
4112
4286
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4113
4287
|
*/
|
|
4114
|
-
promptCacheKey:
|
|
4288
|
+
promptCacheKey: z22.string().nullish(),
|
|
4115
4289
|
/**
|
|
4116
4290
|
* The retention policy for the prompt cache.
|
|
4117
4291
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4120,7 +4294,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema19(
|
|
|
4120
4294
|
*
|
|
4121
4295
|
* @default 'in_memory'
|
|
4122
4296
|
*/
|
|
4123
|
-
promptCacheRetention:
|
|
4297
|
+
promptCacheRetention: z22.enum(["in_memory", "24h"]).nullish(),
|
|
4124
4298
|
/**
|
|
4125
4299
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4126
4300
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4131,17 +4305,17 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema19(
|
|
|
4131
4305
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4132
4306
|
* an error.
|
|
4133
4307
|
*/
|
|
4134
|
-
reasoningEffort:
|
|
4308
|
+
reasoningEffort: z22.string().nullish(),
|
|
4135
4309
|
/**
|
|
4136
4310
|
* Controls reasoning summary output from the model.
|
|
4137
4311
|
* Set to "auto" to automatically receive the richest level available,
|
|
4138
4312
|
* or "detailed" for comprehensive summaries.
|
|
4139
4313
|
*/
|
|
4140
|
-
reasoningSummary:
|
|
4314
|
+
reasoningSummary: z22.string().nullish(),
|
|
4141
4315
|
/**
|
|
4142
4316
|
* The identifier for safety monitoring and tracking.
|
|
4143
4317
|
*/
|
|
4144
|
-
safetyIdentifier:
|
|
4318
|
+
safetyIdentifier: z22.string().nullish(),
|
|
4145
4319
|
/**
|
|
4146
4320
|
* Service tier for the request.
|
|
4147
4321
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4149,34 +4323,34 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema19(
|
|
|
4149
4323
|
*
|
|
4150
4324
|
* Defaults to 'auto'.
|
|
4151
4325
|
*/
|
|
4152
|
-
serviceTier:
|
|
4326
|
+
serviceTier: z22.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4153
4327
|
/**
|
|
4154
4328
|
* Whether to store the generation. Defaults to `true`.
|
|
4155
4329
|
*/
|
|
4156
|
-
store:
|
|
4330
|
+
store: z22.boolean().nullish(),
|
|
4157
4331
|
/**
|
|
4158
4332
|
* Whether to use strict JSON schema validation.
|
|
4159
4333
|
* Defaults to `true`.
|
|
4160
4334
|
*/
|
|
4161
|
-
strictJsonSchema:
|
|
4335
|
+
strictJsonSchema: z22.boolean().nullish(),
|
|
4162
4336
|
/**
|
|
4163
4337
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4164
4338
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4165
4339
|
* Valid values: 'low', 'medium', 'high'.
|
|
4166
4340
|
*/
|
|
4167
|
-
textVerbosity:
|
|
4341
|
+
textVerbosity: z22.enum(["low", "medium", "high"]).nullish(),
|
|
4168
4342
|
/**
|
|
4169
4343
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4170
4344
|
* 'disabled' turns truncation off.
|
|
4171
4345
|
*/
|
|
4172
|
-
truncation:
|
|
4346
|
+
truncation: z22.enum(["auto", "disabled"]).nullish(),
|
|
4173
4347
|
/**
|
|
4174
4348
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4175
4349
|
* monitor and detect abuse.
|
|
4176
4350
|
* Defaults to `undefined`.
|
|
4177
4351
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4178
4352
|
*/
|
|
4179
|
-
user:
|
|
4353
|
+
user: z22.string().nullish(),
|
|
4180
4354
|
/**
|
|
4181
4355
|
* Override the system message mode for this model.
|
|
4182
4356
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4185,7 +4359,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema19(
|
|
|
4185
4359
|
*
|
|
4186
4360
|
* If not specified, the mode is automatically determined based on the model.
|
|
4187
4361
|
*/
|
|
4188
|
-
systemMessageMode:
|
|
4362
|
+
systemMessageMode: z22.enum(["system", "developer", "remove"]).optional(),
|
|
4189
4363
|
/**
|
|
4190
4364
|
* Force treating this model as a reasoning model.
|
|
4191
4365
|
*
|
|
@@ -4195,7 +4369,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema19(
|
|
|
4195
4369
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4196
4370
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4197
4371
|
*/
|
|
4198
|
-
forceReasoning:
|
|
4372
|
+
forceReasoning: z22.boolean().optional()
|
|
4199
4373
|
})
|
|
4200
4374
|
)
|
|
4201
4375
|
);
|
|
@@ -4211,7 +4385,7 @@ async function prepareResponsesTools({
|
|
|
4211
4385
|
toolNameMapping,
|
|
4212
4386
|
customProviderToolNames
|
|
4213
4387
|
}) {
|
|
4214
|
-
var _a;
|
|
4388
|
+
var _a, _b;
|
|
4215
4389
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
4216
4390
|
const toolWarnings = [];
|
|
4217
4391
|
if (tools == null) {
|
|
@@ -4221,15 +4395,19 @@ async function prepareResponsesTools({
|
|
|
4221
4395
|
const resolvedCustomProviderToolNames = customProviderToolNames != null ? customProviderToolNames : /* @__PURE__ */ new Set();
|
|
4222
4396
|
for (const tool of tools) {
|
|
4223
4397
|
switch (tool.type) {
|
|
4224
|
-
case "function":
|
|
4398
|
+
case "function": {
|
|
4399
|
+
const openaiOptions = (_a = tool.providerOptions) == null ? void 0 : _a.openai;
|
|
4400
|
+
const deferLoading = openaiOptions == null ? void 0 : openaiOptions.deferLoading;
|
|
4225
4401
|
openaiTools2.push({
|
|
4226
4402
|
type: "function",
|
|
4227
4403
|
name: tool.name,
|
|
4228
4404
|
description: tool.description,
|
|
4229
4405
|
parameters: tool.inputSchema,
|
|
4230
|
-
...tool.strict != null ? { strict: tool.strict } : {}
|
|
4406
|
+
...tool.strict != null ? { strict: tool.strict } : {},
|
|
4407
|
+
...deferLoading != null ? { defer_loading: deferLoading } : {}
|
|
4231
4408
|
});
|
|
4232
4409
|
break;
|
|
4410
|
+
}
|
|
4233
4411
|
case "provider": {
|
|
4234
4412
|
switch (tool.id) {
|
|
4235
4413
|
case "openai.file_search": {
|
|
@@ -4367,11 +4545,24 @@ async function prepareResponsesTools({
|
|
|
4367
4545
|
});
|
|
4368
4546
|
openaiTools2.push({
|
|
4369
4547
|
type: "custom",
|
|
4370
|
-
name:
|
|
4548
|
+
name: tool.name,
|
|
4371
4549
|
description: args.description,
|
|
4372
4550
|
format: args.format
|
|
4373
4551
|
});
|
|
4374
|
-
resolvedCustomProviderToolNames.add(
|
|
4552
|
+
resolvedCustomProviderToolNames.add(tool.name);
|
|
4553
|
+
break;
|
|
4554
|
+
}
|
|
4555
|
+
case "openai.tool_search": {
|
|
4556
|
+
const args = await validateTypes2({
|
|
4557
|
+
value: tool.args,
|
|
4558
|
+
schema: toolSearchArgsSchema
|
|
4559
|
+
});
|
|
4560
|
+
openaiTools2.push({
|
|
4561
|
+
type: "tool_search",
|
|
4562
|
+
...args.execution != null ? { execution: args.execution } : {},
|
|
4563
|
+
...args.description != null ? { description: args.description } : {},
|
|
4564
|
+
...args.parameters != null ? { parameters: args.parameters } : {}
|
|
4565
|
+
});
|
|
4375
4566
|
break;
|
|
4376
4567
|
}
|
|
4377
4568
|
}
|
|
@@ -4395,7 +4586,7 @@ async function prepareResponsesTools({
|
|
|
4395
4586
|
case "required":
|
|
4396
4587
|
return { tools: openaiTools2, toolChoice: type, toolWarnings };
|
|
4397
4588
|
case "tool": {
|
|
4398
|
-
const resolvedToolName = (
|
|
4589
|
+
const resolvedToolName = (_b = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _b : toolChoice.toolName;
|
|
4399
4590
|
return {
|
|
4400
4591
|
tools: openaiTools2,
|
|
4401
4592
|
toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
|
|
@@ -4475,7 +4666,7 @@ function extractApprovalRequestIdToToolCallIdMapping(prompt) {
|
|
|
4475
4666
|
}
|
|
4476
4667
|
var OpenAIResponsesLanguageModel = class {
|
|
4477
4668
|
constructor(modelId, config) {
|
|
4478
|
-
this.specificationVersion = "
|
|
4669
|
+
this.specificationVersion = "v4";
|
|
4479
4670
|
this.supportedUrls = {
|
|
4480
4671
|
"image/*": [/^https?:\/\/.*$/],
|
|
4481
4672
|
"application/pdf": [/^https?:\/\/.*$/]
|
|
@@ -4551,9 +4742,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4551
4742
|
"openai.web_search": "web_search",
|
|
4552
4743
|
"openai.web_search_preview": "web_search_preview",
|
|
4553
4744
|
"openai.mcp": "mcp",
|
|
4554
|
-
"openai.apply_patch": "apply_patch"
|
|
4555
|
-
|
|
4556
|
-
|
|
4745
|
+
"openai.apply_patch": "apply_patch",
|
|
4746
|
+
"openai.tool_search": "tool_search"
|
|
4747
|
+
}
|
|
4557
4748
|
});
|
|
4558
4749
|
const customProviderToolNames = /* @__PURE__ */ new Set();
|
|
4559
4750
|
const {
|
|
@@ -4729,7 +4920,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4729
4920
|
};
|
|
4730
4921
|
}
|
|
4731
4922
|
async doGenerate(options) {
|
|
4732
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
4923
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
|
|
4733
4924
|
const {
|
|
4734
4925
|
args: body,
|
|
4735
4926
|
warnings,
|
|
@@ -4772,6 +4963,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4772
4963
|
const content = [];
|
|
4773
4964
|
const logprobs = [];
|
|
4774
4965
|
let hasFunctionCall = false;
|
|
4966
|
+
const hostedToolSearchCallIds = [];
|
|
4775
4967
|
for (const part of response.output) {
|
|
4776
4968
|
switch (part.type) {
|
|
4777
4969
|
case "reasoning": {
|
|
@@ -4810,6 +5002,46 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4810
5002
|
});
|
|
4811
5003
|
break;
|
|
4812
5004
|
}
|
|
5005
|
+
case "tool_search_call": {
|
|
5006
|
+
const toolCallId = (_b = part.call_id) != null ? _b : part.id;
|
|
5007
|
+
const isHosted = part.execution === "server";
|
|
5008
|
+
if (isHosted) {
|
|
5009
|
+
hostedToolSearchCallIds.push(toolCallId);
|
|
5010
|
+
}
|
|
5011
|
+
content.push({
|
|
5012
|
+
type: "tool-call",
|
|
5013
|
+
toolCallId,
|
|
5014
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
5015
|
+
input: JSON.stringify({
|
|
5016
|
+
arguments: part.arguments,
|
|
5017
|
+
call_id: part.call_id
|
|
5018
|
+
}),
|
|
5019
|
+
...isHosted ? { providerExecuted: true } : {},
|
|
5020
|
+
providerMetadata: {
|
|
5021
|
+
[providerOptionsName]: {
|
|
5022
|
+
itemId: part.id
|
|
5023
|
+
}
|
|
5024
|
+
}
|
|
5025
|
+
});
|
|
5026
|
+
break;
|
|
5027
|
+
}
|
|
5028
|
+
case "tool_search_output": {
|
|
5029
|
+
const toolCallId = (_d = (_c = part.call_id) != null ? _c : hostedToolSearchCallIds.shift()) != null ? _d : part.id;
|
|
5030
|
+
content.push({
|
|
5031
|
+
type: "tool-result",
|
|
5032
|
+
toolCallId,
|
|
5033
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
5034
|
+
result: {
|
|
5035
|
+
tools: part.tools
|
|
5036
|
+
},
|
|
5037
|
+
providerMetadata: {
|
|
5038
|
+
[providerOptionsName]: {
|
|
5039
|
+
itemId: part.id
|
|
5040
|
+
}
|
|
5041
|
+
}
|
|
5042
|
+
});
|
|
5043
|
+
break;
|
|
5044
|
+
}
|
|
4813
5045
|
case "local_shell_call": {
|
|
4814
5046
|
content.push({
|
|
4815
5047
|
type: "tool-call",
|
|
@@ -4865,7 +5097,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4865
5097
|
}
|
|
4866
5098
|
case "message": {
|
|
4867
5099
|
for (const contentPart of part.content) {
|
|
4868
|
-
if (((
|
|
5100
|
+
if (((_f = (_e = options.providerOptions) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.logprobs) && contentPart.logprobs) {
|
|
4869
5101
|
logprobs.push(contentPart.logprobs);
|
|
4870
5102
|
}
|
|
4871
5103
|
const providerMetadata2 = {
|
|
@@ -4887,7 +5119,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4887
5119
|
content.push({
|
|
4888
5120
|
type: "source",
|
|
4889
5121
|
sourceType: "url",
|
|
4890
|
-
id: (
|
|
5122
|
+
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : generateId2(),
|
|
4891
5123
|
url: annotation.url,
|
|
4892
5124
|
title: annotation.title
|
|
4893
5125
|
});
|
|
@@ -4895,7 +5127,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4895
5127
|
content.push({
|
|
4896
5128
|
type: "source",
|
|
4897
5129
|
sourceType: "document",
|
|
4898
|
-
id: (
|
|
5130
|
+
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : generateId2(),
|
|
4899
5131
|
mediaType: "text/plain",
|
|
4900
5132
|
title: annotation.filename,
|
|
4901
5133
|
filename: annotation.filename,
|
|
@@ -4911,7 +5143,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4911
5143
|
content.push({
|
|
4912
5144
|
type: "source",
|
|
4913
5145
|
sourceType: "document",
|
|
4914
|
-
id: (
|
|
5146
|
+
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2(),
|
|
4915
5147
|
mediaType: "text/plain",
|
|
4916
5148
|
title: annotation.filename,
|
|
4917
5149
|
filename: annotation.filename,
|
|
@@ -4927,7 +5159,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4927
5159
|
content.push({
|
|
4928
5160
|
type: "source",
|
|
4929
5161
|
sourceType: "document",
|
|
4930
|
-
id: (
|
|
5162
|
+
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : generateId2(),
|
|
4931
5163
|
mediaType: "application/octet-stream",
|
|
4932
5164
|
title: annotation.file_id,
|
|
4933
5165
|
filename: annotation.file_id,
|
|
@@ -4996,7 +5228,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4996
5228
|
break;
|
|
4997
5229
|
}
|
|
4998
5230
|
case "mcp_call": {
|
|
4999
|
-
const toolCallId = part.approval_request_id != null ? (
|
|
5231
|
+
const toolCallId = part.approval_request_id != null ? (_s = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _s : part.id : part.id;
|
|
5000
5232
|
const toolName = `mcp.${part.name}`;
|
|
5001
5233
|
content.push({
|
|
5002
5234
|
type: "tool-call",
|
|
@@ -5030,8 +5262,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5030
5262
|
break;
|
|
5031
5263
|
}
|
|
5032
5264
|
case "mcp_approval_request": {
|
|
5033
|
-
const approvalRequestId = (
|
|
5034
|
-
const dummyToolCallId = (
|
|
5265
|
+
const approvalRequestId = (_t = part.approval_request_id) != null ? _t : part.id;
|
|
5266
|
+
const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : generateId2();
|
|
5035
5267
|
const toolName = `mcp.${part.name}`;
|
|
5036
5268
|
content.push({
|
|
5037
5269
|
type: "tool-call",
|
|
@@ -5081,13 +5313,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5081
5313
|
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
5082
5314
|
result: {
|
|
5083
5315
|
queries: part.queries,
|
|
5084
|
-
results: (
|
|
5316
|
+
results: (_y = (_x = part.results) == null ? void 0 : _x.map((result) => ({
|
|
5085
5317
|
attributes: result.attributes,
|
|
5086
5318
|
fileId: result.file_id,
|
|
5087
5319
|
filename: result.filename,
|
|
5088
5320
|
score: result.score,
|
|
5089
5321
|
text: result.text
|
|
5090
|
-
}))) != null ?
|
|
5322
|
+
}))) != null ? _y : null
|
|
5091
5323
|
}
|
|
5092
5324
|
});
|
|
5093
5325
|
break;
|
|
@@ -5144,10 +5376,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5144
5376
|
content,
|
|
5145
5377
|
finishReason: {
|
|
5146
5378
|
unified: mapOpenAIResponseFinishReason({
|
|
5147
|
-
finishReason: (
|
|
5379
|
+
finishReason: (_z = response.incomplete_details) == null ? void 0 : _z.reason,
|
|
5148
5380
|
hasFunctionCall
|
|
5149
5381
|
}),
|
|
5150
|
-
raw: (
|
|
5382
|
+
raw: (_B = (_A = response.incomplete_details) == null ? void 0 : _A.reason) != null ? _B : void 0
|
|
5151
5383
|
},
|
|
5152
5384
|
usage: convertOpenAIResponsesUsage(usage),
|
|
5153
5385
|
request: { body },
|
|
@@ -5205,6 +5437,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5205
5437
|
let hasFunctionCall = false;
|
|
5206
5438
|
const activeReasoning = {};
|
|
5207
5439
|
let serviceTier;
|
|
5440
|
+
const hostedToolSearchCallIds = [];
|
|
5208
5441
|
return {
|
|
5209
5442
|
stream: response.pipeThrough(
|
|
5210
5443
|
new TransformStream({
|
|
@@ -5212,7 +5445,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5212
5445
|
controller.enqueue({ type: "stream-start", warnings });
|
|
5213
5446
|
},
|
|
5214
5447
|
transform(chunk, controller) {
|
|
5215
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
|
|
5448
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
|
|
5216
5449
|
if (options.includeRawChunks) {
|
|
5217
5450
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
5218
5451
|
}
|
|
@@ -5320,6 +5553,24 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5320
5553
|
input: "{}",
|
|
5321
5554
|
providerExecuted: true
|
|
5322
5555
|
});
|
|
5556
|
+
} else if (value.item.type === "tool_search_call") {
|
|
5557
|
+
const toolCallId = value.item.id;
|
|
5558
|
+
const toolName = toolNameMapping.toCustomToolName("tool_search");
|
|
5559
|
+
const isHosted = value.item.execution === "server";
|
|
5560
|
+
ongoingToolCalls[value.output_index] = {
|
|
5561
|
+
toolName,
|
|
5562
|
+
toolCallId,
|
|
5563
|
+
toolSearchExecution: (_a = value.item.execution) != null ? _a : "server"
|
|
5564
|
+
};
|
|
5565
|
+
if (isHosted) {
|
|
5566
|
+
controller.enqueue({
|
|
5567
|
+
type: "tool-input-start",
|
|
5568
|
+
id: toolCallId,
|
|
5569
|
+
toolName,
|
|
5570
|
+
providerExecuted: true
|
|
5571
|
+
});
|
|
5572
|
+
}
|
|
5573
|
+
} else if (value.item.type === "tool_search_output") {
|
|
5323
5574
|
} else if (value.item.type === "mcp_call" || value.item.type === "mcp_list_tools" || value.item.type === "mcp_approval_request") {
|
|
5324
5575
|
} else if (value.item.type === "apply_patch_call") {
|
|
5325
5576
|
const { call_id: callId, operation } = value.item;
|
|
@@ -5366,7 +5617,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5366
5617
|
} else if (value.item.type === "shell_call_output") {
|
|
5367
5618
|
} else if (value.item.type === "message") {
|
|
5368
5619
|
ongoingAnnotations.splice(0, ongoingAnnotations.length);
|
|
5369
|
-
activeMessagePhase = (
|
|
5620
|
+
activeMessagePhase = (_b = value.item.phase) != null ? _b : void 0;
|
|
5370
5621
|
controller.enqueue({
|
|
5371
5622
|
type: "text-start",
|
|
5372
5623
|
id: value.item.id,
|
|
@@ -5390,14 +5641,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5390
5641
|
providerMetadata: {
|
|
5391
5642
|
[providerOptionsName]: {
|
|
5392
5643
|
itemId: value.item.id,
|
|
5393
|
-
reasoningEncryptedContent: (
|
|
5644
|
+
reasoningEncryptedContent: (_c = value.item.encrypted_content) != null ? _c : null
|
|
5394
5645
|
}
|
|
5395
5646
|
}
|
|
5396
5647
|
});
|
|
5397
5648
|
}
|
|
5398
5649
|
} else if (isResponseOutputItemDoneChunk(value)) {
|
|
5399
5650
|
if (value.item.type === "message") {
|
|
5400
|
-
const phase = (
|
|
5651
|
+
const phase = (_d = value.item.phase) != null ? _d : activeMessagePhase;
|
|
5401
5652
|
activeMessagePhase = void 0;
|
|
5402
5653
|
controller.enqueue({
|
|
5403
5654
|
type: "text-end",
|
|
@@ -5491,13 +5742,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5491
5742
|
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
5492
5743
|
result: {
|
|
5493
5744
|
queries: value.item.queries,
|
|
5494
|
-
results: (
|
|
5745
|
+
results: (_f = (_e = value.item.results) == null ? void 0 : _e.map((result) => ({
|
|
5495
5746
|
attributes: result.attributes,
|
|
5496
5747
|
fileId: result.file_id,
|
|
5497
5748
|
filename: result.filename,
|
|
5498
5749
|
score: result.score,
|
|
5499
5750
|
text: result.text
|
|
5500
|
-
}))) != null ?
|
|
5751
|
+
}))) != null ? _f : null
|
|
5501
5752
|
}
|
|
5502
5753
|
});
|
|
5503
5754
|
} else if (value.item.type === "code_interpreter_call") {
|
|
@@ -5519,12 +5770,62 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5519
5770
|
result: value.item.result
|
|
5520
5771
|
}
|
|
5521
5772
|
});
|
|
5773
|
+
} else if (value.item.type === "tool_search_call") {
|
|
5774
|
+
const toolCall = ongoingToolCalls[value.output_index];
|
|
5775
|
+
const isHosted = value.item.execution === "server";
|
|
5776
|
+
if (toolCall != null) {
|
|
5777
|
+
const toolCallId = isHosted ? toolCall.toolCallId : (_g = value.item.call_id) != null ? _g : value.item.id;
|
|
5778
|
+
if (isHosted) {
|
|
5779
|
+
hostedToolSearchCallIds.push(toolCallId);
|
|
5780
|
+
} else {
|
|
5781
|
+
controller.enqueue({
|
|
5782
|
+
type: "tool-input-start",
|
|
5783
|
+
id: toolCallId,
|
|
5784
|
+
toolName: toolCall.toolName
|
|
5785
|
+
});
|
|
5786
|
+
}
|
|
5787
|
+
controller.enqueue({
|
|
5788
|
+
type: "tool-input-end",
|
|
5789
|
+
id: toolCallId
|
|
5790
|
+
});
|
|
5791
|
+
controller.enqueue({
|
|
5792
|
+
type: "tool-call",
|
|
5793
|
+
toolCallId,
|
|
5794
|
+
toolName: toolCall.toolName,
|
|
5795
|
+
input: JSON.stringify({
|
|
5796
|
+
arguments: value.item.arguments,
|
|
5797
|
+
call_id: isHosted ? null : toolCallId
|
|
5798
|
+
}),
|
|
5799
|
+
...isHosted ? { providerExecuted: true } : {},
|
|
5800
|
+
providerMetadata: {
|
|
5801
|
+
[providerOptionsName]: {
|
|
5802
|
+
itemId: value.item.id
|
|
5803
|
+
}
|
|
5804
|
+
}
|
|
5805
|
+
});
|
|
5806
|
+
}
|
|
5807
|
+
ongoingToolCalls[value.output_index] = void 0;
|
|
5808
|
+
} else if (value.item.type === "tool_search_output") {
|
|
5809
|
+
const toolCallId = (_i = (_h = value.item.call_id) != null ? _h : hostedToolSearchCallIds.shift()) != null ? _i : value.item.id;
|
|
5810
|
+
controller.enqueue({
|
|
5811
|
+
type: "tool-result",
|
|
5812
|
+
toolCallId,
|
|
5813
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
5814
|
+
result: {
|
|
5815
|
+
tools: value.item.tools
|
|
5816
|
+
},
|
|
5817
|
+
providerMetadata: {
|
|
5818
|
+
[providerOptionsName]: {
|
|
5819
|
+
itemId: value.item.id
|
|
5820
|
+
}
|
|
5821
|
+
}
|
|
5822
|
+
});
|
|
5522
5823
|
} else if (value.item.type === "mcp_call") {
|
|
5523
5824
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5524
|
-
const approvalRequestId = (
|
|
5525
|
-
const aliasedToolCallId = approvalRequestId != null ? (
|
|
5825
|
+
const approvalRequestId = (_j = value.item.approval_request_id) != null ? _j : void 0;
|
|
5826
|
+
const aliasedToolCallId = approvalRequestId != null ? (_l = (_k = approvalRequestIdToDummyToolCallIdFromStream.get(
|
|
5526
5827
|
approvalRequestId
|
|
5527
|
-
)) != null ?
|
|
5828
|
+
)) != null ? _k : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _l : value.item.id : value.item.id;
|
|
5528
5829
|
const toolName = `mcp.${value.item.name}`;
|
|
5529
5830
|
controller.enqueue({
|
|
5530
5831
|
type: "tool-call",
|
|
@@ -5594,8 +5895,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5594
5895
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5595
5896
|
} else if (value.item.type === "mcp_approval_request") {
|
|
5596
5897
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5597
|
-
const dummyToolCallId = (
|
|
5598
|
-
const approvalRequestId = (
|
|
5898
|
+
const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2();
|
|
5899
|
+
const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
|
|
5599
5900
|
approvalRequestIdToDummyToolCallIdFromStream.set(
|
|
5600
5901
|
approvalRequestId,
|
|
5601
5902
|
dummyToolCallId
|
|
@@ -5684,7 +5985,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5684
5985
|
providerMetadata: {
|
|
5685
5986
|
[providerOptionsName]: {
|
|
5686
5987
|
itemId: value.item.id,
|
|
5687
|
-
reasoningEncryptedContent: (
|
|
5988
|
+
reasoningEncryptedContent: (_q = value.item.encrypted_content) != null ? _q : null
|
|
5688
5989
|
}
|
|
5689
5990
|
}
|
|
5690
5991
|
});
|
|
@@ -5797,7 +6098,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5797
6098
|
id: value.item_id,
|
|
5798
6099
|
delta: value.delta
|
|
5799
6100
|
});
|
|
5800
|
-
if (((
|
|
6101
|
+
if (((_s = (_r = options.providerOptions) == null ? void 0 : _r[providerOptionsName]) == null ? void 0 : _s.logprobs) && value.logprobs) {
|
|
5801
6102
|
logprobs.push(value.logprobs);
|
|
5802
6103
|
}
|
|
5803
6104
|
} else if (value.type === "response.reasoning_summary_part.added") {
|
|
@@ -5826,7 +6127,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5826
6127
|
providerMetadata: {
|
|
5827
6128
|
[providerOptionsName]: {
|
|
5828
6129
|
itemId: value.item_id,
|
|
5829
|
-
reasoningEncryptedContent: (
|
|
6130
|
+
reasoningEncryptedContent: (_u = (_t = activeReasoning[value.item_id]) == null ? void 0 : _t.encryptedContent) != null ? _u : null
|
|
5830
6131
|
}
|
|
5831
6132
|
}
|
|
5832
6133
|
});
|
|
@@ -5860,10 +6161,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5860
6161
|
} else if (isResponseFinishedChunk(value)) {
|
|
5861
6162
|
finishReason = {
|
|
5862
6163
|
unified: mapOpenAIResponseFinishReason({
|
|
5863
|
-
finishReason: (
|
|
6164
|
+
finishReason: (_v = value.response.incomplete_details) == null ? void 0 : _v.reason,
|
|
5864
6165
|
hasFunctionCall
|
|
5865
6166
|
}),
|
|
5866
|
-
raw: (
|
|
6167
|
+
raw: (_x = (_w = value.response.incomplete_details) == null ? void 0 : _w.reason) != null ? _x : void 0
|
|
5867
6168
|
};
|
|
5868
6169
|
usage = value.response.usage;
|
|
5869
6170
|
if (typeof value.response.service_tier === "string") {
|
|
@@ -5875,7 +6176,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5875
6176
|
controller.enqueue({
|
|
5876
6177
|
type: "source",
|
|
5877
6178
|
sourceType: "url",
|
|
5878
|
-
id: (
|
|
6179
|
+
id: (_A = (_z = (_y = self.config).generateId) == null ? void 0 : _z.call(_y)) != null ? _A : generateId2(),
|
|
5879
6180
|
url: value.annotation.url,
|
|
5880
6181
|
title: value.annotation.title
|
|
5881
6182
|
});
|
|
@@ -5883,7 +6184,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5883
6184
|
controller.enqueue({
|
|
5884
6185
|
type: "source",
|
|
5885
6186
|
sourceType: "document",
|
|
5886
|
-
id: (
|
|
6187
|
+
id: (_D = (_C = (_B = self.config).generateId) == null ? void 0 : _C.call(_B)) != null ? _D : generateId2(),
|
|
5887
6188
|
mediaType: "text/plain",
|
|
5888
6189
|
title: value.annotation.filename,
|
|
5889
6190
|
filename: value.annotation.filename,
|
|
@@ -5899,7 +6200,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5899
6200
|
controller.enqueue({
|
|
5900
6201
|
type: "source",
|
|
5901
6202
|
sourceType: "document",
|
|
5902
|
-
id: (
|
|
6203
|
+
id: (_G = (_F = (_E = self.config).generateId) == null ? void 0 : _F.call(_E)) != null ? _G : generateId2(),
|
|
5903
6204
|
mediaType: "text/plain",
|
|
5904
6205
|
title: value.annotation.filename,
|
|
5905
6206
|
filename: value.annotation.filename,
|
|
@@ -5915,7 +6216,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5915
6216
|
controller.enqueue({
|
|
5916
6217
|
type: "source",
|
|
5917
6218
|
sourceType: "document",
|
|
5918
|
-
id: (
|
|
6219
|
+
id: (_J = (_I = (_H = self.config).generateId) == null ? void 0 : _I.call(_H)) != null ? _J : generateId2(),
|
|
5919
6220
|
mediaType: "application/octet-stream",
|
|
5920
6221
|
title: value.annotation.file_id,
|
|
5921
6222
|
filename: value.annotation.file_id,
|
|
@@ -6033,13 +6334,13 @@ import {
|
|
|
6033
6334
|
} from "@ai-sdk/provider-utils";
|
|
6034
6335
|
|
|
6035
6336
|
// src/speech/openai-speech-options.ts
|
|
6036
|
-
import { lazySchema as
|
|
6037
|
-
import { z as
|
|
6038
|
-
var openaiSpeechModelOptionsSchema =
|
|
6039
|
-
() =>
|
|
6040
|
-
|
|
6041
|
-
instructions:
|
|
6042
|
-
speed:
|
|
6337
|
+
import { lazySchema as lazySchema21, zodSchema as zodSchema21 } from "@ai-sdk/provider-utils";
|
|
6338
|
+
import { z as z23 } from "zod/v4";
|
|
6339
|
+
var openaiSpeechModelOptionsSchema = lazySchema21(
|
|
6340
|
+
() => zodSchema21(
|
|
6341
|
+
z23.object({
|
|
6342
|
+
instructions: z23.string().nullish(),
|
|
6343
|
+
speed: z23.number().min(0.25).max(4).default(1).nullish()
|
|
6043
6344
|
})
|
|
6044
6345
|
)
|
|
6045
6346
|
);
|
|
@@ -6049,7 +6350,7 @@ var OpenAISpeechModel = class {
|
|
|
6049
6350
|
constructor(modelId, config) {
|
|
6050
6351
|
this.modelId = modelId;
|
|
6051
6352
|
this.config = config;
|
|
6052
|
-
this.specificationVersion = "
|
|
6353
|
+
this.specificationVersion = "v4";
|
|
6053
6354
|
}
|
|
6054
6355
|
get provider() {
|
|
6055
6356
|
return this.config.provider;
|
|
@@ -6156,33 +6457,33 @@ import {
|
|
|
6156
6457
|
} from "@ai-sdk/provider-utils";
|
|
6157
6458
|
|
|
6158
6459
|
// src/transcription/openai-transcription-api.ts
|
|
6159
|
-
import { lazySchema as
|
|
6160
|
-
import { z as
|
|
6161
|
-
var openaiTranscriptionResponseSchema =
|
|
6162
|
-
() =>
|
|
6163
|
-
|
|
6164
|
-
text:
|
|
6165
|
-
language:
|
|
6166
|
-
duration:
|
|
6167
|
-
words:
|
|
6168
|
-
|
|
6169
|
-
word:
|
|
6170
|
-
start:
|
|
6171
|
-
end:
|
|
6460
|
+
import { lazySchema as lazySchema22, zodSchema as zodSchema22 } from "@ai-sdk/provider-utils";
|
|
6461
|
+
import { z as z24 } from "zod/v4";
|
|
6462
|
+
var openaiTranscriptionResponseSchema = lazySchema22(
|
|
6463
|
+
() => zodSchema22(
|
|
6464
|
+
z24.object({
|
|
6465
|
+
text: z24.string(),
|
|
6466
|
+
language: z24.string().nullish(),
|
|
6467
|
+
duration: z24.number().nullish(),
|
|
6468
|
+
words: z24.array(
|
|
6469
|
+
z24.object({
|
|
6470
|
+
word: z24.string(),
|
|
6471
|
+
start: z24.number(),
|
|
6472
|
+
end: z24.number()
|
|
6172
6473
|
})
|
|
6173
6474
|
).nullish(),
|
|
6174
|
-
segments:
|
|
6175
|
-
|
|
6176
|
-
id:
|
|
6177
|
-
seek:
|
|
6178
|
-
start:
|
|
6179
|
-
end:
|
|
6180
|
-
text:
|
|
6181
|
-
tokens:
|
|
6182
|
-
temperature:
|
|
6183
|
-
avg_logprob:
|
|
6184
|
-
compression_ratio:
|
|
6185
|
-
no_speech_prob:
|
|
6475
|
+
segments: z24.array(
|
|
6476
|
+
z24.object({
|
|
6477
|
+
id: z24.number(),
|
|
6478
|
+
seek: z24.number(),
|
|
6479
|
+
start: z24.number(),
|
|
6480
|
+
end: z24.number(),
|
|
6481
|
+
text: z24.string(),
|
|
6482
|
+
tokens: z24.array(z24.number()),
|
|
6483
|
+
temperature: z24.number(),
|
|
6484
|
+
avg_logprob: z24.number(),
|
|
6485
|
+
compression_ratio: z24.number(),
|
|
6486
|
+
no_speech_prob: z24.number()
|
|
6186
6487
|
})
|
|
6187
6488
|
).nullish()
|
|
6188
6489
|
})
|
|
@@ -6190,33 +6491,33 @@ var openaiTranscriptionResponseSchema = lazySchema21(
|
|
|
6190
6491
|
);
|
|
6191
6492
|
|
|
6192
6493
|
// src/transcription/openai-transcription-options.ts
|
|
6193
|
-
import { lazySchema as
|
|
6194
|
-
import { z as
|
|
6195
|
-
var openAITranscriptionModelOptions =
|
|
6196
|
-
() =>
|
|
6197
|
-
|
|
6494
|
+
import { lazySchema as lazySchema23, zodSchema as zodSchema23 } from "@ai-sdk/provider-utils";
|
|
6495
|
+
import { z as z25 } from "zod/v4";
|
|
6496
|
+
var openAITranscriptionModelOptions = lazySchema23(
|
|
6497
|
+
() => zodSchema23(
|
|
6498
|
+
z25.object({
|
|
6198
6499
|
/**
|
|
6199
6500
|
* Additional information to include in the transcription response.
|
|
6200
6501
|
*/
|
|
6201
|
-
include:
|
|
6502
|
+
include: z25.array(z25.string()).optional(),
|
|
6202
6503
|
/**
|
|
6203
6504
|
* The language of the input audio in ISO-639-1 format.
|
|
6204
6505
|
*/
|
|
6205
|
-
language:
|
|
6506
|
+
language: z25.string().optional(),
|
|
6206
6507
|
/**
|
|
6207
6508
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
6208
6509
|
*/
|
|
6209
|
-
prompt:
|
|
6510
|
+
prompt: z25.string().optional(),
|
|
6210
6511
|
/**
|
|
6211
6512
|
* The sampling temperature, between 0 and 1.
|
|
6212
6513
|
* @default 0
|
|
6213
6514
|
*/
|
|
6214
|
-
temperature:
|
|
6515
|
+
temperature: z25.number().min(0).max(1).default(0).optional(),
|
|
6215
6516
|
/**
|
|
6216
6517
|
* The timestamp granularities to populate for this transcription.
|
|
6217
6518
|
* @default ['segment']
|
|
6218
6519
|
*/
|
|
6219
|
-
timestampGranularities:
|
|
6520
|
+
timestampGranularities: z25.array(z25.enum(["word", "segment"])).default(["segment"]).optional()
|
|
6220
6521
|
})
|
|
6221
6522
|
)
|
|
6222
6523
|
);
|
|
@@ -6285,7 +6586,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6285
6586
|
constructor(modelId, config) {
|
|
6286
6587
|
this.modelId = modelId;
|
|
6287
6588
|
this.config = config;
|
|
6288
|
-
this.specificationVersion = "
|
|
6589
|
+
this.specificationVersion = "v4";
|
|
6289
6590
|
}
|
|
6290
6591
|
get provider() {
|
|
6291
6592
|
return this.config.provider;
|
|
@@ -6389,7 +6690,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6389
6690
|
};
|
|
6390
6691
|
|
|
6391
6692
|
// src/version.ts
|
|
6392
|
-
var VERSION = true ? "4.0.0-beta.
|
|
6693
|
+
var VERSION = true ? "4.0.0-beta.11" : "0.0.0-test";
|
|
6393
6694
|
|
|
6394
6695
|
// src/openai-provider.ts
|
|
6395
6696
|
function createOpenAI(options = {}) {
|
|
@@ -6470,7 +6771,7 @@ function createOpenAI(options = {}) {
|
|
|
6470
6771
|
const provider = function(modelId) {
|
|
6471
6772
|
return createLanguageModel(modelId);
|
|
6472
6773
|
};
|
|
6473
|
-
provider.specificationVersion = "
|
|
6774
|
+
provider.specificationVersion = "v4";
|
|
6474
6775
|
provider.languageModel = createLanguageModel;
|
|
6475
6776
|
provider.chat = createChatModel;
|
|
6476
6777
|
provider.completion = createCompletionModel;
|