@celljs/ai-deepseek 3.5.1

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.
Files changed (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +96 -0
  3. package/lib/common/api/api-protocol.d.ts +5 -0
  4. package/lib/common/api/api-protocol.d.ts.map +1 -0
  5. package/lib/common/api/api-protocol.js +5 -0
  6. package/lib/common/api/api-protocol.js.map +1 -0
  7. package/lib/common/api/deepseek-api.d.ts +9 -0
  8. package/lib/common/api/deepseek-api.d.ts.map +1 -0
  9. package/lib/common/api/deepseek-api.js +41 -0
  10. package/lib/common/api/deepseek-api.js.map +1 -0
  11. package/lib/common/api/deepseek-model.d.ts +11 -0
  12. package/lib/common/api/deepseek-model.d.ts.map +1 -0
  13. package/lib/common/api/deepseek-model.js +15 -0
  14. package/lib/common/api/deepseek-model.js.map +1 -0
  15. package/lib/common/api/index.d.ts +4 -0
  16. package/lib/common/api/index.d.ts.map +1 -0
  17. package/lib/common/api/index.js +7 -0
  18. package/lib/common/api/index.js.map +1 -0
  19. package/lib/common/index.d.ts +3 -0
  20. package/lib/common/index.d.ts.map +1 -0
  21. package/lib/common/index.js +6 -0
  22. package/lib/common/index.js.map +1 -0
  23. package/lib/common/model/deepseek-chat-model.d.ts +18 -0
  24. package/lib/common/model/deepseek-chat-model.d.ts.map +1 -0
  25. package/lib/common/model/deepseek-chat-model.js +28 -0
  26. package/lib/common/model/deepseek-chat-model.js.map +1 -0
  27. package/lib/common/model/deepseek-chat-options.d.ts +7 -0
  28. package/lib/common/model/deepseek-chat-options.d.ts.map +1 -0
  29. package/lib/common/model/deepseek-chat-options.js +17 -0
  30. package/lib/common/model/deepseek-chat-options.js.map +1 -0
  31. package/lib/common/model/deepseek-embedding-model.d.ts +11 -0
  32. package/lib/common/model/deepseek-embedding-model.d.ts.map +1 -0
  33. package/lib/common/model/deepseek-embedding-model.js +24 -0
  34. package/lib/common/model/deepseek-embedding-model.js.map +1 -0
  35. package/lib/common/model/deepseek-embedding-options.d.ts +7 -0
  36. package/lib/common/model/deepseek-embedding-options.d.ts.map +1 -0
  37. package/lib/common/model/deepseek-embedding-options.js +17 -0
  38. package/lib/common/model/deepseek-embedding-options.js.map +1 -0
  39. package/lib/common/model/index.d.ts +5 -0
  40. package/lib/common/model/index.d.ts.map +1 -0
  41. package/lib/common/model/index.js +8 -0
  42. package/lib/common/model/index.js.map +1 -0
  43. package/lib/common/module.d.ts +4 -0
  44. package/lib/common/module.d.ts.map +1 -0
  45. package/lib/common/module.js +6 -0
  46. package/lib/common/module.js.map +1 -0
  47. package/lib/package.spec.d.ts +1 -0
  48. package/lib/package.spec.d.ts.map +1 -0
  49. package/lib/package.spec.js +4 -0
  50. package/lib/package.spec.js.map +1 -0
  51. package/package.json +44 -0
  52. package/src/common/api/api-protocol.ts +6 -0
  53. package/src/common/api/deepseek-api.ts +29 -0
  54. package/src/common/api/deepseek-model.ts +12 -0
  55. package/src/common/api/index.ts +3 -0
  56. package/src/common/index.ts +2 -0
  57. package/src/common/model/deepseek-chat-model.ts +25 -0
  58. package/src/common/model/deepseek-chat-options.ts +10 -0
  59. package/src/common/model/deepseek-embedding-model.ts +19 -0
  60. package/src/common/model/deepseek-embedding-options.ts +9 -0
  61. package/src/common/model/index.ts +4 -0
  62. package/src/common/module.ts +4 -0
  63. package/src/package.spec.ts +4 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Cellbang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # Cell - AI DeepSeek Component
2
+
3
+ ## 概览
4
+
5
+ AI DeepSeek 模块是一个用于与 DeepSeek API 交互的库,提供了生成聊天响应和嵌入向量的功能。通过简单易用的 API 接口,支持消息的创建、请求的发送和响应的处理。是 @celljs/ai-core 模块中所有模型服务接口抽象的一种实现。
6
+
7
+ ## 特性
8
+
9
+ - 生成聊天响应
10
+ - 生成嵌入向量
11
+ - 支持流式响应
12
+ - 支持多种模型参数配置
13
+
14
+ ## 安装
15
+
16
+ 使用 npm 安装 AI DeepSeek 模块:
17
+
18
+ ```bash
19
+ npm install @celljs/ai-deepseek
20
+ ```
21
+
22
+ 或者使用 yarn:
23
+
24
+ ```bash
25
+ yarn add @celljs/ai-deepseek
26
+ ```
27
+
28
+ ## 快速开始
29
+
30
+ 以下是一个简单的示例,展示如何使用 AI DeepSeek 模块生成聊天响应和嵌入向量:
31
+
32
+ ```typescript
33
+ import { AssistantMessage, PromptTemplate } from '@celljs/ai-core';
34
+ import { DeepSeekChatModel, DeepSeekModel, } from '@celljs/ai-deepseek';
35
+ import { Component Autowired } from '@celljs/core';
36
+
37
+ @Component()
38
+ export class DeepSeekDemo {
39
+ @Autowired(DeepSeekChatModel)
40
+ private deepSeekChatModel: DeepSeekChatModel;
41
+
42
+ @Autowired(DeepSeekEmbeddingModel)
43
+ private deepSeekEmbeddingModel: DeepSeekEmbeddingModel;
44
+
45
+ @Autowired(PromptTemplate)
46
+ private promptTemplate: PromptTemplate;
47
+
48
+ /**
49
+ * Chat with DeepSeek
50
+ */
51
+ async chat() {
52
+ const prompt = await this.promptTemplate.create(
53
+ 'Hello {name}',
54
+ {
55
+ chatOptions: { model: DeepSeekModel.DEEPSEEK_CHAT },
56
+ variables: { name: 'DeepSeek' }
57
+ }
58
+ );
59
+ const response = await this.deepSeekChatModel.call(prompt);
60
+ console.log(response.result.output);
61
+ }
62
+
63
+ /**
64
+ * Stream chat response
65
+ */
66
+ async stream() {
67
+ const prompt = await this.promptTemplate.create(
68
+ 'Hello {name}',
69
+ {
70
+ chatOptions: { model: DeepSeekModel.DEEPSEEK_CHAT },
71
+ variables: { name: 'DeepSeek' }
72
+ }
73
+ );
74
+ const response$ = await this.deepSeekChatModel.stream(prompt);
75
+ response$.subscribe({
76
+ next: response => console.log(response.result.output),
77
+ complete: () => console.log('Chat completed!')
78
+ });
79
+ }
80
+
81
+ /**
82
+ * Embed text to vector
83
+ */
84
+ async embed() {
85
+ const response = await this.deepSeekEmbeddingModel.call({
86
+ inputs: ['text to embed'],
87
+ options: { model: DeepSeekModel.XXX }
88
+ });
89
+ console.log(response.result.embeddings);
90
+ }
91
+ }
92
+ ```
93
+
94
+ ## 许可证
95
+
96
+ 本项目采用 MIT 许可证。
@@ -0,0 +1,5 @@
1
+ import { OpenAIAPIOptions } from '@celljs/ai-openai';
2
+ export declare const DeepSeekPIOptions: unique symbol;
3
+ export interface DeepSeekPIOptions extends OpenAIAPIOptions {
4
+ }
5
+ //# sourceMappingURL=api-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-protocol.d.ts","sourceRoot":"","sources":["../../../src/common/api/api-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAE7D,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;CAC1D"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeepSeekPIOptions = void 0;
4
+ exports.DeepSeekPIOptions = Symbol('DeepSeekPIOptions');
5
+ //# sourceMappingURL=api-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-protocol.js","sourceRoot":"","sources":["../../../src/common/api/api-protocol.ts"],"names":[],"mappings":";;;AAEa,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { DeepSeekPIOptions } from './api-protocol';
2
+ import { OpenAIAPIImpl } from '@celljs/ai-openai';
3
+ export declare class DeepSeekAPI extends OpenAIAPIImpl {
4
+ protected readonly apiOptions: DeepSeekPIOptions;
5
+ protected readonly apiOptions2: DeepSeekPIOptions;
6
+ protected finalApiOptions: Required<DeepSeekPIOptions>;
7
+ protected init(): void;
8
+ }
9
+ //# sourceMappingURL=deepseek-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-api.d.ts","sourceRoot":"","sources":["../../../src/common/api/deepseek-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,qBACa,WAAY,SAAQ,aAAa;IAE1C,mBAC4B,UAAU,EAAE,iBAAiB,CAAC;IAE1D,mBAE4B,WAAW,EAAE,iBAAiB,CAAC;IAE3D,UAAmB,eAAe,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;cAG7C,IAAI;CAW1B"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var DeepSeekAPI_1;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DeepSeekAPI = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const core_1 = require("@celljs/core");
7
+ const api_protocol_1 = require("./api-protocol");
8
+ const ai_openai_1 = require("@celljs/ai-openai");
9
+ let DeepSeekAPI = DeepSeekAPI_1 = class DeepSeekAPI extends ai_openai_1.OpenAIAPIImpl {
10
+ init() {
11
+ super.init();
12
+ this.finalApiOptions = {
13
+ baseUrl: 'https://api.deepseek.ai',
14
+ apiKey: '',
15
+ completionsPath: '/chat/completions',
16
+ embeddingsPath: '/embeddings',
17
+ ...this.apiOptions,
18
+ ...this.apiOptions2
19
+ };
20
+ }
21
+ };
22
+ tslib_1.__decorate([
23
+ (0, core_1.Value)('cell.ai.deepseek.api'),
24
+ tslib_1.__metadata("design:type", Object)
25
+ ], DeepSeekAPI.prototype, "apiOptions", void 0);
26
+ tslib_1.__decorate([
27
+ (0, core_1.Autowired)(api_protocol_1.DeepSeekPIOptions),
28
+ (0, core_1.Optional)(),
29
+ tslib_1.__metadata("design:type", Object)
30
+ ], DeepSeekAPI.prototype, "apiOptions2", void 0);
31
+ tslib_1.__decorate([
32
+ (0, core_1.PostConstruct)(),
33
+ tslib_1.__metadata("design:type", Function),
34
+ tslib_1.__metadata("design:paramtypes", []),
35
+ tslib_1.__metadata("design:returntype", void 0)
36
+ ], DeepSeekAPI.prototype, "init", null);
37
+ DeepSeekAPI = DeepSeekAPI_1 = tslib_1.__decorate([
38
+ (0, core_1.Component)(DeepSeekAPI_1)
39
+ ], DeepSeekAPI);
40
+ exports.DeepSeekAPI = DeepSeekAPI;
41
+ //# sourceMappingURL=deepseek-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-api.js","sourceRoot":"","sources":["../../../src/common/api/deepseek-api.ts"],"names":[],"mappings":";;;;;AAAA,uCAAoF;AACpF,iDAAmD;AACnD,iDAAkD;AAG3C,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,yBAAa;IAYvB,IAAI;QACnB,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,IAAI,CAAC,eAAe,GAAG;YACnB,OAAO,EAAE,yBAAyB;YAClC,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,mBAAmB;YACpC,cAAc,EAAE,aAAa;YAC7B,GAAG,IAAI,CAAC,UAAU;YAClB,GAAG,IAAI,CAAC,WAAW;SACtB,CAAC;IACN,CAAC;CACJ,CAAA;AArBG;IAAC,IAAA,YAAK,EAAC,sBAAsB,CAAC;;+CAC4B;AAE1D;IAAC,IAAA,gBAAS,EAAC,gCAAiB,CAAC;IAC5B,IAAA,eAAQ,GAAE;;gDACgD;AAI3D;IAAC,IAAA,oBAAa,GAAE;;;;uCAWf;AAtBQ,WAAW;IADvB,IAAA,gBAAS,EAAC,aAAW,CAAC;GACV,WAAW,CAuBvB;AAvBY,kCAAW"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * DeepSeek Chat Completion Models:
3
+ *
4
+ * - DeepSeek Chat: Chat completion model
5
+ * - DeepSeek Reasoner: Reasoning model
6
+ */
7
+ export declare enum DeepSeekModel {
8
+ DEEPSEEK_CHAT = "deepseek-chat",
9
+ DEEPSEEK_REASONER = "deepseek-reasoner"
10
+ }
11
+ //# sourceMappingURL=deepseek-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-model.d.ts","sourceRoot":"","sources":["../../../src/common/api/deepseek-model.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AACH,oBAAY,aAAa;IAErB,aAAa,kBAAkB;IAC/B,iBAAiB,sBAAsB;CAC1C"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeepSeekModel = void 0;
4
+ /**
5
+ * DeepSeek Chat Completion Models:
6
+ *
7
+ * - DeepSeek Chat: Chat completion model
8
+ * - DeepSeek Reasoner: Reasoning model
9
+ */
10
+ var DeepSeekModel;
11
+ (function (DeepSeekModel) {
12
+ DeepSeekModel["DEEPSEEK_CHAT"] = "deepseek-chat";
13
+ DeepSeekModel["DEEPSEEK_REASONER"] = "deepseek-reasoner";
14
+ })(DeepSeekModel = exports.DeepSeekModel || (exports.DeepSeekModel = {}));
15
+ //# sourceMappingURL=deepseek-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-model.js","sourceRoot":"","sources":["../../../src/common/api/deepseek-model.ts"],"names":[],"mappings":";;;AACA;;;;;GAKG;AACH,IAAY,aAIX;AAJD,WAAY,aAAa;IAErB,gDAA+B,CAAA;IAC/B,wDAAuC,CAAA;AAC3C,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB"}
@@ -0,0 +1,4 @@
1
+ export * from './api-protocol';
2
+ export * from './deepseek-api';
3
+ export * from './deepseek-model';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./api-protocol"), exports);
5
+ tslib_1.__exportStar(require("./deepseek-api"), exports);
6
+ tslib_1.__exportStar(require("./deepseek-model"), exports);
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/api/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,yDAA+B;AAC/B,2DAAiC"}
@@ -0,0 +1,3 @@
1
+ export * from './api';
2
+ export * from './model';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./api"), exports);
5
+ tslib_1.__exportStar(require("./model"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB;AACtB,kDAAwB"}
@@ -0,0 +1,18 @@
1
+ import { DeepSeekAPI } from '../api';
2
+ import { OpenAIChatModel } from '@celljs/ai-openai';
3
+ import { DeepSeekChatOptions } from './deepseek-chat-options';
4
+ /**
5
+ * {@link ChatModel} implementation for {@literal DeepSeek} AI.
6
+ * backed by {@link DeepSeekAPI}.
7
+ */
8
+ export declare class DeepSeekChatModel extends OpenAIChatModel {
9
+ /**
10
+ * The default options used for the chat completion requests.
11
+ */
12
+ protected readonly defaultOptions: DeepSeekChatOptions;
13
+ /**
14
+ * Low-level access to the OpenAI API.
15
+ */
16
+ protected readonly chatApi: DeepSeekAPI;
17
+ }
18
+ //# sourceMappingURL=deepseek-chat-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-chat-model.d.ts","sourceRoot":"","sources":["../../../src/common/model/deepseek-chat-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;GAGG;AACH,qBACa,iBAAkB,SAAQ,eAAe;IAElD;;OAEG;IACH,mBAC4B,cAAc,EAAE,mBAAmB,CAAC;IAEhE;;OAEG;IACH,mBAC4B,OAAO,EAAE,WAAW,CAAC;CACpD"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeepSeekChatModel = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const ai_core_1 = require("@celljs/ai-core");
6
+ const api_1 = require("../api");
7
+ const core_1 = require("@celljs/core");
8
+ const ai_openai_1 = require("@celljs/ai-openai");
9
+ const deepseek_chat_options_1 = require("./deepseek-chat-options");
10
+ /**
11
+ * {@link ChatModel} implementation for {@literal DeepSeek} AI.
12
+ * backed by {@link DeepSeekAPI}.
13
+ */
14
+ let DeepSeekChatModel = class DeepSeekChatModel extends ai_openai_1.OpenAIChatModel {
15
+ };
16
+ tslib_1.__decorate([
17
+ (0, core_1.Autowired)(deepseek_chat_options_1.DeepSeekChatOptions),
18
+ tslib_1.__metadata("design:type", deepseek_chat_options_1.DeepSeekChatOptions)
19
+ ], DeepSeekChatModel.prototype, "defaultOptions", void 0);
20
+ tslib_1.__decorate([
21
+ (0, core_1.Autowired)(api_1.DeepSeekAPI),
22
+ tslib_1.__metadata("design:type", api_1.DeepSeekAPI)
23
+ ], DeepSeekChatModel.prototype, "chatApi", void 0);
24
+ DeepSeekChatModel = tslib_1.__decorate([
25
+ (0, core_1.Component)(ai_core_1.ChatModel)
26
+ ], DeepSeekChatModel);
27
+ exports.DeepSeekChatModel = DeepSeekChatModel;
28
+ //# sourceMappingURL=deepseek-chat-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-chat-model.js","sourceRoot":"","sources":["../../../src/common/model/deepseek-chat-model.ts"],"names":[],"mappings":";;;;AAAA,6CAA4C;AAC5C,gCAAqC;AACrC,uCAAoD;AACpD,iDAAoD;AACpD,mEAA8D;AAE9D;;;GAGG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,2BAAe;CAarD,CAAA;AARG;IAAC,IAAA,gBAAS,EAAC,2CAAmB,CAAC;sCACa,2CAAmB;yDAAC;AAKhE;IAAC,IAAA,gBAAS,EAAC,iBAAW,CAAC;sCACc,iBAAW;kDAAC;AAZxC,iBAAiB;IAD7B,IAAA,gBAAS,EAAC,mBAAS,CAAC;GACR,iBAAiB,CAa7B;AAbY,8CAAiB"}
@@ -0,0 +1,7 @@
1
+ import { OpenAIChatOptions } from '@celljs/ai-openai';
2
+ /**
3
+ * Options for the DeepSeek Chat API.
4
+ */
5
+ export declare class DeepSeekChatOptions extends OpenAIChatOptions {
6
+ }
7
+ //# sourceMappingURL=deepseek-chat-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-chat-options.d.ts","sourceRoot":"","sources":["../../../src/common/model/deepseek-chat-options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;GAEG;AACH,qBACa,mBAAoB,SAAQ,iBAAiB;CAEzD"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var DeepSeekChatOptions_1;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DeepSeekChatOptions = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const core_1 = require("@celljs/core");
7
+ const ai_openai_1 = require("@celljs/ai-openai");
8
+ /**
9
+ * Options for the DeepSeek Chat API.
10
+ */
11
+ let DeepSeekChatOptions = DeepSeekChatOptions_1 = class DeepSeekChatOptions extends ai_openai_1.OpenAIChatOptions {
12
+ };
13
+ DeepSeekChatOptions = DeepSeekChatOptions_1 = tslib_1.__decorate([
14
+ (0, core_1.Constant)(DeepSeekChatOptions_1, new DeepSeekChatOptions_1())
15
+ ], DeepSeekChatOptions);
16
+ exports.DeepSeekChatOptions = DeepSeekChatOptions;
17
+ //# sourceMappingURL=deepseek-chat-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-chat-options.js","sourceRoot":"","sources":["../../../src/common/model/deepseek-chat-options.ts"],"names":[],"mappings":";;;;;AAAA,uCAAwC;AACxC,iDAAsD;AAEtD;;GAEG;AAEI,IAAM,mBAAmB,2BAAzB,MAAM,mBAAoB,SAAQ,6BAAiB;CAEzD,CAAA;AAFY,mBAAmB;IAD/B,IAAA,eAAQ,EAAC,qBAAmB,EAAE,IAAI,qBAAmB,EAAE,CAAC;GAC5C,mBAAmB,CAE/B;AAFY,kDAAmB"}
@@ -0,0 +1,11 @@
1
+ import { DeepSeekAPI } from '../api';
2
+ import { DeepSeekEmbeddingOptions } from './deepseek-embedding-options';
3
+ import { OpenAIEmbeddingModel } from '@celljs/ai-openai';
4
+ export declare class DeepSeekEmbeddingModel extends OpenAIEmbeddingModel {
5
+ protected readonly defaultOptions: DeepSeekEmbeddingOptions;
6
+ /**
7
+ * Low-level access to the DeepSeek API.
8
+ */
9
+ protected readonly chatApi: DeepSeekAPI;
10
+ }
11
+ //# sourceMappingURL=deepseek-embedding-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-embedding-model.d.ts","sourceRoot":"","sources":["../../../src/common/model/deepseek-embedding-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,qBACa,sBAAuB,SAAQ,oBAAoB;IAE5D,mBAC4B,cAAc,EAAE,wBAAwB,CAAC;IAErE;;OAEG;IACH,mBAC4B,OAAO,EAAE,WAAW,CAAC;CAEpD"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeepSeekEmbeddingModel = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const ai_core_1 = require("@celljs/ai-core");
6
+ const api_1 = require("../api");
7
+ const core_1 = require("@celljs/core");
8
+ const deepseek_embedding_options_1 = require("./deepseek-embedding-options");
9
+ const ai_openai_1 = require("@celljs/ai-openai");
10
+ let DeepSeekEmbeddingModel = class DeepSeekEmbeddingModel extends ai_openai_1.OpenAIEmbeddingModel {
11
+ };
12
+ tslib_1.__decorate([
13
+ (0, core_1.Autowired)(deepseek_embedding_options_1.DeepSeekEmbeddingOptions),
14
+ tslib_1.__metadata("design:type", deepseek_embedding_options_1.DeepSeekEmbeddingOptions)
15
+ ], DeepSeekEmbeddingModel.prototype, "defaultOptions", void 0);
16
+ tslib_1.__decorate([
17
+ (0, core_1.Autowired)(api_1.DeepSeekAPI),
18
+ tslib_1.__metadata("design:type", api_1.DeepSeekAPI)
19
+ ], DeepSeekEmbeddingModel.prototype, "chatApi", void 0);
20
+ DeepSeekEmbeddingModel = tslib_1.__decorate([
21
+ (0, core_1.Component)(ai_core_1.EmbeddingModel)
22
+ ], DeepSeekEmbeddingModel);
23
+ exports.DeepSeekEmbeddingModel = DeepSeekEmbeddingModel;
24
+ //# sourceMappingURL=deepseek-embedding-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-embedding-model.js","sourceRoot":"","sources":["../../../src/common/model/deepseek-embedding-model.ts"],"names":[],"mappings":";;;;AAAA,6CAAiD;AACjD,gCAAqC;AACrC,uCAAoD;AACpD,6EAAwE;AACxE,iDAAyD;AAGlD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,gCAAoB;CAW/D,CAAA;AATG;IAAC,IAAA,gBAAS,EAAC,qDAAwB,CAAC;sCACQ,qDAAwB;8DAAC;AAKrE;IAAC,IAAA,gBAAS,EAAC,iBAAW,CAAC;sCACc,iBAAW;uDAAC;AATxC,sBAAsB;IADlC,IAAA,gBAAS,EAAC,wBAAc,CAAC;GACb,sBAAsB,CAWlC;AAXY,wDAAsB"}
@@ -0,0 +1,7 @@
1
+ import { OpenAIEmbeddingOptions } from '@celljs/ai-openai';
2
+ /**
3
+ * DeepSeek Embedding Options.
4
+ */
5
+ export declare class DeepSeekEmbeddingOptions extends OpenAIEmbeddingOptions {
6
+ }
7
+ //# sourceMappingURL=deepseek-embedding-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-embedding-options.d.ts","sourceRoot":"","sources":["../../../src/common/model/deepseek-embedding-options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;GAEG;AACH,qBACa,wBAAyB,SAAQ,sBAAsB;CACnE"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var DeepSeekEmbeddingOptions_1;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DeepSeekEmbeddingOptions = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const core_1 = require("@celljs/core");
7
+ const ai_openai_1 = require("@celljs/ai-openai");
8
+ /**
9
+ * DeepSeek Embedding Options.
10
+ */
11
+ let DeepSeekEmbeddingOptions = DeepSeekEmbeddingOptions_1 = class DeepSeekEmbeddingOptions extends ai_openai_1.OpenAIEmbeddingOptions {
12
+ };
13
+ DeepSeekEmbeddingOptions = DeepSeekEmbeddingOptions_1 = tslib_1.__decorate([
14
+ (0, core_1.Constant)(DeepSeekEmbeddingOptions_1, new DeepSeekEmbeddingOptions_1())
15
+ ], DeepSeekEmbeddingOptions);
16
+ exports.DeepSeekEmbeddingOptions = DeepSeekEmbeddingOptions;
17
+ //# sourceMappingURL=deepseek-embedding-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-embedding-options.js","sourceRoot":"","sources":["../../../src/common/model/deepseek-embedding-options.ts"],"names":[],"mappings":";;;;;AAAA,uCAAwC;AACxC,iDAA2D;AAE3D;;GAEG;AAEI,IAAM,wBAAwB,gCAA9B,MAAM,wBAAyB,SAAQ,kCAAsB;CACnE,CAAA;AADY,wBAAwB;IADpC,IAAA,eAAQ,EAAC,0BAAwB,EAAE,IAAI,0BAAwB,EAAE,CAAC;GACtD,wBAAwB,CACpC;AADY,4DAAwB"}
@@ -0,0 +1,5 @@
1
+ export * from './deepseek-chat-model';
2
+ export * from './deepseek-chat-options';
3
+ export * from './deepseek-embedding-model';
4
+ export * from './deepseek-embedding-options';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./deepseek-chat-model"), exports);
5
+ tslib_1.__exportStar(require("./deepseek-chat-options"), exports);
6
+ tslib_1.__exportStar(require("./deepseek-embedding-model"), exports);
7
+ tslib_1.__exportStar(require("./deepseek-embedding-options"), exports);
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/model/index.ts"],"names":[],"mappings":";;;AAAA,gEAAsC;AACtC,kEAAwC;AACxC,qEAA2C;AAC3C,uEAA6C"}
@@ -0,0 +1,4 @@
1
+ import './index';
2
+ declare const _default: import("inversify/lib/interfaces/interfaces").interfaces.ContainerModule;
3
+ export default _default;
4
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/common/module.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,CAAC;;AAEjB,wBAA0B"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@celljs/core");
4
+ require("./index");
5
+ exports.default = (0, core_1.autoBind)();
6
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/common/module.ts"],"names":[],"mappings":";;AAAA,uCAAwC;AACxC,mBAAiB;AAEjB,kBAAe,IAAA,eAAQ,GAAE,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=package.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.spec.d.ts","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ describe('ai-deepseek package', () => {
2
+ it('support ai-deepseek coverage statistics', () => { });
3
+ });
4
+ //# sourceMappingURL=package.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IAEjC,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@celljs/ai-deepseek",
3
+ "version": "3.5.1",
4
+ "description": "DeepSeek models support",
5
+ "main": "lib/common/index.js",
6
+ "typings": "lib/common/index.d.ts",
7
+ "dependencies": {
8
+ "@celljs/ai-core": "3.5.1",
9
+ "@celljs/ai-openai": "3.5.1",
10
+ "@celljs/core": "3.5.1",
11
+ "tslib": "^2.8.0"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "keywords": [
17
+ "cell-component"
18
+ ],
19
+ "license": "MIT",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/cellbang/cell.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/cellbang/cell/issues"
26
+ },
27
+ "homepage": "https://github.com/cellbang/cell",
28
+ "files": [
29
+ "lib",
30
+ "src",
31
+ "cell.yml"
32
+ ],
33
+ "scripts": {
34
+ "lint": "cell-component lint",
35
+ "build": "cell-component build",
36
+ "watch": "cell-component watch",
37
+ "clean": "cell-component clean",
38
+ "test": "cell-component test:js"
39
+ },
40
+ "devDependencies": {
41
+ "@celljs/component": "3.5.1"
42
+ },
43
+ "gitHead": "ed90939e4770c2f6d18bdd1721ffc58a25828777"
44
+ }
@@ -0,0 +1,6 @@
1
+ import { OpenAIAPIOptions } from '@celljs/ai-openai';
2
+
3
+ export const DeepSeekPIOptions = Symbol('DeepSeekPIOptions');
4
+
5
+ export interface DeepSeekPIOptions extends OpenAIAPIOptions {
6
+ }
@@ -0,0 +1,29 @@
1
+ import { Autowired, Component, Optional, PostConstruct, Value } from '@celljs/core';
2
+ import { DeepSeekPIOptions } from './api-protocol';
3
+ import { OpenAIAPIImpl } from '@celljs/ai-openai';
4
+
5
+ @Component(DeepSeekAPI)
6
+ export class DeepSeekAPI extends OpenAIAPIImpl {
7
+
8
+ @Value('cell.ai.deepseek.api')
9
+ protected override readonly apiOptions: DeepSeekPIOptions;
10
+
11
+ @Autowired(DeepSeekPIOptions)
12
+ @Optional()
13
+ protected override readonly apiOptions2: DeepSeekPIOptions;
14
+
15
+ protected override finalApiOptions: Required<DeepSeekPIOptions>;
16
+
17
+ @PostConstruct()
18
+ protected override init() {
19
+ super.init();
20
+ this.finalApiOptions = {
21
+ baseUrl: 'https://api.deepseek.ai',
22
+ apiKey: '',
23
+ completionsPath: '/chat/completions',
24
+ embeddingsPath: '/embeddings',
25
+ ...this.apiOptions,
26
+ ...this.apiOptions2
27
+ };
28
+ }
29
+ }
@@ -0,0 +1,12 @@
1
+
2
+ /**
3
+ * DeepSeek Chat Completion Models:
4
+ *
5
+ * - DeepSeek Chat: Chat completion model
6
+ * - DeepSeek Reasoner: Reasoning model
7
+ */
8
+ export enum DeepSeekModel {
9
+
10
+ DEEPSEEK_CHAT = 'deepseek-chat',
11
+ DEEPSEEK_REASONER = 'deepseek-reasoner'
12
+ }
@@ -0,0 +1,3 @@
1
+ export * from './api-protocol';
2
+ export * from './deepseek-api';
3
+ export * from './deepseek-model';
@@ -0,0 +1,2 @@
1
+ export * from './api';
2
+ export * from './model';
@@ -0,0 +1,25 @@
1
+ import { ChatModel } from '@celljs/ai-core';
2
+ import { DeepSeekAPI } from '../api';
3
+ import { Autowired, Component } from '@celljs/core';
4
+ import { OpenAIChatModel } from '@celljs/ai-openai';
5
+ import { DeepSeekChatOptions } from './deepseek-chat-options';
6
+
7
+ /**
8
+ * {@link ChatModel} implementation for {@literal DeepSeek} AI.
9
+ * backed by {@link DeepSeekAPI}.
10
+ */
11
+ @Component(ChatModel)
12
+ export class DeepSeekChatModel extends OpenAIChatModel {
13
+
14
+ /**
15
+ * The default options used for the chat completion requests.
16
+ */
17
+ @Autowired(DeepSeekChatOptions)
18
+ protected override readonly defaultOptions: DeepSeekChatOptions;
19
+
20
+ /**
21
+ * Low-level access to the OpenAI API.
22
+ */
23
+ @Autowired(DeepSeekAPI)
24
+ protected override readonly chatApi: DeepSeekAPI;
25
+ }
@@ -0,0 +1,10 @@
1
+ import { Constant } from '@celljs/core';
2
+ import { OpenAIChatOptions } from '@celljs/ai-openai';
3
+
4
+ /**
5
+ * Options for the DeepSeek Chat API.
6
+ */
7
+ @Constant(DeepSeekChatOptions, new DeepSeekChatOptions())
8
+ export class DeepSeekChatOptions extends OpenAIChatOptions {
9
+
10
+ }
@@ -0,0 +1,19 @@
1
+ import { EmbeddingModel } from '@celljs/ai-core';
2
+ import { DeepSeekAPI } from '../api';
3
+ import { Autowired, Component } from '@celljs/core';
4
+ import { DeepSeekEmbeddingOptions } from './deepseek-embedding-options';
5
+ import { OpenAIEmbeddingModel } from '@celljs/ai-openai';
6
+
7
+ @Component(EmbeddingModel)
8
+ export class DeepSeekEmbeddingModel extends OpenAIEmbeddingModel {
9
+
10
+ @Autowired(DeepSeekEmbeddingOptions)
11
+ protected override readonly defaultOptions: DeepSeekEmbeddingOptions;
12
+
13
+ /**
14
+ * Low-level access to the DeepSeek API.
15
+ */
16
+ @Autowired(DeepSeekAPI)
17
+ protected override readonly chatApi: DeepSeekAPI;
18
+
19
+ }
@@ -0,0 +1,9 @@
1
+ import { Constant } from '@celljs/core';
2
+ import { OpenAIEmbeddingOptions } from '@celljs/ai-openai';
3
+
4
+ /**
5
+ * DeepSeek Embedding Options.
6
+ */
7
+ @Constant(DeepSeekEmbeddingOptions, new DeepSeekEmbeddingOptions())
8
+ export class DeepSeekEmbeddingOptions extends OpenAIEmbeddingOptions {
9
+ }
@@ -0,0 +1,4 @@
1
+ export * from './deepseek-chat-model';
2
+ export * from './deepseek-chat-options';
3
+ export * from './deepseek-embedding-model';
4
+ export * from './deepseek-embedding-options';
@@ -0,0 +1,4 @@
1
+ import { autoBind } from '@celljs/core';
2
+ import './index';
3
+
4
+ export default autoBind();
@@ -0,0 +1,4 @@
1
+ describe('ai-deepseek package', () => {
2
+
3
+ it('support ai-deepseek coverage statistics', () => {});
4
+ });