generated from tailored/router-template
fix: update
This commit is contained in:
parent
ce7cd03cb3
commit
0b6b2fe730
@ -1,16 +1,28 @@
|
||||
import { SiliconFlowProvider } from '@kevisual/ai';
|
||||
import { BailianProvider } from '@kevisual/ai';
|
||||
import { config } from '../modules/config.ts';
|
||||
|
||||
export const ai = new SiliconFlowProvider({
|
||||
model: 'Qwen/Qwen3-32B',
|
||||
// model: 'Pro/deepseek-ai/DeepSeek-R1',// 只有充值能用
|
||||
apiKey: config.SILICONFLOW_API_KEY,
|
||||
});
|
||||
// export const ai = new SiliconFlowProvider({
|
||||
// model: 'Qwen/Qwen3-32B',
|
||||
// // model: 'Pro/deepseek-ai/DeepSeek-R1',// 只有充值能用
|
||||
// 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()
|
||||
.then((usage) => {
|
||||
console.log('AI usage info:', usage);
|
||||
})
|
||||
.catch((res) => {
|
||||
console.error('Error fetching AI usage info:', res.status);
|
||||
});
|
||||
export const ai = new BailianProvider({
|
||||
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
|
||||
model: 'qwen3-235b-a22b',
|
||||
apiKey: config.BAILIAN_API_KEY,
|
||||
});
|
||||
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: `
|
||||
你是一个提示词优化的专家,请根据用户提供的提示词进行修正和优化,其中用户的提示词返回的要求如果没有或者不明确,请你都修正为要求返回的文本在500字以内,且内容是纯文本格式,不能是markdown模式,也不包含任何HTML标签或其他格式化内容。
|
||||
|
||||
只对提示词进行优化,并且不需要对内容进行分析或总结。
|
||||
只对提示词进行优化,并且不需要对内容进行分析或总结。并返回修改后的总的提示词内容。
|
||||
|
||||
示例1. 用户提示词
|
||||
<content>总结笔记</content>
|
||||
@ -55,6 +55,7 @@ ${text}
|
||||
});
|
||||
|
||||
console.log('end', Date.now() - now, 'ms');
|
||||
console.log('AI response:', res);
|
||||
const ans = res.choices[0]?.message?.content || '';
|
||||
if (!ans) {
|
||||
logger.error('Empty response from AI:', res);
|
||||
|
@ -10,7 +10,7 @@ const main = async () => {
|
||||
path: 'fix',
|
||||
key: 'xhs',
|
||||
payload: {
|
||||
text: text4,
|
||||
text: text,
|
||||
},
|
||||
});
|
||||
console.log('fix xhs res', res.code, 'content', res.body);
|
||||
|
Loading…
x
Reference in New Issue
Block a user