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

properly enforce prompt context limit #3121

Merged
merged 1 commit into from
Feb 9, 2024
Merged

Conversation

beyang
Copy link
Member

@beyang beyang commented Feb 9, 2024

There was a bug in the logic of tryAddContext that could effectively expand the overall char limit we imposed on the prompt by the number of bytes we allocated to enhanced context (60%). This contributed to #3104.

This change properly enforces the overall prompt limit.

Test plan

See added unit test

@beyang beyang requested a review from umpox February 9, 2024 23:45
@beyang beyang merged commit e159489 into main Feb 9, 2024
17 checks passed
@beyang beyang deleted the bl/prompt-context-limit branch February 9, 2024 23:54
Copy link
Contributor

@umpox umpox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks for adding the test!

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

Successfully merging this pull request may close these issues.

None yet

3 participants