-
-
Notifications
You must be signed in to change notification settings - Fork 686
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: Add Gemini PDF example #1163
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.
❌ Changes requested. Reviewed everything up to 8a39ada in 1 minute and 12 seconds
More details
- Looked at
101
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. docs/blog/posts/chat-with-your-pdf-with-gemini.md:95
- Draft comment:
Ensure this new markdown file is added tomkdocs.yml
for proper documentation inclusion. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_QxHSjkQWNMDqoMSw
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.
file = genai.upload_file("path/to/your.pdf") # [Download sample PDF](sample.pdf) | ||
resp = client.chat.completions.create( | ||
messages=[ | ||
{"role": "user", "content": ["Summarize the following file", file]}, |
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 content
key in the message dictionary should be a string, not a list. Change "content": ["Summarize the following file", file]
to "content": "Summarize the following file: " + file
.
{"role": "user", "content": ["Summarize the following file", file]}, | |
{"role": "user", "content": "Summarize the following file: " + file}, |
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 7f48323 in 57 seconds
More details
- Looked at
33
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. docs/blog/posts/chat-with-your-pdf-with-gemini.md:42
- Draft comment:
Make sure to add this new markdown file to themkdocs.yml
to ensure it is included in the documentation. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_v2DjqduThRmdBNYD
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.
file = genai.upload_file("path/to/your.pdf") | ||
|
||
# Wait for file to finish processing | ||
while file.state != File.State.ACTIVE: |
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.
Missing import for time
module. Add import time
at the beginning of the code.
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 0ba2ab0 in 19 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. docs/blog/posts/chat-with-your-pdf-with-gemini.md:18
- Draft comment:
Addimport time
to avoid NameError in the while loop. - Reason this comment was not posted:
Comment was on unchanged code.
2. docs/blog/posts/chat-with-your-pdf-with-gemini.md:18
- Draft comment:
Make sure to add this new markdown file to themkdocs.yml
to ensure it appears in the documentation navigation. - Reason this comment was not posted:
Confidence changes required:80%
The new markdown file should be added to the mkdocs.yml for proper documentation navigation.
Workflow ID: wflow_mDq2v3t4FrFFxDqZ
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.
👍 Looks good to me! Incremental review on 8b571a5 in 20 seconds
More details
- Looked at
14
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. docs/blog/posts/chat-with-your-pdf-with-gemini.md:51
- Draft comment:
Missing import for thetime
module, which is used in the while loop. Addimport time
to avoid runtime errors. - Reason this comment was not posted:
Comment was on unchanged code.
2. docs/blog/posts/chat-with-your-pdf-with-gemini.md:51
- Draft comment:
Make sure to add this new markdown file to themkdocs.yml
to ensure it appears in the documentation navigation. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_gxQYx5PytUcthHaN
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.
👍 Looks good to me! Incremental review on a7ec92f in 19 seconds
More details
- Looked at
12
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. docs/blog/posts/chat-with-your-pdf-with-gemini.md:49
- Draft comment:
Consider adding a timeout to the while loop using thetime
module to prevent potential infinite loops if the file state never becomes ACTIVE. - Reason this comment was not posted:
Confidence changes required:50%
The import oftime
is necessary for the sleep function used in the while loop. However, the while loop could benefit from a timeout to prevent infinite loops.
2. docs/blog/posts/chat-with-your-pdf-with-gemini.md:46
- Draft comment:
Ensure this new markdown file is added to themkdocs.yml
to be included in the documentation navigation. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_A13i5lDFntQjOWEd
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Adds a blog post on using Google's Gemini model with Instructor for efficient PDF processing, including setup and benefits.
chat-with-your-pdf-with-gemini.md
todocs/blog/posts/
.This description was created by for a7ec92f. It will automatically update as commits are pushed.