@ai-sdk/openai 3.0.0-beta.71 → 3.0.0-beta.72
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 +9 -0
- package/dist/index.d.mts +0 -16
- package/dist/index.d.ts +0 -16
- package/dist/index.js +80 -79
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +81 -79
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +249 -232
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +260 -242
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1790,7 +1790,6 @@ var codeInterpreterArgsSchema = (0, import_provider_utils14.lazySchema)(
|
|
|
1790
1790
|
);
|
|
1791
1791
|
var codeInterpreterToolFactory = (0, import_provider_utils14.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
1792
1792
|
id: "openai.code_interpreter",
|
|
1793
|
-
name: "code_interpreter",
|
|
1794
1793
|
inputSchema: codeInterpreterInputSchema,
|
|
1795
1794
|
outputSchema: codeInterpreterOutputSchema
|
|
1796
1795
|
});
|
|
@@ -1843,7 +1842,6 @@ var fileSearchOutputSchema = (0, import_provider_utils15.lazySchema)(
|
|
|
1843
1842
|
);
|
|
1844
1843
|
var fileSearch = (0, import_provider_utils15.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
1845
1844
|
id: "openai.file_search",
|
|
1846
|
-
name: "file_search",
|
|
1847
1845
|
inputSchema: import_v410.z.object({}),
|
|
1848
1846
|
outputSchema: fileSearchOutputSchema
|
|
1849
1847
|
});
|
|
@@ -1876,7 +1874,6 @@ var imageGenerationOutputSchema = (0, import_provider_utils16.lazySchema)(
|
|
|
1876
1874
|
);
|
|
1877
1875
|
var imageGenerationToolFactory = (0, import_provider_utils16.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
1878
1876
|
id: "openai.image_generation",
|
|
1879
|
-
name: "image_generation",
|
|
1880
1877
|
inputSchema: imageGenerationInputSchema,
|
|
1881
1878
|
outputSchema: imageGenerationOutputSchema
|
|
1882
1879
|
});
|
|
@@ -1906,7 +1903,6 @@ var localShellOutputSchema = (0, import_provider_utils17.lazySchema)(
|
|
|
1906
1903
|
);
|
|
1907
1904
|
var localShell = (0, import_provider_utils17.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
1908
1905
|
id: "openai.local_shell",
|
|
1909
|
-
name: "local_shell",
|
|
1910
1906
|
inputSchema: localShellInputSchema,
|
|
1911
1907
|
outputSchema: localShellOutputSchema
|
|
1912
1908
|
});
|
|
@@ -1960,7 +1956,6 @@ var webSearchOutputSchema = (0, import_provider_utils18.lazySchema)(
|
|
|
1960
1956
|
);
|
|
1961
1957
|
var webSearchToolFactory = (0, import_provider_utils18.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
1962
1958
|
id: "openai.web_search",
|
|
1963
|
-
name: "web_search",
|
|
1964
1959
|
inputSchema: webSearchInputSchema,
|
|
1965
1960
|
outputSchema: webSearchOutputSchema
|
|
1966
1961
|
});
|
|
@@ -2009,7 +2004,6 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils19.lazySchema)(
|
|
|
2009
2004
|
);
|
|
2010
2005
|
var webSearchPreview = (0, import_provider_utils19.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
2011
2006
|
id: "openai.web_search_preview",
|
|
2012
|
-
name: "web_search_preview",
|
|
2013
2007
|
inputSchema: webSearchPreviewInputSchema,
|
|
2014
2008
|
outputSchema: webSearchPreviewOutputSchema
|
|
2015
2009
|
});
|
|
@@ -2096,7 +2090,6 @@ var mcpOutputSchema = (0, import_provider_utils20.lazySchema)(
|
|
|
2096
2090
|
);
|
|
2097
2091
|
var mcpToolFactory = (0, import_provider_utils20.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
2098
2092
|
id: "openai.mcp",
|
|
2099
|
-
name: "mcp",
|
|
2100
2093
|
inputSchema: mcpInputSchema,
|
|
2101
2094
|
outputSchema: mcpOutputSchema
|
|
2102
2095
|
});
|
|
@@ -2110,8 +2103,6 @@ var openaiTools = {
|
|
|
2110
2103
|
* coding, and math.
|
|
2111
2104
|
*
|
|
2112
2105
|
* @param container - The container to use for the code interpreter.
|
|
2113
|
-
*
|
|
2114
|
-
* Must have name `code_interpreter`.
|
|
2115
2106
|
*/
|
|
2116
2107
|
codeInterpreter,
|
|
2117
2108
|
/**
|
|
@@ -2119,8 +2110,6 @@ var openaiTools = {
|
|
|
2119
2110
|
* retrieve information in a knowledge base of previously uploaded files through
|
|
2120
2111
|
* semantic and keyword search.
|
|
2121
2112
|
*
|
|
2122
|
-
* Must have name `file_search`.
|
|
2123
|
-
*
|
|
2124
2113
|
* @param vectorStoreIds - The vector store IDs to use for the file search.
|
|
2125
2114
|
* @param maxNumResults - The maximum number of results to return.
|
|
2126
2115
|
* @param ranking - The ranking options to use for the file search.
|
|
@@ -2132,8 +2121,6 @@ var openaiTools = {
|
|
|
2132
2121
|
* and optionally image inputs. It leverages the GPT Image model,
|
|
2133
2122
|
* and automatically optimizes text inputs for improved performance.
|
|
2134
2123
|
*
|
|
2135
|
-
* Must have name `image_generation`.
|
|
2136
|
-
*
|
|
2137
2124
|
* @param background - Background type for the generated image. One of 'auto', 'opaque', or 'transparent'.
|
|
2138
2125
|
* @param inputFidelity - Input fidelity for the generated image. One of 'low' or 'high'.
|
|
2139
2126
|
* @param inputImageMask - Optional mask for inpainting. Contains fileId and/or imageUrl.
|
|
@@ -2151,28 +2138,20 @@ var openaiTools = {
|
|
|
2151
2138
|
* on a machine you or the user provides.
|
|
2152
2139
|
*
|
|
2153
2140
|
* Supported models: `gpt-5-codex` and `codex-mini-latest`
|
|
2154
|
-
*
|
|
2155
|
-
* Must have name `local_shell`.
|
|
2156
2141
|
*/
|
|
2157
2142
|
localShell,
|
|
2158
2143
|
/**
|
|
2159
2144
|
* Web search allows models to access up-to-date information from the internet
|
|
2160
2145
|
* and provide answers with sourced citations.
|
|
2161
2146
|
*
|
|
2162
|
-
* Must have name `web_search_preview`.
|
|
2163
|
-
*
|
|
2164
2147
|
* @param searchContextSize - The search context size to use for the web search.
|
|
2165
2148
|
* @param userLocation - The user location to use for the web search.
|
|
2166
|
-
*
|
|
2167
|
-
* @deprecated Use `webSearch` instead.
|
|
2168
2149
|
*/
|
|
2169
2150
|
webSearchPreview,
|
|
2170
2151
|
/**
|
|
2171
2152
|
* Web search allows models to access up-to-date information from the internet
|
|
2172
2153
|
* and provide answers with sourced citations.
|
|
2173
2154
|
*
|
|
2174
|
-
* Must have name `web_search`.
|
|
2175
|
-
*
|
|
2176
2155
|
* @param filters - The filters to use for the web search.
|
|
2177
2156
|
* @param searchContextSize - The search context size to use for the web search.
|
|
2178
2157
|
* @param userLocation - The user location to use for the web search.
|
|
@@ -2182,8 +2161,6 @@ var openaiTools = {
|
|
|
2182
2161
|
* MCP (Model Context Protocol) allows models to call tools exposed by
|
|
2183
2162
|
* remote MCP servers or service connectors.
|
|
2184
2163
|
*
|
|
2185
|
-
* Must have name `mcp`.
|
|
2186
|
-
*
|
|
2187
2164
|
* @param serverLabel - Label to identify the MCP server.
|
|
2188
2165
|
* @param allowedTools - Allowed tool names or filter object.
|
|
2189
2166
|
* @param authorization - OAuth access token for the MCP server/connector.
|
|
@@ -2210,6 +2187,7 @@ function isFileId(data, prefixes) {
|
|
|
2210
2187
|
}
|
|
2211
2188
|
async function convertToOpenAIResponsesInput({
|
|
2212
2189
|
prompt,
|
|
2190
|
+
toolNameMapping,
|
|
2213
2191
|
systemMessageMode,
|
|
2214
2192
|
fileIdPrefixes,
|
|
2215
2193
|
store,
|
|
@@ -2292,7 +2270,6 @@ async function convertToOpenAIResponsesInput({
|
|
|
2292
2270
|
}
|
|
2293
2271
|
case "assistant": {
|
|
2294
2272
|
const reasoningMessages = {};
|
|
2295
|
-
const toolCallParts = {};
|
|
2296
2273
|
for (const part of content) {
|
|
2297
2274
|
switch (part.type) {
|
|
2298
2275
|
case "text": {
|
|
@@ -2309,7 +2286,6 @@ async function convertToOpenAIResponsesInput({
|
|
|
2309
2286
|
break;
|
|
2310
2287
|
}
|
|
2311
2288
|
case "tool-call": {
|
|
2312
|
-
toolCallParts[part.toolCallId] = part;
|
|
2313
2289
|
if (part.providerExecuted) {
|
|
2314
2290
|
break;
|
|
2315
2291
|
}
|
|
@@ -2318,7 +2294,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
2318
2294
|
input.push({ type: "item_reference", id });
|
|
2319
2295
|
break;
|
|
2320
2296
|
}
|
|
2321
|
-
|
|
2297
|
+
const resolvedToolName = toolNameMapping.toProviderToolName(
|
|
2298
|
+
part.toolName
|
|
2299
|
+
);
|
|
2300
|
+
if (hasLocalShellTool && resolvedToolName === "local_shell") {
|
|
2322
2301
|
const parsedInput = await (0, import_provider_utils21.validateTypes)({
|
|
2323
2302
|
value: part.input,
|
|
2324
2303
|
schema: localShellInputSchema
|
|
@@ -2341,7 +2320,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2341
2320
|
input.push({
|
|
2342
2321
|
type: "function_call",
|
|
2343
2322
|
call_id: part.toolCallId,
|
|
2344
|
-
name:
|
|
2323
|
+
name: resolvedToolName,
|
|
2345
2324
|
arguments: JSON.stringify(part.input),
|
|
2346
2325
|
id
|
|
2347
2326
|
});
|
|
@@ -2420,7 +2399,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
2420
2399
|
case "tool": {
|
|
2421
2400
|
for (const part of content) {
|
|
2422
2401
|
const output = part.output;
|
|
2423
|
-
|
|
2402
|
+
const resolvedToolName = toolNameMapping.toProviderToolName(
|
|
2403
|
+
part.toolName
|
|
2404
|
+
);
|
|
2405
|
+
if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
|
|
2424
2406
|
const parsedOutput = await (0, import_provider_utils21.validateTypes)({
|
|
2425
2407
|
value: output.value,
|
|
2426
2408
|
schema: localShellOutputSchema
|
|
@@ -3345,15 +3327,6 @@ async function prepareResponsesTools({
|
|
|
3345
3327
|
authorization: args.authorization,
|
|
3346
3328
|
connector_id: args.connectorId,
|
|
3347
3329
|
headers: args.headers,
|
|
3348
|
-
// require_approval:
|
|
3349
|
-
// typeof args.requireApproval === 'string'
|
|
3350
|
-
// ? args.requireApproval
|
|
3351
|
-
// : args.requireApproval
|
|
3352
|
-
// ? {
|
|
3353
|
-
// read_only: args.requireApproval.readOnly,
|
|
3354
|
-
// tool_names: args.requireApproval.toolNames,
|
|
3355
|
-
// }
|
|
3356
|
-
// : undefined,
|
|
3357
3330
|
require_approval: "never",
|
|
3358
3331
|
server_description: args.serverDescription,
|
|
3359
3332
|
server_url: args.serverUrl
|
|
@@ -3454,8 +3427,21 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3454
3427
|
details: "conversation and previousResponseId cannot be used together"
|
|
3455
3428
|
});
|
|
3456
3429
|
}
|
|
3430
|
+
const toolNameMapping = (0, import_provider_utils25.createToolNameMapping)({
|
|
3431
|
+
tools,
|
|
3432
|
+
providerToolNames: {
|
|
3433
|
+
"openai.code_interpreter": "code_interpreter",
|
|
3434
|
+
"openai.file_search": "file_search",
|
|
3435
|
+
"openai.image_generation": "image_generation",
|
|
3436
|
+
"openai.local_shell": "local_shell",
|
|
3437
|
+
"openai.web_search": "web_search",
|
|
3438
|
+
"openai.web_search_preview": "web_search_preview",
|
|
3439
|
+
"openai.mcp": "mcp"
|
|
3440
|
+
}
|
|
3441
|
+
});
|
|
3457
3442
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
3458
3443
|
prompt,
|
|
3444
|
+
toolNameMapping,
|
|
3459
3445
|
systemMessageMode: modelConfig.systemMessageMode,
|
|
3460
3446
|
fileIdPrefixes: this.config.fileIdPrefixes,
|
|
3461
3447
|
store: (_a = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _a : true,
|
|
@@ -3609,7 +3595,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3609
3595
|
tool_choice: openaiToolChoice
|
|
3610
3596
|
},
|
|
3611
3597
|
warnings: [...warnings, ...toolWarnings],
|
|
3612
|
-
store
|
|
3598
|
+
store,
|
|
3599
|
+
toolNameMapping
|
|
3613
3600
|
};
|
|
3614
3601
|
}
|
|
3615
3602
|
async doGenerate(options) {
|
|
@@ -3617,7 +3604,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3617
3604
|
const {
|
|
3618
3605
|
args: body,
|
|
3619
3606
|
warnings,
|
|
3620
|
-
webSearchToolName
|
|
3607
|
+
webSearchToolName,
|
|
3608
|
+
toolNameMapping
|
|
3621
3609
|
} = await this.getArgs(options);
|
|
3622
3610
|
const url = this.config.url({
|
|
3623
3611
|
path: "/responses",
|
|
@@ -3677,14 +3665,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3677
3665
|
content.push({
|
|
3678
3666
|
type: "tool-call",
|
|
3679
3667
|
toolCallId: part.id,
|
|
3680
|
-
toolName: "image_generation",
|
|
3668
|
+
toolName: toolNameMapping.toCustomToolName("image_generation"),
|
|
3681
3669
|
input: "{}",
|
|
3682
3670
|
providerExecuted: true
|
|
3683
3671
|
});
|
|
3684
3672
|
content.push({
|
|
3685
3673
|
type: "tool-result",
|
|
3686
3674
|
toolCallId: part.id,
|
|
3687
|
-
toolName: "image_generation",
|
|
3675
|
+
toolName: toolNameMapping.toCustomToolName("image_generation"),
|
|
3688
3676
|
result: {
|
|
3689
3677
|
result: part.result
|
|
3690
3678
|
}
|
|
@@ -3695,7 +3683,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3695
3683
|
content.push({
|
|
3696
3684
|
type: "tool-call",
|
|
3697
3685
|
toolCallId: part.call_id,
|
|
3698
|
-
toolName: "local_shell",
|
|
3686
|
+
toolName: toolNameMapping.toCustomToolName("local_shell"),
|
|
3699
3687
|
input: JSON.stringify({
|
|
3700
3688
|
action: part.action
|
|
3701
3689
|
}),
|
|
@@ -3805,14 +3793,18 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3805
3793
|
content.push({
|
|
3806
3794
|
type: "tool-call",
|
|
3807
3795
|
toolCallId: part.id,
|
|
3808
|
-
toolName:
|
|
3796
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
3797
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
3798
|
+
),
|
|
3809
3799
|
input: JSON.stringify({}),
|
|
3810
3800
|
providerExecuted: true
|
|
3811
3801
|
});
|
|
3812
3802
|
content.push({
|
|
3813
3803
|
type: "tool-result",
|
|
3814
3804
|
toolCallId: part.id,
|
|
3815
|
-
toolName:
|
|
3805
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
3806
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
3807
|
+
),
|
|
3816
3808
|
result: mapWebSearchOutput(part.action)
|
|
3817
3809
|
});
|
|
3818
3810
|
break;
|
|
@@ -3821,14 +3813,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3821
3813
|
content.push({
|
|
3822
3814
|
type: "tool-call",
|
|
3823
3815
|
toolCallId: part.id,
|
|
3824
|
-
toolName: "mcp",
|
|
3816
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
3825
3817
|
input: JSON.stringify({}),
|
|
3826
3818
|
providerExecuted: true
|
|
3827
3819
|
});
|
|
3828
3820
|
content.push({
|
|
3829
3821
|
type: "tool-result",
|
|
3830
3822
|
toolCallId: part.id,
|
|
3831
|
-
toolName: "mcp",
|
|
3823
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
3832
3824
|
result: {
|
|
3833
3825
|
type: "call",
|
|
3834
3826
|
serverLabel: part.server_label,
|
|
@@ -3844,14 +3836,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3844
3836
|
content.push({
|
|
3845
3837
|
type: "tool-call",
|
|
3846
3838
|
toolCallId: part.id,
|
|
3847
|
-
toolName: "mcp",
|
|
3839
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
3848
3840
|
input: JSON.stringify({}),
|
|
3849
3841
|
providerExecuted: true
|
|
3850
3842
|
});
|
|
3851
3843
|
content.push({
|
|
3852
3844
|
type: "tool-result",
|
|
3853
3845
|
toolCallId: part.id,
|
|
3854
|
-
toolName: "mcp",
|
|
3846
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
3855
3847
|
result: {
|
|
3856
3848
|
type: "listTools",
|
|
3857
3849
|
serverLabel: part.server_label,
|
|
@@ -3873,14 +3865,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3873
3865
|
content.push({
|
|
3874
3866
|
type: "tool-call",
|
|
3875
3867
|
toolCallId: part.id,
|
|
3876
|
-
toolName: "mcp",
|
|
3868
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
3877
3869
|
input: JSON.stringify({}),
|
|
3878
3870
|
providerExecuted: true
|
|
3879
3871
|
});
|
|
3880
3872
|
content.push({
|
|
3881
3873
|
type: "tool-result",
|
|
3882
3874
|
toolCallId: part.id,
|
|
3883
|
-
toolName: "mcp",
|
|
3875
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
3884
3876
|
result: {
|
|
3885
3877
|
type: "approvalRequest",
|
|
3886
3878
|
serverLabel: part.server_label,
|
|
@@ -3895,14 +3887,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3895
3887
|
content.push({
|
|
3896
3888
|
type: "tool-call",
|
|
3897
3889
|
toolCallId: part.id,
|
|
3898
|
-
toolName: "computer_use",
|
|
3890
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
3899
3891
|
input: "",
|
|
3900
3892
|
providerExecuted: true
|
|
3901
3893
|
});
|
|
3902
3894
|
content.push({
|
|
3903
3895
|
type: "tool-result",
|
|
3904
3896
|
toolCallId: part.id,
|
|
3905
|
-
toolName: "computer_use",
|
|
3897
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
3906
3898
|
result: {
|
|
3907
3899
|
type: "computer_use_tool_result",
|
|
3908
3900
|
status: part.status || "completed"
|
|
@@ -3914,14 +3906,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3914
3906
|
content.push({
|
|
3915
3907
|
type: "tool-call",
|
|
3916
3908
|
toolCallId: part.id,
|
|
3917
|
-
toolName: "file_search",
|
|
3909
|
+
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
3918
3910
|
input: "{}",
|
|
3919
3911
|
providerExecuted: true
|
|
3920
3912
|
});
|
|
3921
3913
|
content.push({
|
|
3922
3914
|
type: "tool-result",
|
|
3923
3915
|
toolCallId: part.id,
|
|
3924
|
-
toolName: "file_search",
|
|
3916
|
+
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
3925
3917
|
result: {
|
|
3926
3918
|
queries: part.queries,
|
|
3927
3919
|
results: (_w = (_v = part.results) == null ? void 0 : _v.map((result) => ({
|
|
@@ -3939,7 +3931,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3939
3931
|
content.push({
|
|
3940
3932
|
type: "tool-call",
|
|
3941
3933
|
toolCallId: part.id,
|
|
3942
|
-
toolName: "code_interpreter",
|
|
3934
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
3943
3935
|
input: JSON.stringify({
|
|
3944
3936
|
code: part.code,
|
|
3945
3937
|
containerId: part.container_id
|
|
@@ -3949,7 +3941,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3949
3941
|
content.push({
|
|
3950
3942
|
type: "tool-result",
|
|
3951
3943
|
toolCallId: part.id,
|
|
3952
|
-
toolName: "code_interpreter",
|
|
3944
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
3953
3945
|
result: {
|
|
3954
3946
|
outputs: part.outputs
|
|
3955
3947
|
}
|
|
@@ -3998,6 +3990,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3998
3990
|
args: body,
|
|
3999
3991
|
warnings,
|
|
4000
3992
|
webSearchToolName,
|
|
3993
|
+
toolNameMapping,
|
|
4001
3994
|
store
|
|
4002
3995
|
} = await this.getArgs(options);
|
|
4003
3996
|
const { responseHeaders, value: response } = await (0, import_provider_utils25.postJsonToApi)({
|
|
@@ -4062,13 +4055,17 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4062
4055
|
});
|
|
4063
4056
|
} else if (value.item.type === "web_search_call") {
|
|
4064
4057
|
ongoingToolCalls[value.output_index] = {
|
|
4065
|
-
toolName:
|
|
4058
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
4059
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
4060
|
+
),
|
|
4066
4061
|
toolCallId: value.item.id
|
|
4067
4062
|
};
|
|
4068
4063
|
controller.enqueue({
|
|
4069
4064
|
type: "tool-input-start",
|
|
4070
4065
|
id: value.item.id,
|
|
4071
|
-
toolName:
|
|
4066
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
4067
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
4068
|
+
),
|
|
4072
4069
|
providerExecuted: true
|
|
4073
4070
|
});
|
|
4074
4071
|
controller.enqueue({
|
|
@@ -4078,24 +4075,26 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4078
4075
|
controller.enqueue({
|
|
4079
4076
|
type: "tool-call",
|
|
4080
4077
|
toolCallId: value.item.id,
|
|
4081
|
-
toolName:
|
|
4078
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
4079
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
4080
|
+
),
|
|
4082
4081
|
input: JSON.stringify({}),
|
|
4083
4082
|
providerExecuted: true
|
|
4084
4083
|
});
|
|
4085
4084
|
} else if (value.item.type === "computer_call") {
|
|
4086
4085
|
ongoingToolCalls[value.output_index] = {
|
|
4087
|
-
toolName: "computer_use",
|
|
4086
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
4088
4087
|
toolCallId: value.item.id
|
|
4089
4088
|
};
|
|
4090
4089
|
controller.enqueue({
|
|
4091
4090
|
type: "tool-input-start",
|
|
4092
4091
|
id: value.item.id,
|
|
4093
|
-
toolName: "computer_use",
|
|
4092
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
4094
4093
|
providerExecuted: true
|
|
4095
4094
|
});
|
|
4096
4095
|
} else if (value.item.type === "code_interpreter_call") {
|
|
4097
4096
|
ongoingToolCalls[value.output_index] = {
|
|
4098
|
-
toolName: "code_interpreter",
|
|
4097
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
4099
4098
|
toolCallId: value.item.id,
|
|
4100
4099
|
codeInterpreter: {
|
|
4101
4100
|
containerId: value.item.container_id
|
|
@@ -4104,7 +4103,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4104
4103
|
controller.enqueue({
|
|
4105
4104
|
type: "tool-input-start",
|
|
4106
4105
|
id: value.item.id,
|
|
4107
|
-
toolName: "code_interpreter",
|
|
4106
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
4108
4107
|
providerExecuted: true
|
|
4109
4108
|
});
|
|
4110
4109
|
controller.enqueue({
|
|
@@ -4116,7 +4115,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4116
4115
|
controller.enqueue({
|
|
4117
4116
|
type: "tool-call",
|
|
4118
4117
|
toolCallId: value.item.id,
|
|
4119
|
-
toolName: "file_search",
|
|
4118
|
+
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
4120
4119
|
input: "{}",
|
|
4121
4120
|
providerExecuted: true
|
|
4122
4121
|
});
|
|
@@ -4124,7 +4123,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4124
4123
|
controller.enqueue({
|
|
4125
4124
|
type: "tool-call",
|
|
4126
4125
|
toolCallId: value.item.id,
|
|
4127
|
-
toolName: "image_generation",
|
|
4126
|
+
toolName: toolNameMapping.toCustomToolName("image_generation"),
|
|
4128
4127
|
input: "{}",
|
|
4129
4128
|
providerExecuted: true
|
|
4130
4129
|
});
|
|
@@ -4132,7 +4131,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4132
4131
|
controller.enqueue({
|
|
4133
4132
|
type: "tool-call",
|
|
4134
4133
|
toolCallId: value.item.id,
|
|
4135
|
-
toolName: "mcp",
|
|
4134
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4136
4135
|
input: "{}",
|
|
4137
4136
|
providerExecuted: true
|
|
4138
4137
|
});
|
|
@@ -4200,7 +4199,9 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4200
4199
|
controller.enqueue({
|
|
4201
4200
|
type: "tool-result",
|
|
4202
4201
|
toolCallId: value.item.id,
|
|
4203
|
-
toolName:
|
|
4202
|
+
toolName: toolNameMapping.toCustomToolName(
|
|
4203
|
+
webSearchToolName != null ? webSearchToolName : "web_search"
|
|
4204
|
+
),
|
|
4204
4205
|
result: mapWebSearchOutput(value.item.action)
|
|
4205
4206
|
});
|
|
4206
4207
|
} else if (value.item.type === "computer_call") {
|
|
@@ -4212,14 +4213,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4212
4213
|
controller.enqueue({
|
|
4213
4214
|
type: "tool-call",
|
|
4214
4215
|
toolCallId: value.item.id,
|
|
4215
|
-
toolName: "computer_use",
|
|
4216
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
4216
4217
|
input: "",
|
|
4217
4218
|
providerExecuted: true
|
|
4218
4219
|
});
|
|
4219
4220
|
controller.enqueue({
|
|
4220
4221
|
type: "tool-result",
|
|
4221
4222
|
toolCallId: value.item.id,
|
|
4222
|
-
toolName: "computer_use",
|
|
4223
|
+
toolName: toolNameMapping.toCustomToolName("computer_use"),
|
|
4223
4224
|
result: {
|
|
4224
4225
|
type: "computer_use_tool_result",
|
|
4225
4226
|
status: value.item.status || "completed"
|
|
@@ -4230,7 +4231,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4230
4231
|
controller.enqueue({
|
|
4231
4232
|
type: "tool-result",
|
|
4232
4233
|
toolCallId: value.item.id,
|
|
4233
|
-
toolName: "file_search",
|
|
4234
|
+
toolName: toolNameMapping.toCustomToolName("file_search"),
|
|
4234
4235
|
result: {
|
|
4235
4236
|
queries: value.item.queries,
|
|
4236
4237
|
results: (_c = (_b = value.item.results) == null ? void 0 : _b.map((result) => ({
|
|
@@ -4247,7 +4248,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4247
4248
|
controller.enqueue({
|
|
4248
4249
|
type: "tool-result",
|
|
4249
4250
|
toolCallId: value.item.id,
|
|
4250
|
-
toolName: "code_interpreter",
|
|
4251
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
4251
4252
|
result: {
|
|
4252
4253
|
outputs: value.item.outputs
|
|
4253
4254
|
}
|
|
@@ -4256,7 +4257,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4256
4257
|
controller.enqueue({
|
|
4257
4258
|
type: "tool-result",
|
|
4258
4259
|
toolCallId: value.item.id,
|
|
4259
|
-
toolName: "image_generation",
|
|
4260
|
+
toolName: toolNameMapping.toCustomToolName("image_generation"),
|
|
4260
4261
|
result: {
|
|
4261
4262
|
result: value.item.result
|
|
4262
4263
|
}
|
|
@@ -4266,7 +4267,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4266
4267
|
controller.enqueue({
|
|
4267
4268
|
type: "tool-result",
|
|
4268
4269
|
toolCallId: value.item.id,
|
|
4269
|
-
toolName: "mcp",
|
|
4270
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4270
4271
|
result: {
|
|
4271
4272
|
type: "call",
|
|
4272
4273
|
serverLabel: value.item.server_label,
|
|
@@ -4281,7 +4282,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4281
4282
|
controller.enqueue({
|
|
4282
4283
|
type: "tool-result",
|
|
4283
4284
|
toolCallId: value.item.id,
|
|
4284
|
-
toolName: "mcp",
|
|
4285
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4285
4286
|
result: {
|
|
4286
4287
|
type: "listTools",
|
|
4287
4288
|
serverLabel: value.item.server_label,
|
|
@@ -4302,7 +4303,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4302
4303
|
controller.enqueue({
|
|
4303
4304
|
type: "tool-result",
|
|
4304
4305
|
toolCallId: value.item.id,
|
|
4305
|
-
toolName: "mcp",
|
|
4306
|
+
toolName: toolNameMapping.toCustomToolName("mcp"),
|
|
4306
4307
|
result: {
|
|
4307
4308
|
type: "approvalRequest",
|
|
4308
4309
|
serverLabel: value.item.server_label,
|
|
@@ -4316,7 +4317,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4316
4317
|
controller.enqueue({
|
|
4317
4318
|
type: "tool-call",
|
|
4318
4319
|
toolCallId: value.item.call_id,
|
|
4319
|
-
toolName: "local_shell",
|
|
4320
|
+
toolName: toolNameMapping.toCustomToolName("local_shell"),
|
|
4320
4321
|
input: JSON.stringify({
|
|
4321
4322
|
action: {
|
|
4322
4323
|
type: "exec",
|
|
@@ -4365,7 +4366,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4365
4366
|
controller.enqueue({
|
|
4366
4367
|
type: "tool-result",
|
|
4367
4368
|
toolCallId: value.item_id,
|
|
4368
|
-
toolName: "image_generation",
|
|
4369
|
+
toolName: toolNameMapping.toCustomToolName("image_generation"),
|
|
4369
4370
|
result: {
|
|
4370
4371
|
result: value.partial_image_b64
|
|
4371
4372
|
},
|
|
@@ -4397,7 +4398,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4397
4398
|
controller.enqueue({
|
|
4398
4399
|
type: "tool-call",
|
|
4399
4400
|
toolCallId: toolCall.toolCallId,
|
|
4400
|
-
toolName: "code_interpreter",
|
|
4401
|
+
toolName: toolNameMapping.toCustomToolName("code_interpreter"),
|
|
4401
4402
|
input: JSON.stringify({
|
|
4402
4403
|
code: value.code,
|
|
4403
4404
|
containerId: toolCall.codeInterpreter.containerId
|
|
@@ -4992,7 +4993,7 @@ var OpenAITranscriptionModel = class {
|
|
|
4992
4993
|
};
|
|
4993
4994
|
|
|
4994
4995
|
// src/version.ts
|
|
4995
|
-
var VERSION = true ? "3.0.0-beta.
|
|
4996
|
+
var VERSION = true ? "3.0.0-beta.72" : "0.0.0-test";
|
|
4996
4997
|
|
|
4997
4998
|
// src/openai-provider.ts
|
|
4998
4999
|
function createOpenAI(options = {}) {
|