langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Model's maximum context length exceeded when building agent

Open kingcharlezz opened this issue 1 year ago • 0 comments

I'm trying to use the GPT model to interact with the Google Calendar API, but I'm receiving the following error message:

"This model's maximum context length is 4097 tokens. However, your messages resulted in 4392 tokens. Please reduce the length of the messages."

https://gist.github.com/kingcharlezz/e820bc60febef084402cb2a68f3aeeb0

Could someone please help me find a way to avoid exceeding the model's maximum context length, or suggest alternative approaches to achieve the same functionality without encountering this issue? Any help would be greatly appreciated.

kingcharlezz avatar Apr 30 '23 17:04 kingcharlezz