-
-
Notifications
You must be signed in to change notification settings - Fork 730
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: update and allow strict mode #618
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested.
- Reviewed the entire pull request up to 291e3e5
- Looked at
170
lines of code in2
files - Took 35 seconds to review
More info
- Skipped
0
files when reviewing. - Skipped posting
0
additional comments because they didn't meet confidence threshold of85%
.
Workflow ID: wflow_DhD3Vg3aHOAfDbEP
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. We'll respond in a few minutes. Learn more here.
@@ -67,6 +67,7 @@ def create( | |||
messages: List[ChatCompletionMessageParam], | |||
max_retries: int = 3, | |||
validation_context: dict | None = None, | |||
strict: bool = True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new parameter 'strict' is not documented. Please add a comment or update the function docstring to explain what this parameter does and how it should be used.
@@ -116,6 +116,7 @@ async def new_create_async( | |||
response_model: Type[T_Model] = None, | |||
validation_context: dict = None, | |||
max_retries: int = 1, | |||
strict: bool = True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new parameter 'strict' is not documented. Please add a comment or update the function docstring to explain what this parameter does and how it should be used. This comment is also applicable to other instances of the 'strict' parameter in this file.
Deploying instructor with
|
Latest commit: |
291e3e5
|
Status: | ✅ Deploy successful! |
Preview URL: | https://6128e958.instructor.pages.dev |
Branch Preview URL: | https://allow-strict-in-create.instructor.pages.dev |
I think this is a good change and should be merged but it doesn't fulfill my intent behind #612. #612 is about allowing control characters in JSON strings because this happens so commonly with Claude's models. Pydantic's The standard library's If you want to merge these non-strict semantics, the change looks like this for the JSON-parsing functions in
Maybe you don't want to merge these semantics in instructor's If this is functionality you want in |
This functionality was made possible at some point, not sure when it was removed: #75 |
lets allow this too, I'll merge this first. sorry for delay was on vacation! |
addresses #612
Summary:
The pull request introduces a new
strict
parameter, defaulting toTrue
, to several methods in theInstructor
andAsyncInstructor
classes and to thenew_create_async
andnew_create_sync
functions.Key points:
strict
parameter to several methods in theInstructor
andAsyncInstructor
classes ininstructor/client.py
.strict
parameter to thenew_create_async
andnew_create_sync
functions ininstructor/patch.py
.strict
parameter is a boolean that defaults toTrue
.Generated with ❤️ by ellipsis.dev