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

Maximum context length errors with OpenAI #30

Open
asross opened this issue Jan 8, 2025 · 0 comments
Open

Maximum context length errors with OpenAI #30

asross opened this issue Jan 8, 2025 · 0 comments

Comments

@asross
Copy link

asross commented Jan 8, 2025

I was testing out this library using gpt-4o, and eventually hit the following error after ~10min:

openai.BadRequestError: Error code: 400 - {'error': {'message': "This model's maximum context length is 128000 tokens. However, your messages resulted in 391407 tokens. Please reduce the length of the messages.", 'type': 'invalid_request_error', 'param': 'messages', 'code': 'context_length_exceeded'}}

Do I need to use a different model? Or is it possible to update the library to truncate its own messages to fit within the chosen model's context length limits?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant