-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
Fixed new templating feature throwing an error for gemini #1021
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 6b66cd7 in 11 seconds
More details
- Looked at
66
lines of code in3
files - Skipped
1
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. instructor/patch.py:225
- Draft comment:
Check for 'messages' key before callinghandle_templating
to avoid KeyError. This is a good practice. - Reason this comment was not posted:
Confidence changes required:0%
The PR description mentions a bug fix related to async client, which is addressed in theinstructor/patch.py
file. The change ensures thathandle_templating
is only called ifmessages
is present innew_kwargs
. This is a good practice to avoid KeyErrors.
2. instructor/retry.py:278
- Draft comment:
Added handling for new modes in retry logic, consistent with PR description. - Reason this comment was not posted:
Confidence changes required:0%
The PR description mentions a bug fix related to async client, which is addressed in theinstructor/retry.py
file. The change adds handling for new modes in the retry logic, which is consistent with the PR description.
3. pyproject.toml:36
- Draft comment:
Updatedgoogle-generativeai
version to ensure compatibility with latest features or bug fixes. - Reason this comment was not posted:
Confidence changes required:0%
The PR updates the version ofgoogle-generativeai
inpyproject.toml
. This is consistent with the PR description and ensures compatibility with the latest features or bug fixes in the dependency.
4. pyproject.toml:36
- Draft comment:
When updating library versions, ensure that related documentation and tests are also updated to reflect any changes in functionality or usage. - Reason this comment was not posted:
Confidence changes required:80%
The PR updates the version of thegoogle-generativeai
library in thepyproject.toml
file. However, there is no indication that the documentation or tests have been updated to reflect this change.
Workflow ID: wflow_NAfQTipEjgbzF5U8
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -222,7 +222,8 @@ async def new_create_async( | |||
response_model, new_kwargs = handle_response_model( | |||
response_model=response_model, mode=mode, **kwargs | |||
) | |||
new_kwargs["messages"] = handle_templating(new_kwargs["messages"], context) | |||
if "messages" in new_kwargs: |
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.
gemini has a kwargs of "content" so this throws an error for gemini with the new jinja support
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 79a9711 in 11 seconds
More details
- Looked at
29
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. pyproject.toml:36
- Draft comment:
The version forgoogle-generativeai
should be updated to^0.8.2
as per the PR description, not^0.5.4
. Please correct this discrepancy. - Reason this comment was not posted:
Comment did not seem useful.
2. pyproject.toml:36
- Draft comment:
The version ofgoogle-generativeai
should be updated to^0.8.2
as mentioned in the PR description. Please ensure the version is consistent across the file. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_OHc057SXcGb0U0ox
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Fixed a bug with async client
Important
Fix async client bug with Jinja templating and update Google Generative AI dependency version.
new_create_async()
inpatch.py
, check if"messages"
exists innew_kwargs
before applyinghandle_templating()
.retry_async()
andretry_sync()
inretry.py
forMode.GEMINI_JSON
,Mode.GEMINI_TOOLS
,Mode.VERTEXAI_TOOLS
, andMode.VERTEXAI_JSON
.google-generativeai
version from^0.5.4
to^0.8.2
inpyproject.toml
.This description was created by for 79a9711. It will automatically update as commits are pushed.