Compare commits

...

2 Commits

Author SHA1 Message Date
75f1d75cae add server 2025-06-21 16:48:10 +08:00
0b6b2fe730 fix: update 2025-06-21 16:47:33 +08:00
4 changed files with 29 additions and 15 deletions

View File

@@ -15,6 +15,7 @@
"scripts": { "scripts": {
"dev": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 bun --watch src/dev.ts ", "dev": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 bun --watch src/dev.ts ",
"worker": "bun --watch src/task/worker.ts", "worker": "bun --watch src/task/worker.ts",
"worker:server": "bun src/task/worker.ts",
"build": "rimraf dist && bun run bun.config.mjs", "build": "rimraf dist && bun run bun.config.mjs",
"test": "tsx test/**/*.ts", "test": "tsx test/**/*.ts",
"clean": "rm -rf dist", "clean": "rm -rf dist",

View File

@@ -1,16 +1,28 @@
import { SiliconFlowProvider } from '@kevisual/ai'; import { BailianProvider } from '@kevisual/ai';
import { config } from '../modules/config.ts'; import { config } from '../modules/config.ts';
export const ai = new SiliconFlowProvider({ // export const ai = new SiliconFlowProvider({
model: 'Qwen/Qwen3-32B', // model: 'Qwen/Qwen3-32B',
// model: 'Pro/deepseek-ai/DeepSeek-R1',// 只有充值能用 // // model: 'Pro/deepseek-ai/DeepSeek-R1',// 只有充值能用
apiKey: config.SILICONFLOW_API_KEY, // apiKey: config.SILICONFLOW_API_KEY,
}); // });
// ai.getUsageInfo()
// .then((usage) => {
// console.log('AI usage info:', usage);
// })
// .catch((res) => {
// console.error('Error fetching AI usage info:', res.status);
// });
ai.getUsageInfo() export const ai = new BailianProvider({
.then((usage) => { baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
console.log('AI usage info:', usage); model: 'qwen3-235b-a22b',
}) apiKey: config.BAILIAN_API_KEY,
.catch((res) => { });
console.error('Error fetching AI usage info:', res.status); console.log('Bailian AI initialized with model:', config.BAILIAN_API_KEY);
});
export const bailianModel = {
turbo: 'qwen-turbo-2025-04-28',
plus: 'qwen-plus-2025-04-28',
a22b235: 'qwen3-235b-a22b',
};

View File

@@ -24,7 +24,7 @@ agent
content: ` content: `
你是一个提示词优化的专家请根据用户提供的提示词进行修正和优化其中用户的提示词返回的要求如果没有或者不明确请你都修正为要求返回的文本在500字以内且内容是纯文本格式不能是markdown模式也不包含任何HTML标签或其他格式化内容。 你是一个提示词优化的专家请根据用户提供的提示词进行修正和优化其中用户的提示词返回的要求如果没有或者不明确请你都修正为要求返回的文本在500字以内且内容是纯文本格式不能是markdown模式也不包含任何HTML标签或其他格式化内容。
只对提示词进行优化,并且不需要对内容进行分析或总结。 只对提示词进行优化,并且不需要对内容进行分析或总结。并返回修改后的总的提示词内容。
示例1. 用户提示词 示例1. 用户提示词
<content>总结笔记</content> <content>总结笔记</content>
@@ -55,6 +55,7 @@ ${text}
}); });
console.log('end', Date.now() - now, 'ms'); console.log('end', Date.now() - now, 'ms');
console.log('AI response:', res);
const ans = res.choices[0]?.message?.content || ''; const ans = res.choices[0]?.message?.content || '';
if (!ans) { if (!ans) {
logger.error('Empty response from AI:', res); logger.error('Empty response from AI:', res);

View File

@@ -10,7 +10,7 @@ const main = async () => {
path: 'fix', path: 'fix',
key: 'xhs', key: 'xhs',
payload: { payload: {
text: text4, text: text,
}, },
}); });
console.log('fix xhs res', res.code, 'content', res.body); console.log('fix xhs res', res.code, 'content', res.body);