-
-
Notifications
You must be signed in to change notification settings - Fork 724
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
fix(instructor/patch.py, tests/openai/test_multitask.py): Correct model checking and add new tests #413
fix(instructor/patch.py, tests/openai/test_multitask.py): Correct model checking and add new tests #413
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,8 +213,7 @@ def process_response( | |
|
||
# ? This really hints at the fact that we need a better way of | ||
# ? attaching usage data and the raw response to the model we return. | ||
if isinstance(response_model, IterableBase): | ||
#! If the response model is a multitask, return the tasks | ||
if isinstance(model, IterableBase): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable |
||
return [task for task in model.tasks] | ||
|
||
if isinstance(response_model, ParallelBase): | ||
|
@@ -267,7 +266,7 @@ async def process_response_async( | |
|
||
# ? This really hints at the fact that we need a better way of | ||
# ? attaching usage data and the raw response to the model we return. | ||
if isinstance(response_model, IterableBase): | ||
if isinstance(model, IterableBase): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable 'model' is not defined in the scope of this function. This will cause a NameError at runtime. Please revert the change to 'response_model'. |
||
#! If the response model is a multitask, return the tasks | ||
return [task for task in model.tasks] | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "instructor" | ||
version = "0.5.0" | ||
version = "0.5.1" | ||
description = "structured outputs for llm" | ||
authors = ["Jason Liu <[email protected]>"] | ||
license = "MIT" | ||
|
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 variable 'model' is not defined in the scope of this function. This will cause a NameError at runtime. Please revert the change to 'response_model'.