-
-
Notifications
You must be signed in to change notification settings - Fork 602
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
async gemini support #719
async gemini support #719
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 b1602cb in 1 minute and 44 seconds
More details
- Looked at
78
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. instructor/client_gemini.py:31
- Draft comment:
The function no longer enforces that the mode must beinstructor.Mode.GEMINI_JSON
as it did in the previous version. If this is intentional, ensure that all calling code is aware of this change. If not, consider adding an assertion to enforce this.
assert mode == instructor.Mode.GEMINI_JSON, "Mode must be instructor.Mode.GEMINI_JSON"
This suggestion applies to the entire function definition.
- Reason this comment was not posted:
Confidence of 0% on close inspection, compared to threshold of 85%.
Workflow ID: wflow_Q3xAfLc2GXsIwv1e
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
lmk thoughts on the use_async - The other clients have different Async clients that we can check the instance of but in this case Google/Gemini has the same client. |
Honestly, this looks good. Have you tested it locally yet? |
retry.py retry_async logic needs to also be updated to handle ValidationErrors. Gemini uses a different messages format. |
Have an example that will break? Happy to add |
Just saying that instructor/instructor/retry.py Lines 159 to 169 in 3d8d449
instructor/instructor/retry.py Lines 225 to 232 in 3d8d449
|
Summary:
This PR introduces asynchronous support to the
from_gemini
function in theinstructor/client_gemini.py
, allowing it to handle both synchronous and asynchronous operations.Key points:
from_gemini
function ininstructor/client_gemini.py
from_gemini
to handle sync and async modesuse_async
to return appropriate instructor typegenerate_content_async
for async andgenerate_content
for syncGenerated with ❤️ by ellipsis.dev