明树Git Lab

Commit 28506bce authored by zfp1's avatar zfp1

update

parent 6d7b69a1
......@@ -35,14 +35,14 @@ app.post('/wechat', async (req, res) => {
const completion = await openai.chat.completions.create({
model: "deepseek-chat",
messages: [
{ role: "system", content: "你是一个微信服务号智能助手, 限制你的字符输出要低于2048个字节。" }, {
{ role: "system", content: "你是一个微信服务号智能助手,限制你的字符输出要低于2048个字节。" },{
role: "user",
content: message
}],
stream: false
});
let fullContent = completion.choices[0].message.content|| '';
console.log("completion:::", completion);
const xmlEntities = {
'&': '&',
'<': '&lt;',
......@@ -60,13 +60,13 @@ app.post('/wechat', async (req, res) => {
return escaped;
}
fullContent = escapeWechatContent(fullContent);
let fullContent = escapeWechatContent(completion.choices[0].message.content);
// 响应构造
const responseXML = `
<xml>
<ToUserName><![CDATA[${fromUser}]]></ToUserName>
<FromUserName><![CDATA[${result.xml.ToUserName[0]}]]></FromUserName>
<CreateTime>${Math.floor(Date.now() / 1000)}</CreateTime>
<CreateTime>${Math.floor(Date.now()/1000)}</CreateTime>
<MsgType><![CDATA[text]]></MsgType>
<Content><![CDATA[${fullContent}]]></Content>
</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