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(errors): include completion in LengthFinishReasonError #1701

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

RobertCraigie
Copy link
Collaborator

@RobertCraigie RobertCraigie commented Sep 10, 2024

closes #1700

The error we raise now looks like this

openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=1, prompt_tokens=127, total_tokens=128)

Before it was:

openai.LengthFinishReasonError: Could not parse response content as the length limit was reached

@RobertCraigie RobertCraigie marked this pull request as ready for review September 10, 2024 15:27
@RobertCraigie RobertCraigie requested a review from a team as a code owner September 10, 2024 15:27
@RobertCraigie RobertCraigie changed the base branch from main to next September 10, 2024 15:46
@RobertCraigie RobertCraigie merged commit b0e3256 into next Sep 10, 2024
2 checks passed
@RobertCraigie RobertCraigie deleted the robert/length-error-usage branch September 10, 2024 15:46
@stainless-app stainless-app bot mentioned this pull request Sep 10, 2024
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.

Include usage information in LengthFinishReasonError
2 participants