-
-
Notifications
You must be signed in to change notification settings - Fork 721
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(response model): introduce handling of simple types #447
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.
Looks good to me! Reviewed entire PR up to commit d289c31
Reviewed 330
lines of code across 5
files in 44 second(s).
See details
- Skipped files: 0
- Confidence threshold:
85%
- Drafted
1
additional comments. - Workflow ID:
wflow_91jodXUOg8t4sfcp
View 1 draft comments
These comments were drafted by Ellipsis, but were filtered out of the final review. They're included here so you can see our internal thought process and help you configure your ellipsis.yaml
.
Drafted 1 comments under confidence threshold
Filtered comment at instructor/dsl/simple_type.py:41
Notes: The PR introduces a new feature to handle simple types in the response model. The code changes look good and the logic seems sound. The new feature is well tested. However, there is a minor issue with the comment in the
is_simple_type
function in thesimple_type.py
file. The comment is incomplete and does not provide any useful information.
The comment on this line seems to be incomplete. Please provide a complete and meaningful comment.
Confidence changes required: 80%
Something look wrong? Tag @ellipsis-dev in a comment, or customize the ellipsis.yaml for this repository.
Generated with ❤️ by ellipsis.dev
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.
Looks good to me! Incremental review on commit b40fc41
Reviewed 38
lines of code across 2
files in 1 minute(s) and 9 second(s).
See details
- Skipped files: 0
- Confidence threshold:
85%
- Drafted
1
additional comments. - Workflow ID:
wflow_XXeWqHRlSDCuWJSs
View 1 draft comments
These comments were drafted by Ellipsis, but were filtered out of the final review. They're included here so you can see our internal thought process and help you configure your ellipsis.yaml
.
Drafted 1 additional comments
Filtered comment at instructor/dsl/simple_type.py:27
Notes: The PR introduces handling of simple types in the response model. The changes in the code seem to be logically correct. The
is_simple_type
function checks if the response model is a simple type and theModelAdapter
class wraps the simple types in a BaseModel. The changes inpatch.py
handle instances ofAdapterBase
. The tests also seem to cover the new functionality adequately. However, there is a minor issue in thesimple_type.py
file where thecreate_model
function is called with...
as the second argument forcontent
. This is not a valid default value and should be replaced withNone
.
The ...
in this line is not a valid default value for the content
field. It should be replaced with None
.
content=(response_model, None),
Confidence changes required: 100%
Score: 70%
Something look wrong? Tag @ellipsis-dev in a comment, or customize the ellipsis.yaml for this repository.
Generated with ❤️ by ellipsis.dev
tests/openai/test_simple_types.py
Outdated
messages=[ | ||
{ | ||
"role": "user", | ||
"content": "Product a Random but correct response given the desired output", |
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.
"Product a"
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.
Small typo in tests otherwise solid! I like this for enums
@lukevs I ripped your code to merge onto this one |
Looks good! I like how this is moving us away from unnecessary wrapper classes like we talked about for parallel models @jxnl |
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.
Looks good to me! Incremental review on commit 8f37a29
Reviewed 58
lines of code across 1
files in 54 second(s).
See details
- Skipped files: 0
- Confidence threshold:
85%
- Drafted
1
additional comments. - Workflow ID:
wflow_fp8ihwcN6NZf8kad
View 1 draft comments
These comments were drafted by Ellipsis, but were filtered out of the final review. They're included here so you can see our internal thought process and help you configure your ellipsis.yaml
.
Drafted 1 comments under confidence threshold
Filtered comment at tests/openai/test_simple_types.py:17
Notes: The tests seem to be well written and cover a variety of cases. However, there is a lot of repetition in the test cases. The same 'client.chat.completions.create' function is called with the same parameters except for the 'response_model'. This could be refactored into a helper function to make the code DRY (Don't Repeat Yourself).
Consider refactoring the repeated 'client.chat.completions.create' calls into a helper function to adhere to the DRY principle. This function could take the 'response_model' as a parameter, which is the only varying element in these calls.
Confidence changes required: 80%
Something look wrong? Tag @ellipsis-dev in a comment, or customize the ellipsis.yaml for this repository.
Generated with ❤️ by ellipsis.dev
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.
Looks good to me! Incremental review on commit 2319fff
Reviewed 345
lines of code across 5
files in 1 minute(s) and 8 second(s).
See details
- Skipped files: 0
- Confidence threshold:
85%
- Drafted
1
additional comments. - Workflow ID:
wflow_mkH6NOy86WQrdqr6
View 1 draft comments
These comments were drafted by Ellipsis, but were filtered out of the final review. They're included here so you can see our internal thought process and help you configure your ellipsis.yaml
.
Drafted 1 comments under confidence threshold
Filtered comment at instructor/dsl/simple_type.py:64
Notes: The new
is_simple_type
function andModelAdapter
class insimple_type.py
seem to be implemented correctly. They handle simple types in the response model as expected. The updates inpatch.py
also look good, as they now handle simple types. The tests intest_simple_types.py
cover all the new functionality and pass.
The implementation of simple types handling in the response model looks good. The new is_simple_type
function and ModelAdapter
class are correctly defined and used. The updates in patch.py
correctly handle simple types. The tests cover all the new functionality and pass.
Confidence changes required: 10%
Something look wrong? Tag @ellipsis-dev in a comment, or customize the ellipsis.yaml for this repository.
Generated with ❤️ by ellipsis.dev
Summary:
This PR introduces handling of simple types in the response model, adds a new
is_simple_type
function andModelAdapter
class, updates several functions inpatch.py
, and includes new tests intest_simple_types.py
.Key points:
is_simple_type
function andModelAdapter
class insimple_type.py
.handle_response_model
,process_response
, andprocess_response_async
inpatch.py
to handle simple types.test_simple_types.py
for simple types handling.Generated with ❤️ by ellipsis.dev