mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: add warn log for context_length_exceeded error
This commit is contained in:
parent
354183a0cc
commit
970e89969d
1 changed files with 1 additions and 0 deletions
|
|
@ -846,6 +846,7 @@ export class chatgpt extends plugin {
|
|||
msg = await this.chatGPTApi.sendMessage(prompt, option)
|
||||
} catch (err) {
|
||||
if (err.message?.indexOf('context_length_exceeded')) {
|
||||
logger.warn(err)
|
||||
await redis.del(`CHATGPT:CONVERSATIONS:${e.sender.user_id}`)
|
||||
await e.reply('字数超限啦,将为您自动结束本次对话。')
|
||||
return null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue