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

🚨 feat: Implement INPUT_LENGTH Error Type #3866

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

danny-avila
Copy link
Owner

Summary

Continued from #3836

  • Added a new INPUT_LENGTH error type to the ErrorTypes enum in the data provider package.
  • Modified the BaseClient class to throw a structured error when the latest message token count exceeds the maximum context tokens.
  • Updated the Error component in the client to handle and display the new INPUT_LENGTH error type.
  • Added a new localization string for the INPUT_LENGTH error message in English.
  • Refactored error handling logic in the BaseClient to provide more detailed information about token count and limits.

Testing:

To test these changes:

  1. Attempt to send a message that exceeds the maximum token limit for the current conversation.
  2. Verify that the appropriate error message is displayed, including the current token count and the maximum limit.
  3. Test with different language settings to ensure proper localization of the error message.
  4. Verify that the error is properly logged on the server side.

I recommend thorough testing of edge cases, such as messages just at the token limit and messages significantly over the limit, to ensure consistent behavior.

@danny-avila danny-avila merged commit 7536e64 into main Aug 30, 2024
3 checks passed
@danny-avila danny-avila deleted the DenisPalnitsky-promtp-exceeds-limit-error branch August 30, 2024 19:01
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.

1 participant