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

Avoid double-including error message in retry when Mode.TOOLS #514

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

ilyanekhay-uta
Copy link
Contributor

@ilyanekhay-uta ilyanekhay-uta commented Mar 20, 2024

fixes #513


Ellipsis 🚀 This PR description was created by Ellipsis for commit c88e1d5.

Summary:

This PR modifies the reask_messages function in instructor/retry.py to prevent double-inclusion of error messages when the mode is Mode.TOOLS.

Key points:

  • Modified reask_messages function in instructor/retry.py.
  • Changed if-else condition to avoid double-including error messages in Mode.TOOLS.
  • Error message is now only included for the relevant mode.

Generated with ❤️ by ellipsis.dev

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me!

  • Reviewed the entire pull request up to c88e1d5
  • Looked at 24 lines of code in 1 files
  • Took 40 seconds to review
More info
  • Skipped 0 files when reviewing.
  • Skipped posting 1 additional comments because they didn't meet confidence threshold of 85%.
1. instructor/retry.py:30:
  • Assessed confidence : 0%
  • Comment:
    This change in control flow seems to be in line with the PR's intent of avoiding double-including the error message in the retry when Mode.TOOLS. However, it would be good to confirm this by checking the usage of the reask_messages function in the codebase.
  • Reasoning:
    The PR changes the control flow of the reask_messages function. Previously, if mode was Mode.TOOLS, the function would yield a message for each tool call, and then yield another message if mode was Mode.MD_JSON. Now, the function will only yield the Mode.MD_JSON message if mode is not Mode.TOOLS. This seems to be the intended behavior, as the PR title suggests that the error message was being included twice in the retry when mode was Mode.TOOLS. However, I would like to confirm this by checking the usage of the reask_messages function in the codebase.

Workflow ID: wflow_2n5BrUwzPKx9b4lm


Not what you expected? You can customize the content of the reviews using rules. Learn more here.

@jxnl jxnl merged commit c5c19fa into instructor-ai:main Mar 20, 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.

When retrying, Pydantic validation errors are included in the prompt twice in Mode.TOOLS
2 participants