generated from tailored/router-template
Compare commits
2 Commits
ce7cd03cb3
...
75f1d75cae
Author | SHA1 | Date | |
---|---|---|---|
75f1d75cae | |||
0b6b2fe730 |
@ -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",
|
||||||
|
@ -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',
|
||||||
|
};
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user