feat: 更新大模型调用逻辑,直接传递发送者名字以优化用户输入格式
This commit is contained in:
parent
de0067ec17
commit
36c1dc2136
@ -53,16 +53,13 @@ const agent = async (ctx: Context.Data) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取发送者的名字
|
|
||||||
const userName = historyMentions.get(openId || "") ?? "用户"
|
|
||||||
userInput = `${userName}:${userInput}`
|
|
||||||
|
|
||||||
// 调用大模型
|
// 调用大模型
|
||||||
try {
|
try {
|
||||||
await updateCard(cardGender.genPendingCard("LLM激情输出中,请稍等..."))
|
await updateCard(cardGender.genPendingCard("LLM激情输出中,请稍等..."))
|
||||||
const llmRes = await llm.invoke(
|
const llmRes = await llm.invoke(
|
||||||
"groupAgent",
|
"groupAgent",
|
||||||
{
|
{
|
||||||
|
userName: historyMentions.get(openId || "") ?? "用户",
|
||||||
userInput,
|
userInput,
|
||||||
chatHistory: JSON.stringify(chatHistory),
|
chatHistory: JSON.stringify(chatHistory),
|
||||||
time: new Date().toLocaleString("zh-CN", { timeZone: "Asia/Shanghai" }),
|
time: new Date().toLocaleString("zh-CN", { timeZone: "Asia/Shanghai" }),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user