Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds Groq provider audio support and test coverage: Groq now routes speech and transcription requests to OpenAI-compatible audio endpoints, tests use provider-aware audio formats, Groq-specific voice/default-format mappings added, and a pronunciation JSON tag was made omitempty. Changes
Sequence DiagramsequenceDiagram
participant Test as Test Handler
participant Groq as Groq Provider
participant AudioAPI as OpenAI-Compatible<br/>Audio API
rect rgba(100, 200, 100, 0.5)
Note over Test,AudioAPI: Speech Synthesis (TTS) Flow
Test->>Groq: Speech(ctx, request, key, headers)
Groq->>Groq: adjust request (clear Instructions if Groq)
Groq->>AudioAPI: POST /v1/audio/speech (via base URL + path)
AudioAPI-->>Groq: audio response
Groq-->>Test: Speech synthesis result
end
rect rgba(100, 150, 200, 0.5)
Note over Test,AudioAPI: Transcription (STT) Flow
Test->>Groq: Transcription(ctx, request, key, headers)
Groq->>AudioAPI: POST /v1/audio/transcriptions (via base URL + path)
AudioAPI-->>Groq: transcription response
Groq-->>Test: transcribed text
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip Migrating from UI to YAML configuration.Use the |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
🧪 Test Suite AvailableThis PR can be tested by a repository admin. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
core/providers/groq/groq.go (1)
181-181: Preferprovider.GetProviderKey()over hardcodedschemas.Groqin delegated calls.Using
provider.GetProviderKey()keeps provider identity handling consistent across aliases/custom keys and matches existing provider conventions.♻️ Small consistency refactor
- schemas.Groq, + provider.GetProviderKey(), ... - schemas.Groq, + provider.GetProviderKey(),Based on learnings: "When handling unsupported operations across providers, avoid hardcoding provider constants (e.g., schemas.Bedrock). Use the provider.GetProviderKey() (or equivalent API) to obtain the actual provider key from configuration, ensuring errors and messages adapt to custom provider names."
Also applies to: 208-208
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@core/providers/groq/groq.go` at line 181, The code currently passes the hardcoded constant schemas.Groq into delegated calls; replace those occurrences with provider.GetProviderKey() so provider identity respects aliases/custom keys—find usages where schemas.Groq is passed (e.g., the call around the Groq provider delegation) and change the argument to provider.GetProviderKey(), ensuring any error messages or unsupported-operation strings use provider.GetProviderKey() as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@core/internal/llmtests/transcription.go`:
- Line 276: The transcription metadata still hardcodes Params.Format = "mp3"
while GenerateTTSAudioForTest now produces provider-default formats; update the
transcription request to use the provider default instead. Replace any hardcoded
`"mp3"` assignments to Params.Format in the same blocks where
GenerateTTSAudioForTest is called (refer to GenerateTTSAudioForTest(...,
GetProviderDefaultFormat(testConfig.Provider)) and testConfig.Provider) with
GetProviderDefaultFormat(testConfig.Provider) so the format used for
transcription matches the generated audio; apply this change at all four updated
call sites (lines corresponding to the GenerateTTSAudioForTest usages).
In `@core/providers/groq/groq.go`:
- Around line 172-173: Update the stale method comments that say "Speech is not
supported by the Groq provider." and similar for Transcription: locate the
GroqProvider.Speech and GroqProvider.Transcription method comments and replace
the misleading "not supported" text with concise, accurate descriptions of the
current behavior (e.g., indicate that Speech handles BifrostSpeechRequest and
returns BifrostSpeechResponse, and Transcription handles
BifrostTranscriptionRequest and returns BifrostTranscriptionResponse), ensuring
the comments reflect that these methods are implemented and noting any relevant
constraints or supported features.
---
Nitpick comments:
In `@core/providers/groq/groq.go`:
- Line 181: The code currently passes the hardcoded constant schemas.Groq into
delegated calls; replace those occurrences with provider.GetProviderKey() so
provider identity respects aliases/custom keys—find usages where schemas.Groq is
passed (e.g., the call around the Groq provider delegation) and change the
argument to provider.GetProviderKey(), ensuring any error messages or
unsupported-operation strings use provider.GetProviderKey() as well.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b083916e-a096-4102-a502-3a5c8b95b9ff
📒 Files selected for processing (6)
core/internal/llmtests/speech_synthesis.gocore/internal/llmtests/transcription.gocore/internal/llmtests/utils.gocore/providers/groq/groq.gocore/providers/groq/groq_test.gocore/schemas/speech.go
75d1978 to
2f8d1a1
Compare
sammaji
left a comment
There was a problem hiding this comment.
@coderabbitai full review
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Merge activity
|

Summary
Adds speech synthesis and transcription support to the Groq provider.
Changes
Speech()method in Groq provider using OpenAI speech request handlerTranscription()method in Groq provider using OpenAI transcription request handlerGetProviderDefaultFormat()to return "wav" format for Groq providerType of change
Affected areas
How to test
Set up Groq API credentials and run the provider tests to validate speech synthesis and transcription functionality.
Screenshots/Recordings
N/A
Breaking changes
Related issues
Closes #2062
Security considerations
Uses existing OpenAI request handlers which maintain the same security patterns for API key handling and request validation.
Checklist
docs/contributing/README.mdand followed the guidelines