-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Feat: Adding Gemini tools - URL Context and Grounding with Google Search #5959
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?
Conversation
- with topP, topK, maxOutputTokens - allow users to enable URL context and Grounding Research
… + working with profile-specific thresholding
…iption and titles to settings for translation purposes
…ng will also change in Gemini context management - sync between Context Management Settting <-> Gemini Context Management with regards to thresholding
- better naming and correct purpose
…kbox + removing the lengthy description
- due to the decision in: RooCodeInc#3717
…th Gemini docs/AI studio
"geminiParameters": { | ||
"urlContext": { | ||
"title": "URL संदर्भ सक्षम करें", | ||
"description": "जब प्रतिक्रियाएं उत्पन्न करता है, अतिरिक्त संदर्भ के लिए Gemini को URL तक पहुंचने और संसाधित करने की अनुमति देता है। वेब सामग्री विश्लेषण वाली कार्यों के लिए उपयोगी।" |
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.
Typo/grammatical note: In the description for "urlContext", the phrase "जब प्रतिक्रियाएं उत्पन्न करता है" has a number mismatch. Consider revising it (for example, to "जब प्रतिक्रिया उत्पन्न होती है") for better grammatical accuracy.
"description": "जब प्रतिक्रियाएं उत्पन्न करता है, अतिरिक्त संदर्भ के लिए Gemini को URL तक पहुंचने और संसाधित करने की अनुमति देता है। वेब सामग्री विश्लेषण वाली कार्यों के लिए उपयोगी।" | |
"description": "जब प्रतिक्रिया उत्पन्न होती है, अतिरिक्त संदर्भ के लिए Gemini को URL तक पहुंचने और संसाधित करने की अनुमति देता है। वेब सामग्री विश्लेषण वाली कार्यों के लिए उपयोगी।" |
@mrubens Hi, I created this PR for you and did the changes that you requested: adding more spacing between the label and the explanatory text.
![]() |
Hmm, there's something up with the checkboxes here - I need to check and uncheck a couple times to be able to save. Maybe we need to do a migration in providersettings? |
Looking into this right now |
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.
Hey @HahaBill Thank you for the work on splitting you PR, I just have a couple of questions and suggestions.
Let me know what you think!
temperature: this.options.modelTemperature ?? 0, | ||
...(tools.length > 0 ? { tools } : {}), | ||
} |
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.
I noticed that maxTokens
is being passed to getModel()
but isn't included in the config object. Should we add maxOutputTokens: this.options.modelMaxTokens ?? maxTokens ?? undefined
to the config to ensure token limits are properly enforced?
} | ||
const config = rawConfig as unknown as GenerateContentConfig |
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.
Is there a specific reason for the type casting as unknown as GenerateContentConfig
? This pattern appears twice in the code. If the types don't align properly, would it be better to create a proper type mapping or update the type definitions to avoid potential runtime issues?
} | ||
} catch (error) { | ||
if (error instanceof Error) { | ||
throw new Error(`Gemini Generate Context Stream error: ${error.message}`) |
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.
Is this error user-facing? if so, can we internationalize it?
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.
Could we add tests for error scenarios? For example:
- What happens when grounding metadata extraction fails?
- How does the handler behave with malformed grounding metadata?
- What if the API returns an error when tools are enabled?
Related GitHub Issue
Related to this PR: #4895
Closes: #4519
Roo Code Task Context (Optional)
Description
Test Procedure
Pre-Submission Checklist
Screenshots / Videos
Documentation Updates
Additional Notes
Get in Touch
Important
Adds URL context and grounding with Google Search features to the Gemini provider, including UI updates and tests.
enableUrlContext
andenableGrounding
options togeminiSchema
inprovider-settings.ts
.GeminiHandler
ingemini.ts
to support URL context and grounding with Google Search.gemini.ts
.ApiOptions.tsx
andGemini.tsx
to include checkboxes for enabling URL context and grounding.Gemini.spec.tsx
.gemini-handler.spec.ts
to testGeminiHandler
with URL context and grounding configurations.Gemini.spec.tsx
.This description was created by
for 728aded. You can customize this summary. It will automatically update as commits are pushed.