-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Add Groq and Chutes API providers #3034
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
- Implemented provider logic for Groq and Chutes in `src/api/providers/`. - Added corresponding unit tests. - Integrated providers into the API index, exports, schemas, and types. - Updated `ApiOptions.tsx` and related constants/hooks in `webview-ui` to display settings for Groq and Chutes. - Added missing translation keys for Groq and Chutes settings labels to `webview-ui/src/i18n/locales/en/settings.json`. - Synchronized new translation keys across all other supported languages in `webview-ui`. - Removed redundant Groq translation keys from `src/i18n/locales/en/common.json`. Fixes UI bug where raw translation keys were displayed for Groq/Chutes settings.
|
const GROQ_DEFAULT_TEMPERATURE = 0.5 // Adjusted default temperature for Groq (common default) | ||
|
||
// Renamed class to GroqHandler | ||
export class GroqHandler extends BaseProvider implements SingleCompletionHandler { |
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.
This handler is functionally identical to ChutesHandler. Consider creating a shared base class for OpenAI-compatible providers to avoid duplication.
- ChutesHandler (chutes.ts)
This comment was generated because it violated the following rules: mrule_fYE6mUdYYxZL58YF and mrule_htmKIslKUiIk1Afo.
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 think this is a great suggestion; let's do this. Check out what I did with https://github.com/RooVetGit/Roo-Code/blob/main/src/api/providers/router-provider.ts.
"deepSeekApiKey": "DeepSeek API 密钥", | ||
"getDeepSeekApiKey": "获取 DeepSeek API 密钥", | ||
"geminiApiKey": "Gemini API 密钥", | ||
"getGroqApiKey": "获取 Groq API 密钥", |
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.
For consistency with other API providers (e.g., Gemini, Anthropic, DeepSeek), the key order for Groq API should mirror that pattern. Swap 'getGroqApiKey' and 'groqApiKey' so that 'groqApiKey' appears before 'getGroqApiKey'.
The pull request introduces Groq and Chutes API providers, with changes across multiple files including API handlers, tests, localization, and UI components. Given the size and scope of the changes (44 files changed, 1390 lines added), it might be beneficial to split the pull request into smaller, more focused ones. Consider splitting the changes as follows:
This approach can help in reviewing and testing the changes more effectively. Let me know if you have any questions or need further assistance! |
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Context
This PR introduces support for two new API providers, Groq and Chutes AI. It also fixes a UI bug where the settings labels for these new providers were displaying raw translation keys instead of the intended user-friendly text.
Implementation
groq.ts
,chutes.ts
) insrc/api/providers/
implementing the necessary logic to interact with their respective APIs.groq.test.ts
,chutes.test.ts
) to ensure provider functionality.src/api/index.ts
to register the new providers.src/exports/api.ts
,src/exports/types.ts
,src/exports/roo-code.d.ts
,src/schemas/index.ts
, andsrc/shared/api.ts
to include types, schemas, and constants related to Groq and Chutes.webview-ui/src/components/settings/ApiOptions.tsx
to render the appropriate settings fields (API key input, model selection dropdown) when Groq or Chutes AI is selected.constants.ts
,useSelectedModel.ts
) in thewebview-ui
directory.webview-ui/src/i18n/locales/en/settings.json
.providers.groqApiKey
,providers.getGroqApiKey
,providers.chutesApiKey
) to the English settings file.settings.json
files for all other supported languages (ca, de, es, fr, hi, it, ja, ko, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW) withinwebview-ui/src/i18n/locales/
.src/i18n/locales/en/common.json
to maintain consistency.find-missing-translations.js
script.How to Test
add-groq-chutes-provider
branch.Get in Touch
gawdofai on Discord.
Important
This PR adds support for Groq and Chutes API providers, updates UI components, and fixes translation key issues.
GroqHandler
ingroq.ts
andChutesHandler
inchutes.ts
to support Groq and Chutes APIs.index.ts
to register new providers.groq.test.ts
andchutes.test.ts
.api.ts
,types.ts
,roo-code.d.ts
,schemas/index.ts
, andshared/api.ts
for new provider types and schemas.ApiOptions.tsx
to include settings for Groq and Chutes.constants.ts
anduseSelectedModel.ts
for new providers.settings.json
across multiple languages.common.json
.find-missing-translations.js
.This description was created by
for 181e070. You can customize this summary. It will automatically update as commits are pushed.