Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This model's maximum context length is 4097 tokens. However, you requested 4307 tokens (2259 in the messages, 2048 in the completion). Please reduce the length of the messages or completion. at com.theokanning.openai.service.OpenAiService.execute(OpenAiService.java:227) #42

Closed
1441853031 opened this issue Mar 21, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@1441853031
Copy link

This model's maximum context length is 4097 tokens. However, you requested 4307 tokens (2259 in the messages, 2048 in the completion). Please reduce the length of the messages or completion.
at com.theokanning.openai.service.OpenAiService.execute(OpenAiService.java:227)

@ashinnotfound
Copy link
Owner

你用的是最新版本吗,我今天下午对这个问题进行了更新,应该不会出现这个问题了

@1441853031
Copy link
Author

好的
我改一下

@1441853031
Copy link
Author

更新后有时候还是会报错

@1441853031
Copy link
Author

你用的是最新版本吗,我今天下午对这个问题进行了更新,应该不会出现这个问题了

更新后有时候还是会报这个错

@1441853031
Copy link
Author

你用的是最新版本吗,我今天下午对这个问题进行了更新,应该不会出现这个问题了

遇到点问题,能加一下联系方式吗

@ashinnotfound
Copy link
Owner

你用的是最新版本吗,我今天下午对这个问题进行了更新,应该不会出现这个问题了

更新后有时候还是会报这个错

这样吗,那我明天再看看吧,谢谢反馈

@ashinnotfound
Copy link
Owner

你用的是最新版本吗,我今天下午对这个问题进行了更新,应该不会出现这个问题了

遇到点问题,能加一下联系方式吗

邮件联系就可以了

@1441853031
Copy link
Author

image
这个异常好像捕获不到

@1441853031
Copy link
Author

image 这个异常好像捕获不到

catch (OpenAiHttpException e){
BotUtil.deleteFirstPrompt(chatBO.getSessionId());
return chat(chatBO);
}
改成这样就可以了,谢谢大佬的代码

@ashinnotfound
Copy link
Owner

image 这个异常好像捕获不到

catch (OpenAiHttpException e){
BotUtil.deleteFirstPrompt(chatBO.getSessionId());
return chat(chatBO);
}
改成这样就可以了,谢谢大佬的代码

感谢,我待会测试下

@ashinnotfound ashinnotfound added the bug Something isn't working label Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants