@ai-sdk/openai 3.0.133 → 3.0.135
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 +14 -0
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +232 -216
- package/dist/internal/index.d.ts +232 -216
- package/dist/internal/index.js +10 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +9 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/responses/openai-responses-language-model.ts +16 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/openai",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.135",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/provider": "
|
|
40
|
-
"@ai-sdk/provider
|
|
39
|
+
"@ai-sdk/provider-utils": "4.0.63",
|
|
40
|
+
"@ai-sdk/provider": "3.0.19"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
44
44
|
"tsup": "^8",
|
|
45
45
|
"typescript": "5.8.3",
|
|
46
46
|
"zod": "3.25.76",
|
|
47
|
-
"@ai-
|
|
48
|
-
"@
|
|
47
|
+
"@vercel/ai-tsconfig": "0.0.0",
|
|
48
|
+
"@ai-sdk/test-server": "1.0.6"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"zod": "^3.25.76 || ^4.1.8"
|
|
@@ -1009,7 +1009,7 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV3 {
|
|
|
1009
1009
|
toolName: toolNameMapping.toCustomToolName(
|
|
1010
1010
|
webSearchToolName ?? 'web_search',
|
|
1011
1011
|
),
|
|
1012
|
-
|
|
1012
|
+
...mapWebSearchResult(part),
|
|
1013
1013
|
});
|
|
1014
1014
|
|
|
1015
1015
|
break;
|
|
@@ -1772,7 +1772,7 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV3 {
|
|
|
1772
1772
|
toolName: toolNameMapping.toCustomToolName(
|
|
1773
1773
|
webSearchToolName ?? 'web_search',
|
|
1774
1774
|
),
|
|
1775
|
-
|
|
1775
|
+
...mapWebSearchResult(value.item),
|
|
1776
1776
|
});
|
|
1777
1777
|
} else if (value.item.type === 'computer_call') {
|
|
1778
1778
|
ongoingToolCalls[value.output_index] = undefined;
|
|
@@ -2678,6 +2678,20 @@ function isResponseOutputChunk(chunk: OpenAIResponsesChunk): boolean {
|
|
|
2678
2678
|
);
|
|
2679
2679
|
}
|
|
2680
2680
|
|
|
2681
|
+
export function mapWebSearchResult({
|
|
2682
|
+
action,
|
|
2683
|
+
status,
|
|
2684
|
+
}: {
|
|
2685
|
+
action?: OpenAIResponsesWebSearchAction | null;
|
|
2686
|
+
status: string;
|
|
2687
|
+
}):
|
|
2688
|
+
| { isError: true; result: { status: string } }
|
|
2689
|
+
| { result: InferSchema<typeof webSearchOutputSchema> } {
|
|
2690
|
+
return status === 'completed'
|
|
2691
|
+
? { result: mapWebSearchOutput(action) }
|
|
2692
|
+
: { isError: true, result: { status } };
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2681
2695
|
function mapWebSearchOutput(
|
|
2682
2696
|
action: OpenAIResponsesWebSearchAction | null | undefined,
|
|
2683
2697
|
): InferSchema<typeof webSearchOutputSchema> {
|