-
-
Notifications
You must be signed in to change notification settings - Fork 614
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: clean up cohere templating #1030
base: main
Are you sure you want to change the base?
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 everything up to c4ccc42 in 10 seconds
More details
- Looked at
230
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. instructor/patch.py:96
- Draft comment:
The return type in the docstring is incorrect. It should bedict[str, Any]
instead oflist[dict[str, Any]]
. - Reason this comment was not posted:
Comment was on unchanged code.
2. instructor/patch.py:110
- Draft comment:
Assertion error messages should be more descriptive. Consider providing more context in the error message to help with debugging. - Reason this comment was not posted:
Confidence changes required:80%
The assertion error messages in thehandle_templating
function should be more descriptive.
Workflow ID: wflow_KECPvk0OQBJZn4E3
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Deploying instructor with Cloudflare Pages
|
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 9629f48 in 9 seconds
More details
- Looked at
444
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. instructor/templating.py:15
- Draft comment:
Consider moving the import statement forvertexai.generative_models
to the top of the file to avoid repeated imports and improve performance. - Reason this comment was not posted:
Confidence changes required:50%
The import statement forvertexai.generative_models
is inside a function, which can lead to performance issues if the function is called frequently. It's better to move the import to the top of the file.
2. instructor/templating.py:56
- Draft comment:
Ifhandle_templating
is part of the library's public API, ensure the documentation is updated to reflect the changes made to this function. - Reason this comment was not posted:
Confidence changes required:80%
The functionhandle_templating
ininstructor/templating.py
has been updated, but there is no corresponding update in the documentation. Since this is a library code change, the documentation should be updated accordingly.
3. tests/test_formatting.py:1
- Draft comment:
Ensure that the documentation is updated to reflect the changes made tohandle_templating
if it's part of the public API. - Reason this comment was not posted:
Confidence changes required:80%
The functionhandle_templating
ininstructor/templating.py
has been updated, but there is no corresponding update in the documentation. Since this is a library code change, the documentation should be updated accordingly.
Workflow ID: wflow_QHjPdv0hUUBG83Zy
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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. Incremental review on d2a5c7c in 17 seconds
More details
- Looked at
9
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. instructor/templating.py:1
- Draft comment:
Avoid using# type: ignore[all]
. Instead, address specific type issues to ensure type safety. - Reason this comment was not posted:
Confidence changes required:80%
The use of# type: ignore[all]
suppresses all type checking for this file, which can hide potential type-related issues. It's better to address specific type errors rather than ignoring all of them.
Workflow ID: wflow_azrUW2ProRxOjWzd
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -0,0 +1,97 @@ | |||
# type: ignore[all] |
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 # type: ignore[all]
comment should be justified with a reason or removed if not necessary, especially in library code.
Important
Refactor Cohere templating by integrating it into
handle_templating
intemplating.py
, simplifying code, and updating tests.handle_cohere_templating
frompatch.py
and integrate its logic intohandle_templating
intemplating.py
.from_cohere
inclient_cohere.py
by removingnew_create_async
and usinginstructor.patch
directly.handle_templating
intemplating.py
now processeskwargs
for Cohere, OpenAI, Anthropic, VertexAI, and Gemini formats.kwargs
containsmessage
,messages
, orcontents
inhandle_templating
.test_formatting.py
to usehandle_templating
fromtemplating.py
and cover various message formats.client_cohere.py
.This description was created by for d2a5c7c. It will automatically update as commits are pushed.