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

Disabling Pydantic Error #757

Merged
merged 3 commits into from
Jun 16, 2024
Merged

Disabling Pydantic Error #757

merged 3 commits into from
Jun 16, 2024

Conversation

ivanleomk
Copy link
Collaborator

@ivanleomk ivanleomk commented Jun 13, 2024

🚀 This description was created by Ellipsis for commit fde08d0

Summary:

Added a function to disable URLs in Pydantic error messages, updated documentation, and included tests.

Key points:

  • Added disable_pydantic_error_url function in instructor/utils.py to disable URLs in Pydantic error messages by setting PYDANTIC_ERRORS_INCLUDE_URL to 0.
  • Updated docs/concepts/reask_validation.md with a section on optimizing token usage by disabling Pydantic error URLs.
  • Added test_pylance_url_config in tests/test_function_calls.py to verify the removal of URLs from Pydantic error messages.
  • Modified example in docs/concepts/reask_validation.md to demonstrate the usage of disable_pydantic_error_url.

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 everything up to bfe086b in 44 seconds

More details
  • Looked at 110 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. docs/concepts/reask_validation.md:240
  • Draft comment:
    The documentation states that the environment variable change is only valid for the duration of the script execution. However, setting an environment variable in this way will affect the entire process and potentially other scripts running in the same environment, which could lead to unexpected behavior in other parts of the application or in other applications running in the same environment. Consider implementing a more localized way to handle this configuration that does not have global side effects.
  • Reason this comment was not posted:
    Confidence of 30% on close inspection, compared to threshold of 85%.

Workflow ID: wflow_kQ1iJyhKvSSnF4yc


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

cloudflare-pages bot commented Jun 13, 2024

Deploying instructor with  Cloudflare Pages  Cloudflare Pages

Latest commit: 68be699
Status: ✅  Deploy successful!
Preview URL: https://2da927fc.instructor.pages.dev
Branch Preview URL: https://disable-pydantic-error.instructor.pages.dev

View logs

@ivanleomk
Copy link
Collaborator Author

@ssonal I forked your previous branch and made the function opt-in Instead. Wasn't able to get the CI working for your branch for some reason.

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! Incremental review on fde08d0 in 1 minute and 14 seconds

More details
  • Looked at 18 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. tests/llm/test_openai/test_retries.py:12
  • Draft comment:
    The error message in the uppercase_validator function is overly verbose. Consider simplifying it to enhance clarity. For example:
            "Name must be in uppercase."
  • Reason this comment was not posted:
    Confidence of 30% on close inspection, compared to threshold of 85%.

Workflow ID: wflow_QUfBif5g0bdXN2Mf


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@ivanleomk ivanleomk requested a review from jxnl June 13, 2024 02:54
@ivanleomk
Copy link
Collaborator Author

This solves issue #509 and is based off #662.

@jxnl jxnl merged commit e36e732 into main Jun 16, 2024
14 of 15 checks passed
@jxnl jxnl deleted the disable-pydantic-error branch June 16, 2024 22:39
This pull request was closed.
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