提交 be506624 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 80359e14
...@@ -24,7 +24,7 @@ export function useAI() { ...@@ -24,7 +24,7 @@ export function useAI() {
await yiyan(data) await yiyan(data)
break break
case 'deepseek': case 'deepseek':
await deepseek(data) await siliconflow(data)
break break
case 'qwen': case 'qwen':
await qwen(data) await qwen(data)
...@@ -81,6 +81,24 @@ export function useAI() { ...@@ -81,6 +81,24 @@ export function useAI() {
} }
} }
// 硅基流动
async function siliconflow(data) {
const apiKey = 'sk-bivnwauskdbvpspvmdorrgkrpwlyfxbfcezqsfsevowzubdj'
const resp = await axios.post(
'/api/siliconflow/v1/chat/completions',
{
model: 'deepseek-ai/DeepSeek-V3',
messages: [{ role: 'user', content: data.content }],
},
{
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${apiKey}` },
}
)
if (resp.data) {
const [choice = {}] = resp.data.choices
messages.value.push({ role: 'assistant', content: choice.message.content.replaceAll('\n', '<br/>') })
}
}
// 通义千问 // 通义千问
async function qwen(data) { async function qwen(data) {
const apiKey = 'sk-afd0fcdb53bf4058b2068b8548820150' const apiKey = 'sk-afd0fcdb53bf4058b2068b8548820150'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论