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

More graceful handling, pt 2 #248

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

More graceful handling, pt 2 #248

wants to merge 3 commits into from

Conversation

vutrung96
Copy link
Contributor

No description provided.

except ValidationError as e:
logger.warning(
f"Failed to parse response message as JSON: {generic_response_string}. "
f"The model likely returned an invalid JSON format. Will skip this response."
Copy link
Contributor

Choose a reason for hiding this comment

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

this doesn't need to be a f-string.

f"The model likely returned an invalid JSON format. Will skip this response."
)
failed_responses_count += 1
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

These continue statements are not fun. Make the code a bit non-linear to read.
A lot of the logic should be under try itself.

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.

2 participants