@molecule/api-ai-deepseek 1.2.1 → 1.2.3
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/README.md +2 -2
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +21 -11
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-13T19:22:12.730Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/api-ai-deepseek
|
|
@@ -206,7 +206,7 @@ export function setupAiDeepseek(): void {
|
|
|
206
206
|
|
|
207
207
|
Peer dependencies:
|
|
208
208
|
|
|
209
|
-
- `@molecule/api-ai` ^1.0
|
|
209
|
+
- `@molecule/api-ai` ^1.6.0
|
|
210
210
|
- `@molecule/api-bond` ^1.0.1
|
|
211
211
|
- `@molecule/api-i18n` ^1.0.1
|
|
212
212
|
- `@molecule/api-secrets` ^1.0.1
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EACV,UAAU,EAIV,SAAS,EAET,UAAU,EAEV,cAAc,EACd,uBAAuB,EAGxB,MAAM,kBAAkB,CAAA;AASzB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;G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AO,CAAE,eAAe;CA8OzB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,+BAAyB,CAAA;AAExD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,UAAU,CAElE"}
|
package/dist/provider.js
CHANGED
|
@@ -970,11 +970,13 @@ class DeepseekAIProviderImpl {
|
|
|
970
970
|
logger.warn('DeepSeek response did not complete', { finishReason });
|
|
971
971
|
yield {
|
|
972
972
|
type: 'error',
|
|
973
|
-
message:
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
973
|
+
message: finishReason === 'length'
|
|
974
|
+
? t('ai.error.responseTokenLimit', undefined, {
|
|
975
|
+
defaultValue: 'AI response reached the output token limit before completion.',
|
|
976
|
+
})
|
|
977
|
+
: t('ai.error.responseIncomplete', undefined, {
|
|
978
|
+
defaultValue: 'AI response ended before completion. Please try again.',
|
|
979
|
+
}),
|
|
978
980
|
errorKey: 'ai.error.apiError',
|
|
979
981
|
};
|
|
980
982
|
return;
|
|
@@ -1031,9 +1033,11 @@ class DeepseekAIProviderImpl {
|
|
|
1031
1033
|
*/
|
|
1032
1034
|
parseUsage(usage) {
|
|
1033
1035
|
const cached = usage.prompt_cache_hit_tokens ?? usage.prompt_tokens_details?.cached_tokens ?? 0;
|
|
1036
|
+
const reasoning = usage.completion_tokens_details?.reasoning_tokens;
|
|
1034
1037
|
return {
|
|
1035
1038
|
inputTokens: usage.prompt_cache_miss_tokens ?? Math.max(0, (usage.prompt_tokens ?? 0) - cached),
|
|
1036
1039
|
outputTokens: usage.completion_tokens ?? 0,
|
|
1040
|
+
...(typeof reasoning === 'number' ? { reasoningOutputTokens: reasoning } : {}),
|
|
1037
1041
|
cacheReadInputTokens: cached,
|
|
1038
1042
|
};
|
|
1039
1043
|
}
|
|
@@ -1129,7 +1133,7 @@ class DeepseekAIProviderImpl {
|
|
|
1129
1133
|
});
|
|
1130
1134
|
yield {
|
|
1131
1135
|
type: 'error',
|
|
1132
|
-
message: t('ai.error.
|
|
1136
|
+
message: t('ai.error.responseIncomplete', undefined, {
|
|
1133
1137
|
defaultValue: 'AI response ended before completion. Please try again.',
|
|
1134
1138
|
}),
|
|
1135
1139
|
errorKey: 'ai.error.apiError',
|
|
@@ -1247,6 +1251,10 @@ class DeepseekAIProviderImpl {
|
|
|
1247
1251
|
state.usage = {
|
|
1248
1252
|
...state.usage,
|
|
1249
1253
|
...usage,
|
|
1254
|
+
completion_tokens_details: {
|
|
1255
|
+
...state.usage.completion_tokens_details,
|
|
1256
|
+
...usage.completion_tokens_details,
|
|
1257
|
+
},
|
|
1250
1258
|
prompt_tokens_details: {
|
|
1251
1259
|
...state.usage.prompt_tokens_details,
|
|
1252
1260
|
...usage.prompt_tokens_details,
|
|
@@ -1313,11 +1321,13 @@ class DeepseekAIProviderImpl {
|
|
|
1313
1321
|
});
|
|
1314
1322
|
yield {
|
|
1315
1323
|
type: 'error',
|
|
1316
|
-
message:
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1324
|
+
message: finishReason === 'length'
|
|
1325
|
+
? t('ai.error.responseTokenLimit', undefined, {
|
|
1326
|
+
defaultValue: 'AI response reached the output token limit before completion.',
|
|
1327
|
+
})
|
|
1328
|
+
: t('ai.error.responseIncomplete', undefined, {
|
|
1329
|
+
defaultValue: 'AI response ended before completion. Please try again.',
|
|
1330
|
+
}),
|
|
1321
1331
|
errorKey: 'ai.error.apiError',
|
|
1322
1332
|
};
|
|
1323
1333
|
return;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/api-ai-deepseek",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "DeepSeek AI provider
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"description": "DeepSeek AI chat provider bond — DeepSeek API completions over the swappable @molecule/api-ai ai bond (DEEPSEEK_API_KEY), with bounded stream-stall timeouts",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/api-ai-deepseek",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"directory": "packages/api/bonds/ai/deepseek"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@molecule/api-ai": "1.6.
|
|
36
|
+
"@molecule/api-ai": "1.6.1",
|
|
37
37
|
"@molecule/api-bond": "1.0.4",
|
|
38
38
|
"@types/node": "26.6.5",
|
|
39
39
|
"typescript": "6.0.3",
|
|
40
40
|
"vitest": "4.1.12"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@molecule/api-ai": "^1.0
|
|
43
|
+
"@molecule/api-ai": "^1.6.0",
|
|
44
44
|
"@molecule/api-bond": "^1.0.1",
|
|
45
45
|
"@molecule/api-i18n": "^1.0.1",
|
|
46
46
|
"@molecule/api-secrets": "^1.0.1"
|