-
Notifications
You must be signed in to change notification settings - Fork 2k
[DOC] Add examples/gemini-genai script example #5999
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
base: main
Are you sure you want to change the base?
[DOC] Add examples/gemini-genai script example #5999
Conversation
Clone examples/gemini/ -> examples/gemini-genai/ as a starting point for modifying the code to use newer google.genai instead of older google.generativeai
* Update from google.generativeai to google.genai * Use env variable GOOGLE_API_KEY for the api_key * Fix document loading logic issues, if interrupted. * Add single and batch document loading methods * Make document loading batch processing more flexible and robust * Separate out the embed model from the query model * Reduce the batch size so it will better work with Google Free Tier. * Revise output to more explicitly separate the collection closest documents from the LLM query.
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
|
Add google.genai-based Gemini example with robust data loader Adds a new Key Changes• Introduce Affected Areas• examples/gemini-genai/main.py This summary was automatically generated by @propel-code-bot |
Description of changes
Create new Gemini google.genai example (examples/gemini-genai)
This is a new example script that uses the newer google.genai API, based on the existing examples/gemini example that uses the older google.generativeai API. Full change history of the modifications retained.
Fixes: #5998
Test plan
Example scripts tested locally.
Migration plan
N/A
Observability plan
N/A
Documentation Changes
No