2025-06-21 11:09:58 +08:00

28 lines
939 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ProviderManager, SiliconFlowProvider } from '@kevisual/ai';
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();