@kevisual/ai 0.0.9 → 0.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/ai",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "AI Center Services",
5
5
  "main": "index.js",
6
6
  "basename": "/root/ai-center-services",
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
30
30
  "license": "MIT",
31
- "packageManager": "pnpm@10.14.0",
31
+ "packageManager": "pnpm@10.19.0",
32
32
  "type": "module",
33
33
  "publishConfig": {
34
34
  "registry": "https://registry.npmjs.org/",
@@ -56,34 +56,34 @@
56
56
  "devDependencies": {
57
57
  "@kevisual/code-center-module": "0.0.24",
58
58
  "@kevisual/mark": "0.0.7",
59
- "@kevisual/router": "0.0.23",
59
+ "@kevisual/router": "0.0.30",
60
60
  "@kevisual/types": "^0.0.10",
61
61
  "@kevisual/use-config": "^1.0.19",
62
- "@types/bun": "^1.2.19",
62
+ "@types/bun": "^1.3.0",
63
63
  "@types/crypto-js": "^4.2.2",
64
- "@types/formidable": "^3.4.5",
64
+ "@types/formidable": "^3.4.6",
65
65
  "@types/lodash-es": "^4.17.12",
66
- "@types/node": "^24.2.0",
66
+ "@types/node": "^24.9.1",
67
67
  "@vitejs/plugin-basic-ssl": "^2.1.0",
68
68
  "cookie": "^1.0.2",
69
- "cross-env": "^10.0.0",
69
+ "cross-env": "^10.1.0",
70
70
  "crypto-js": "^4.2.0",
71
- "dayjs": "^1.11.13",
72
- "dotenv": "^17.2.1",
71
+ "dayjs": "^1.11.18",
72
+ "dotenv": "^17.2.3",
73
73
  "formidable": "^3.5.4",
74
- "ioredis": "^5.7.0",
74
+ "ioredis": "^5.8.2",
75
75
  "json5": "^2.2.3",
76
76
  "lodash-es": "^4.17.21",
77
- "openai": "5.12.0",
78
- "pm2": "^6.0.8",
77
+ "openai": "6.6.0",
78
+ "pm2": "^6.0.13",
79
79
  "rimraf": "^6.0.1",
80
- "rollup": "^4.46.2",
81
- "rollup-plugin-dts": "^6.2.1",
80
+ "rollup": "^4.52.5",
81
+ "rollup-plugin-dts": "^6.2.3",
82
82
  "sequelize": "^6.37.7",
83
83
  "tape": "^5.9.0",
84
- "tiktoken": "^1.0.21",
85
- "typescript": "^5.9.2",
86
- "vite": "^7.1.0"
84
+ "tiktoken": "^1.0.22",
85
+ "typescript": "^5.9.3",
86
+ "vite": "^7.1.12"
87
87
  },
88
88
  "dependencies": {
89
89
  "@kevisual/logger": "^0.0.4"
@@ -2,7 +2,7 @@ import { BaseChat, BaseChatOptions } from '../core/chat.ts';
2
2
 
3
3
  export type BailianOptions = Partial<BaseChatOptions>;
4
4
  export class BailianChat extends BaseChat {
5
- static BASE_URL = 'https://bailian.aliyuncs.com/compatible-mode/v1';
5
+ static BASE_URL = 'https://dashscope.aliyuncs.com/compatible-mode/v1';
6
6
  constructor(options: BailianOptions) {
7
7
  const baseURL = options.baseURL || BailianChat.BASE_URL;
8
8
  super({ ...(options as BaseChatOptions), baseURL: baseURL });
@@ -1,6 +1,7 @@
1
1
  import { SiliconFlowKnowledge } from './knowledge-adapter/siliconflow.ts';
2
- import { KnowledgeBase, KnowledgeOptions } from './knowledge-adapter/knowledge-base.ts';
3
- import { RerankOptions } from './knowledge-adapter/siliconflow.ts';
4
- export { KnowledgeBase, KnowledgeOptions, RerankOptions };
2
+ import { KnowledgeBase, } from './knowledge-adapter/knowledge-base.ts';
3
+ export type { KnowledgeOptions } from './knowledge-adapter/knowledge-base.ts';
4
+ export type { RerankOptions } from './knowledge-adapter/siliconflow.ts';
5
+ export { KnowledgeBase, };
5
6
 
6
7
  export { SiliconFlowKnowledge };
@@ -0,0 +1,26 @@
1
+ import { BailianProvider } from '../../provider/index.ts'
2
+ import dotenv from 'dotenv';
3
+
4
+ dotenv.config();
5
+ import { App } from '@kevisual/router'
6
+ import util from 'node:util';
7
+ const ai = new BailianProvider({
8
+ apiKey: process.env.BAILIAN_API_KEY || '',
9
+ model: 'qwen-turbo-latest',
10
+ baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1'
11
+ })
12
+
13
+
14
+ const res = await ai.chat([
15
+
16
+ {
17
+ role: 'user',
18
+ content: `1+1等于多少?`
19
+ },
20
+
21
+ ],
22
+ )
23
+ console.log('AI Response:', res);
24
+ const content = res.choices[0].message?.content || ''
25
+
26
+ console.log(util.inspect(res, { depth: null }))
@@ -1,5 +1,5 @@
1
- import { SiliconFlow } from '../..//provider/chat-adapter/siliconflow.ts';
2
- import { Ollama } from '../..//provider/chat-adapter/ollama.ts';
1
+ import { SiliconFlow } from '../../provider/chat-adapter/siliconflow.ts';
2
+ import { Ollama } from '../../provider/chat-adapter/ollama.ts';
3
3
  import dotenv from 'dotenv';
4
4
 
5
5
  dotenv.config();
@@ -1,5 +1,5 @@
1
- import { ModelScope } from '../..//provider/chat-adapter/model-scope.ts';
2
- import { log } from '../..//logger/index.ts';
1
+ import { ModelScope } from '../../provider/chat-adapter/model-scope.ts';
2
+ import { logger } from '../../modules/logger.ts';
3
3
  import util from 'util';
4
4
  import { config } from 'dotenv';
5
5
  config();
@@ -14,13 +14,13 @@ const chatMessage = [{ role: 'user', content: 'Hello, world! 1 + 1 equals ?' }];
14
14
 
15
15
  const main = async () => {
16
16
  const res = await chat.test();
17
- log.info('test', res);
17
+ logger.info('test', res);
18
18
  };
19
19
 
20
20
  main();
21
21
  const mainChat = async () => {
22
22
  const res = await chat.chat(chatMessage as any);
23
- log.info('chat', res);
23
+ logger.info('chat', res);
24
24
  };
25
25
 
26
26
  // mainChat();