feat(copilot): google gemini support #1923
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
If you have any questions, you can refer to the Contributing Guide
What is the current behavior?
Currently, MQTTX Copilot does not support using AI models from Google Generative AI (Gemini family). Users cannot select Google as a provider or utilize Gemini models for Copilot features.
Issue Number
None
What is the new behavior?
This PR introduces support for Google Generative AI models within MQTTX Copilot. Users can now select 'Google' as a provider in the Copilot settings and choose from various Gemini models (e.g.,
gemini-1.5-pro-latest
,gemini-2.0-flash
, etc.).Key changes include:
@ai-sdk/google
dependency.src/types/copilot.ts
) to include the Google provider configuration (GoogleOptionsModel
).AImodelsOptions
insrc/utils/ai/copilot.ts
to list the Google provider, its models, the default API endpoint (https://generativelanguage.googleapis.com/v1beta
), and thecreateGoogleGenerativeAI
function.getModelProvider
insrc/utils/ai/copilot.ts
to correctly instantiate the Google provider using the AI SDK.AIAgent
insrc/utils/ai/AIAgent.ts
to correctly determine theproviderType
('Google') based on the selected model or host URL, ensuring the correct provider is instantiated.tests/unit/utils/ai/copilot.spec.ts
) to include checks for the Google provider and ensure the requiredproviderType
andbaseURL
parameters are passed correctly.Does this PR introduce a breaking change?
Specific Instructions
Users wishing to use Google Gemini models will need to:
https://generativelanguage.googleapis.com/v1beta
).Other information
Optional: Add any other relevant context or notes here.