@ai-sdk/openai 3.0.111 → 3.0.113
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 +15 -0
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +8 -0
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +8 -0
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +2 -1
- package/package.json +5 -5
- package/src/chat/openai-chat-language-model.ts +7 -0
- package/src/responses/openai-responses-language-model.ts +4 -0
package/dist/internal/index.js
CHANGED
|
@@ -1175,6 +1175,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
1175
1175
|
fetch: this.config.fetch
|
|
1176
1176
|
});
|
|
1177
1177
|
const choice = response.choices[0];
|
|
1178
|
+
if (choice == null) {
|
|
1179
|
+
throw new import_provider4.InvalidResponseDataError({
|
|
1180
|
+
data: rawResponse,
|
|
1181
|
+
message: "Response did not contain any choices."
|
|
1182
|
+
});
|
|
1183
|
+
}
|
|
1178
1184
|
const content = [];
|
|
1179
1185
|
const text = choice.message.content;
|
|
1180
1186
|
if (text != null && text.length > 0) {
|
|
@@ -6824,6 +6830,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6824
6830
|
break;
|
|
6825
6831
|
}
|
|
6826
6832
|
case "apply_patch_call": {
|
|
6833
|
+
hasFunctionCall = true;
|
|
6827
6834
|
content.push({
|
|
6828
6835
|
type: "tool-call",
|
|
6829
6836
|
toolCallId: part.call_id,
|
|
@@ -7470,6 +7477,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
7470
7477
|
toolCall.applyPatch.endEmitted = true;
|
|
7471
7478
|
}
|
|
7472
7479
|
if (toolCall && value.item.status === "completed") {
|
|
7480
|
+
hasFunctionCall = true;
|
|
7473
7481
|
controller.enqueue({
|
|
7474
7482
|
type: "tool-call",
|
|
7475
7483
|
toolCallId: toolCall.toolCallId,
|