feat(ai): integrate multiple AI providers and enhance configuration options - #538
Open
narr07 wants to merge 1 commit into
Open
feat(ai): integrate multiple AI providers and enhance configuration options#538narr07 wants to merge 1 commit into
narr07 wants to merge 1 commit into
Conversation
Contributor
|
@narr07 is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
4 tasks
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR introduces support for multiple AI providers (Google Gemini and Groq) alongside the existing Vercel AI Gateway in Nuxt Studio. Users can now choose their preferred AI model provider or allow Studio to auto-detect the provider based on available environment variables.
Key Changes
ModuleOptionsandruntimeConfigschemas to support provider-specific parameters:provideroption ('auto' | 'gateway' | 'gemini' | 'groq').geminiApiKey,geminiModel,geminiFastModel).groqApiKey,groqModel,groqFastModel).src/module/src/runtime/server/utils/ai/provider.tsto dynamically resolve and initialize the appropriate AI client depending on active environment configurations./ai/analyze,/ai/commit, and/ai/generateserver routes to leverage the unified provider utility instead of hardcoded AI Gateway client.studio-envmiddleware to resolve and load AI credentials from runtime environment variables (GEMINI_API_KEY,NUXT_STUDIO_AI_GEMINI_API_KEY,GROQ_API_KEY, etc.).docs/content/7.ai.md) and added placeholder options to.env.examplefiles in the root and playgrounds.How to Test
GEMINI_API_KEY) or a Groq API Key (GROQ_API_KEY) in your.env.ai.provideroption insidenuxt.config(or leave it asautoto auto-detect).