generated from tailored/router-db-template
temp
This commit is contained in:
27
src/test/ai.ts
Normal file
27
src/test/ai.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { ProviderManager, SiliconFlowProvider } from '@kevisual/ai-center';
|
||||
import dotenv from 'dotenv';
|
||||
import util from 'node:util';
|
||||
dotenv.config();
|
||||
import { createQuestion, answer } from '@kevisual/social-prompts/xhs/answer.ts';
|
||||
const pm = new SiliconFlowProvider({
|
||||
model: 'Qwen/Qwen3-32B',
|
||||
apiKey: process.env.SILICONFLOW_API_KEY,
|
||||
});
|
||||
|
||||
const main = async () => {
|
||||
const usage = await pm.getUsageInfo();
|
||||
console.log('usage', usage);
|
||||
};
|
||||
|
||||
// main();
|
||||
const ques = async () => {
|
||||
// const msg = createQuestion('介绍一下如何安装node,在mac当中', '前端的node如何安装环境', answer);
|
||||
const msg = createQuestion('介绍一下如何安装node,在mac当中', '前端的node如何安装环境', answer);
|
||||
console.log('msg', msg);
|
||||
const res = await pm.chat(msg);
|
||||
console.log(util.inspect(res.choices, { depth: null }));
|
||||
const ans = res.choices[0].message.content;
|
||||
console.log('ans', ans, ans.length);
|
||||
};
|
||||
|
||||
ques();
|
||||
Reference in New Issue
Block a user