明树Git Lab

Commit bb48e2fc authored by zfp1's avatar zfp1

i

parent 4a58e950
......@@ -82,7 +82,7 @@ app.post('/wechat', async (req, res) => {
// 调用DeepSeek API
async function callDeepSeekAPI(prompt) {
try {
// try {
const response = await axios.post(
'https://api.deepseek.com/v1/chat/completions',
{
......@@ -98,12 +98,12 @@ async function callDeepSeekAPI(prompt) {
timeout: 50000 // 5秒超时
}
);
console.log(response, "================================")
console.log(JSON.stringify(response.data.choices), "================================")
return response.data.choices[0].message.content.trim();
} catch (error) {
console.error('DeepSeek API Error:', error.response?.data || error.message);
return '服务暂时不可用,请稍后再试';
}
// } catch (error) {
// console.error('DeepSeek API Error:', error.response?.data || error.message);
// return '服务暂时不可用,请稍后再试';
// }
}
// 构建文本响应XML
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment