@ai-sdk/deepseek 3.0.48 → 3.0.50
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 +16 -0
- package/dist/index.js +87 -15
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +86 -14
- package/dist/internal/index.js.map +1 -1
- package/package.json +2 -2
- package/src/chat/convert-to-deepseek-chat-messages.ts +107 -18
- package/src/chat/deepseek-chat-api-types.ts +1 -1
- package/src/chat/deepseek-chat-language-model.ts +18 -10
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import {
|
|
2
|
+
InvalidResponseDataError,
|
|
3
|
+
type APICallError,
|
|
4
|
+
type LanguageModelV4,
|
|
5
|
+
type LanguageModelV4CallOptions,
|
|
6
|
+
type LanguageModelV4Content,
|
|
7
|
+
type LanguageModelV4FinishReason,
|
|
8
|
+
type LanguageModelV4GenerateResult,
|
|
9
|
+
type LanguageModelV4StreamPart,
|
|
10
|
+
type LanguageModelV4StreamResult,
|
|
11
|
+
type SharedV4Warning,
|
|
11
12
|
} from '@ai-sdk/provider';
|
|
12
13
|
import {
|
|
13
14
|
combineHeaders,
|
|
@@ -434,6 +435,13 @@ export class DeepSeekChatLanguageModel implements LanguageModelV4 {
|
|
|
434
435
|
});
|
|
435
436
|
|
|
436
437
|
const choice = responseBody.choices[0];
|
|
438
|
+
if (choice == null) {
|
|
439
|
+
throw new InvalidResponseDataError({
|
|
440
|
+
data: rawResponse,
|
|
441
|
+
message: 'Response did not contain any choices.',
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
|
|
437
445
|
const content: Array<LanguageModelV4Content> = [];
|
|
438
446
|
|
|
439
447
|
// reasoning content (before text):
|