fix: 智能模式function叠加消息

This commit is contained in:
ikechan8370 2023-07-15 14:24:05 +08:00
parent b5669de782
commit a1b450abaa

View file

@ -1875,7 +1875,7 @@ export class chatgpt extends plugin {
} }
this.chatGPTApi = new ChatGPTAPI(opts) this.chatGPTApi = new ChatGPTAPI(opts)
let option = { let option = {
timeoutMs: 120000, timeoutMs: 600000,
completionParams, completionParams,
stream: true, stream: true,
onProgress: (data) => { onProgress: (data) => {
@ -2034,6 +2034,9 @@ export class chatgpt extends plugin {
msg = await this.chatGPTApi.sendMessage(prompt, option) msg = await this.chatGPTApi.sendMessage(prompt, option)
logger.info(msg) logger.info(msg)
while (msg.functionCall) { while (msg.functionCall) {
if (msg.text) {
await e.reply(msg.text)
}
let { name, arguments: args } = msg.functionCall let { name, arguments: args } = msg.functionCall
args = JSON.parse(args) args = JSON.parse(args)
// 感觉换成targetGroupIdOrUserQQNumber这种表意比较清楚的变量名效果会好一丢丢 // 感觉换成targetGroupIdOrUserQQNumber这种表意比较清楚的变量名效果会好一丢丢