@blocklet/pages-kit-agents 0.5.25 → 0.5.26
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/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/agent-utils.d.ts +3 -3
- package/lib/cjs/utils/agent-utils.js +10 -10
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/agent-utils.d.ts +3 -3
- package/lib/esm/utils/agent-utils.js +6 -6
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/utils/agent-utils.d.ts +3 -3
- package/package.json +7 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OpenAIChatModel } from '@aigne/
|
|
3
|
-
export declare function getModel(modelName?: string): OpenAIChatModel |
|
|
1
|
+
import { AnthropicChatModel } from '@aigne/anthropic';
|
|
2
|
+
import { OpenAIChatModel } from '@aigne/openai';
|
|
3
|
+
export declare function getModel(modelName?: string): OpenAIChatModel | AnthropicChatModel | undefined;
|
|
@@ -4,17 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getModel = getModel;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
7
|
+
const anthropic_1 = require("@aigne/anthropic");
|
|
8
|
+
const deepseek_1 = require("@aigne/deepseek");
|
|
9
|
+
const gemini_1 = require("@aigne/gemini");
|
|
10
|
+
const openai_1 = require("@aigne/openai");
|
|
11
|
+
const xai_1 = require("@aigne/xai");
|
|
12
12
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
13
13
|
const { OPENAI_API_KEY, GEMINI_API_KEY, CLAUDE_API_KEY, XAI_API_KEY, DEEPSEEK_API_KEY } = process.env;
|
|
14
14
|
function getModel(modelName = 'openai') {
|
|
15
15
|
if (modelName?.includes('gpt')) {
|
|
16
16
|
(0, node_assert_1.default)(OPENAI_API_KEY, 'Please set the OPENAI_API_KEY environment variable');
|
|
17
|
-
const openai = new
|
|
17
|
+
const openai = new openai_1.OpenAIChatModel({
|
|
18
18
|
apiKey: OPENAI_API_KEY,
|
|
19
19
|
model: modelName,
|
|
20
20
|
modelOptions: {
|
|
@@ -25,7 +25,7 @@ function getModel(modelName = 'openai') {
|
|
|
25
25
|
}
|
|
26
26
|
if (modelName?.includes('gemini')) {
|
|
27
27
|
(0, node_assert_1.default)(GEMINI_API_KEY, 'Please set the GEMINI_API_KEY environment variable');
|
|
28
|
-
const gemini = new
|
|
28
|
+
const gemini = new gemini_1.GeminiChatModel({
|
|
29
29
|
apiKey: GEMINI_API_KEY,
|
|
30
30
|
model: modelName,
|
|
31
31
|
});
|
|
@@ -33,7 +33,7 @@ function getModel(modelName = 'openai') {
|
|
|
33
33
|
}
|
|
34
34
|
if (modelName?.includes('claude')) {
|
|
35
35
|
(0, node_assert_1.default)(CLAUDE_API_KEY, 'Please set the CLAUDE_API_KEY environment variable');
|
|
36
|
-
const model = new
|
|
36
|
+
const model = new anthropic_1.AnthropicChatModel({
|
|
37
37
|
apiKey: CLAUDE_API_KEY,
|
|
38
38
|
model: modelName,
|
|
39
39
|
modelOptions: {
|
|
@@ -44,7 +44,7 @@ function getModel(modelName = 'openai') {
|
|
|
44
44
|
}
|
|
45
45
|
if (modelName?.includes('grok')) {
|
|
46
46
|
(0, node_assert_1.default)(XAI_API_KEY, 'Please set the XAI_API_KEY environment variable');
|
|
47
|
-
const grok = new
|
|
47
|
+
const grok = new xai_1.XAIChatModel({
|
|
48
48
|
apiKey: XAI_API_KEY,
|
|
49
49
|
model: modelName,
|
|
50
50
|
});
|
|
@@ -52,7 +52,7 @@ function getModel(modelName = 'openai') {
|
|
|
52
52
|
}
|
|
53
53
|
if (modelName?.includes('deepseek')) {
|
|
54
54
|
(0, node_assert_1.default)(DEEPSEEK_API_KEY, 'Please set the DEEPSEEK_API_KEY environment variable');
|
|
55
|
-
const deepseek = new
|
|
55
|
+
const deepseek = new deepseek_1.DeepSeekChatModel({
|
|
56
56
|
apiKey: DEEPSEEK_API_KEY,
|
|
57
57
|
model: modelName,
|
|
58
58
|
});
|