@ai-sdk/openai-compatible 2.0.74 → 2.0.75
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 +10 -0
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -2
- package/dist/index.mjs.map +1 -1
- package/docs/index.mdx +0 -1
- package/package.json +3 -3
- package/src/chat/openai-compatible-chat-language-model.ts +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/openai-compatible",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.75",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/provider": "3.0.
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
39
|
+
"@ai-sdk/provider": "3.0.16",
|
|
40
|
+
"@ai-sdk/provider-utils": "4.0.51"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -299,6 +299,13 @@ export class OpenAICompatibleChatLanguageModel implements LanguageModelV3 {
|
|
|
299
299
|
});
|
|
300
300
|
|
|
301
301
|
const choice = responseBody.choices[0];
|
|
302
|
+
if (choice == null) {
|
|
303
|
+
throw new InvalidResponseDataError({
|
|
304
|
+
data: rawResponse,
|
|
305
|
+
message: 'Response did not contain any choices.',
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
|
|
302
309
|
const content: Array<LanguageModelV3Content> = [];
|
|
303
310
|
|
|
304
311
|
content.push(...convertOpenAICompatibleContent(choice.message.content));
|
|
@@ -562,7 +569,7 @@ export class OpenAICompatibleChatLanguageModel implements LanguageModelV3 {
|
|
|
562
569
|
}
|
|
563
570
|
}
|
|
564
571
|
|
|
565
|
-
if (delta.tool_calls != null) {
|
|
572
|
+
if (delta.tool_calls != null && delta.tool_calls.length > 0) {
|
|
566
573
|
// end active reasoning block before tool calls start
|
|
567
574
|
if (isActiveReasoning) {
|
|
568
575
|
controller.enqueue({
|