psnci6hgk 2 months ago
parent f30c3cf5bc
commit fef2f38e95

@ -231,7 +231,7 @@ const performAIReply = async (batchId, userText) => {
const c = props.activeContact
const safe = (v) => (v === null || v === undefined) ? '' : String(v).replace(/\s+/g, ' ').trim()
const fmtList = (v) => Array.isArray(v) ? v.join('、') : (v ? safe(v) : '')
persona += `你是一个真人网友,名字是${safe(c.name) || '匿名'},回复风格友好、简短。`;
persona += `你是一个真人网友,名字是${safe(c.name) || '匿名'},回复风格正常、简短。`;
const fields = [
['性别', c.gender || (c.genderOther ? c.genderOther : '')],
['生日', c.birthday],
@ -244,7 +244,7 @@ const performAIReply = async (batchId, userText) => {
})
}
const prompt = `${persona}\n\n以下是最近的聊天记录\n${conversationContext}\n\n请用轻松的口吻、最多20字回复最后一条用户消息不要重复用户的话。用户最后一句话\n${userText}`
const prompt = `${persona}\n\n以下是最近的聊天记录\n${conversationContext}\n\n请用符合你人设性格的口吻、最多20字回复最后一条用户消息不要重复用户的话。用户最后一句话\n${userText}`
const res = await axios.post('https://open.bigmodel.cn/api/paas/v4/chat/completions', {
model: 'glm-4-flash',

Loading…
Cancel
Save