@molecule/api-ai-deepseek 1.0.4 → 1.0.6
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 +21 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -0
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +5 -0
- package/package.json +2 -2
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-
|
|
6
|
+
Generated: 2026-10-01T18:20:44.372Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/api-ai-deepseek
|
|
@@ -14,6 +14,26 @@ Generated: 2026-08-04T01:47:29.897Z
|
|
|
14
14
|
|
|
15
15
|
DeepSeek AI provider for molecule.dev.
|
|
16
16
|
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
// npm install @molecule/api-ai-deepseek --workspace=api
|
|
21
|
+
import { setProvider, requireProvider } from '@molecule/api-ai'
|
|
22
|
+
import { provider } from '@molecule/api-ai-deepseek'
|
|
23
|
+
|
|
24
|
+
// Named registration — several AI providers can be bonded side by side
|
|
25
|
+
// (getProviderByName('deepseek') targets this one); the FIRST one
|
|
26
|
+
// registered also answers requireProvider() (see @molecule/api-ai).
|
|
27
|
+
setProvider('deepseek', provider) // reads DEEPSEEK_API_KEY from the environment
|
|
28
|
+
|
|
29
|
+
let reply = ''
|
|
30
|
+
for await (const event of requireProvider().chat({
|
|
31
|
+
messages: [{ role: 'user', content: 'Hello!' }],
|
|
32
|
+
})) {
|
|
33
|
+
if (event.type === 'text') reply += event.content // or forward the chunk to the client (SSE)
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
17
37
|
## Type
|
|
18
38
|
|
|
19
39
|
`provider`
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DeepSeek AI provider for molecule.dev.
|
|
3
3
|
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* // npm install @molecule/api-ai-deepseek --workspace=api
|
|
7
|
+
* import { setProvider, requireProvider } from '@molecule/api-ai'
|
|
8
|
+
* import { provider } from '@molecule/api-ai-deepseek'
|
|
9
|
+
*
|
|
10
|
+
* // Named registration — several AI providers can be bonded side by side
|
|
11
|
+
* // (getProviderByName('deepseek') targets this one); the FIRST one
|
|
12
|
+
* // registered also answers requireProvider() (see @molecule/api-ai).
|
|
13
|
+
* setProvider('deepseek', provider) // reads DEEPSEEK_API_KEY from the environment
|
|
14
|
+
*
|
|
15
|
+
* let reply = ''
|
|
16
|
+
* for await (const event of requireProvider().chat({
|
|
17
|
+
* messages: [{ role: 'user', content: 'Hello!' }],
|
|
18
|
+
* })) {
|
|
19
|
+
* if (event.type === 'text') reply += event.content // or forward the chunk to the client (SSE)
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
4
23
|
* @remarks
|
|
5
24
|
* Config: `DEEPSEEK_API_KEY` (SERVER-side only) plus an optional default model id/base URL.
|
|
6
25
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAMlD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,UAUrB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DeepSeek AI provider for molecule.dev.
|
|
3
3
|
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* // npm install @molecule/api-ai-deepseek --workspace=api
|
|
7
|
+
* import { setProvider, requireProvider } from '@molecule/api-ai'
|
|
8
|
+
* import { provider } from '@molecule/api-ai-deepseek'
|
|
9
|
+
*
|
|
10
|
+
* // Named registration — several AI providers can be bonded side by side
|
|
11
|
+
* // (getProviderByName('deepseek') targets this one); the FIRST one
|
|
12
|
+
* // registered also answers requireProvider() (see @molecule/api-ai).
|
|
13
|
+
* setProvider('deepseek', provider) // reads DEEPSEEK_API_KEY from the environment
|
|
14
|
+
*
|
|
15
|
+
* let reply = ''
|
|
16
|
+
* for await (const event of requireProvider().chat({
|
|
17
|
+
* messages: [{ role: 'user', content: 'Hello!' }],
|
|
18
|
+
* })) {
|
|
19
|
+
* if (event.type === 'text') reply += event.content // or forward the chunk to the client (SSE)
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
4
23
|
* @remarks
|
|
5
24
|
* Config: `DEEPSEEK_API_KEY` (SERVER-side only) plus an optional default model id/base URL.
|
|
6
25
|
*
|
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;AAEH,OAAO,KAAK,EACV,UAAU,EAGV,SAAS,EAET,UAAU,EAEX,MAAM,kBAAkB,CAAA;AASzB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAA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AAW;IAWnB;;;;;OAKG;IACH,OAAO,CAAE,yBAAyB;IAuDlC;;;;;;OAMG;YACY,sBAAsB;IAoFrC;;;;;;;;OAQG;IACH,OAAO,CAAE,eAAe;CAkIzB;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
|
@@ -294,6 +294,11 @@ class DeepseekAIProviderImpl {
|
|
|
294
294
|
for (const tr of toolResults) {
|
|
295
295
|
formatted.push(tr);
|
|
296
296
|
}
|
|
297
|
+
// Non-tool parts of the SAME message (an image riding a tool result — the
|
|
298
|
+
// screenshot tool) must not be dropped: Chat Completions accepts a user
|
|
299
|
+
// message after the tool messages, so emit them instead of losing them.
|
|
300
|
+
if (parts.length > 0)
|
|
301
|
+
formatted.push({ role: m.role, content: parts });
|
|
297
302
|
}
|
|
298
303
|
else if (toolCalls.length > 0) {
|
|
299
304
|
// Assistant message with tool calls
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/api-ai-deepseek",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "DeepSeek AI provider for molecule.dev",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/api-ai-deepseek",
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"directory": "packages/api/bonds/ai/deepseek"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@molecule/api-ai": "1.
|
|
36
|
+
"@molecule/api-ai": "1.3.0",
|
|
37
37
|
"@molecule/api-bond": "1.0.2",
|
|
38
38
|
"@types/node": "26.1.2",
|
|
39
39
|
"typescript": "6.0.3",
|