@ai-sdk/openai 2.0.137 → 2.0.138
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 +7 -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.js +8 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +8 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/internal/index.js
CHANGED
|
@@ -4479,7 +4479,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4479
4479
|
type: "tool-result",
|
|
4480
4480
|
toolCallId: part.id,
|
|
4481
4481
|
toolName: webSearchToolName != null ? webSearchToolName : "web_search",
|
|
4482
|
-
|
|
4482
|
+
...mapWebSearchResult(part),
|
|
4483
4483
|
providerExecuted: true
|
|
4484
4484
|
});
|
|
4485
4485
|
break;
|
|
@@ -4811,7 +4811,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4811
4811
|
type: "tool-result",
|
|
4812
4812
|
toolCallId: value.item.id,
|
|
4813
4813
|
toolName: webSearchToolName != null ? webSearchToolName : "web_search",
|
|
4814
|
-
|
|
4814
|
+
...mapWebSearchResult(value.item),
|
|
4815
4815
|
providerExecuted: true
|
|
4816
4816
|
});
|
|
4817
4817
|
} else if (value.item.type === "computer_call") {
|
|
@@ -5140,6 +5140,12 @@ function isResponseAnnotationAddedChunk(chunk) {
|
|
|
5140
5140
|
function isErrorChunk(chunk) {
|
|
5141
5141
|
return chunk.type === "error";
|
|
5142
5142
|
}
|
|
5143
|
+
function mapWebSearchResult({
|
|
5144
|
+
action,
|
|
5145
|
+
status
|
|
5146
|
+
}) {
|
|
5147
|
+
return status === "completed" ? { result: mapWebSearchOutput(action) } : { isError: true, result: { status } };
|
|
5148
|
+
}
|
|
5143
5149
|
function mapWebSearchOutput(action) {
|
|
5144
5150
|
var _a2;
|
|
5145
5151
|
if (action == null) {
|