mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
fix: 优化报错内容
This commit is contained in:
parent
fb7cd69969
commit
4626577a93
3 changed files with 5 additions and 5 deletions
|
|
@ -588,11 +588,11 @@ export default class SydneyAIClient {
|
|||
return
|
||||
}
|
||||
if (message?.author !== 'bot') {
|
||||
if (message?.item?.result) {
|
||||
if (message?.item?.result?.exception?.indexOf('maximum context length') > -1) {
|
||||
if (event.item?.result) {
|
||||
if (event.item?.result?.exception?.indexOf('maximum context length') > -1) {
|
||||
reject('对话长度太长啦!超出8193token,请结束对话重新开始')
|
||||
} else {
|
||||
reject(`${message?.item?.result.value}\n${message?.item?.result.error}\n${message?.item?.result.exception}`)
|
||||
reject(`${event.item?.result.value}\n${event.item?.result.error}\n${event.item?.result.exception}`)
|
||||
}
|
||||
} else {
|
||||
reject('Unexpected message author.')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue