added models and voice Id in types#713
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis change introduces new enum types for TTS voice models and IDs (ElevenLabs and Cartesia) and LLM models (Azure and Google Vertex), then extends the configuration options handler to expose these enums as selectable options via API endpoints. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds explicit enumerations for TTS voice models/voice IDs and LLM model names, and exposes these as selectable options via the Breeze Buddy playground configuration options endpoint.
Changes:
- Introduces
ElevenLabsVoiceModel/IdandCartesiaVoiceModel/Idenums in Breeze Buddy template types. - Introduces
AzureLLMModelandGoogleVertexModelenums in shared LLM types. - Extends the playground
/playground/configurations/optionsresponse withtts_voice_models,tts_voice_ids, andllm_models.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| app/api/routers/breeze_buddy/playground/handlers.py | Adds TTS voice model/ID option lists and LLM model option lists to the playground options response. |
| app/ai/voice/llm/types.py | Adds enums for Azure and Vertex model names. |
| app/ai/voice/agents/breeze_buddy/template/types.py | Adds enums enumerating known TTS voice models and voice IDs for ElevenLabs and Cartesia. |
| # LLM models per provider (keyed by provider or provider__sdk) | ||
| llm_models = { | ||
| LLMProvider.AZURE.value: [ | ||
| {"value": m.value, "label": m.value} for m in AzureLLMModel | ||
| ], | ||
| LLMProvider.GOOGLE_VERTEX.value: [ | ||
| {"value": m.value, "label": m.value} for m in GoogleVertexModel | ||
| ], |
There was a problem hiding this comment.
llm_models is keyed only by provider, but Vertex model choice is SDK-dependent (Gemini via Google SDK vs Claude via Anthropic SDK). As-is, the options list can surface claude-3-5-sonnet even when the user selects google_vertex + sdk=google, which will route to the Gemini build_vertex_llm path and likely fail at runtime. Consider keying Vertex model options the same way as llm_thinking_fields (e.g., google_vertex__google vs google_vertex__anthropic) and separating Gemini vs Claude model lists accordingly.
| # LLM models per provider (keyed by provider or provider__sdk) | |
| llm_models = { | |
| LLMProvider.AZURE.value: [ | |
| {"value": m.value, "label": m.value} for m in AzureLLMModel | |
| ], | |
| LLMProvider.GOOGLE_VERTEX.value: [ | |
| {"value": m.value, "label": m.value} for m in GoogleVertexModel | |
| ], | |
| # LLM models per provider (azure) or provider__sdk (google_vertex) | |
| llm_models = { | |
| LLMProvider.AZURE.value: [ | |
| {"value": m.value, "label": m.value} for m in AzureLLMModel | |
| ], | |
| f"{LLMProvider.GOOGLE_VERTEX.value}__{LLMSdk.GOOGLE.value}": [ | |
| {"value": m.value, "label": m.value} | |
| for m in GoogleVertexModel | |
| if not m.value.startswith("claude-") | |
| ], | |
| f"{LLMProvider.GOOGLE_VERTEX.value}__{LLMSdk.ANTHROPIC.value}": [ | |
| {"value": m.value, "label": m.value} | |
| for m in GoogleVertexModel | |
| if m.value.startswith("claude-") | |
| ], |
| llm_models = { | ||
| LLMProvider.AZURE.value: [ | ||
| {"value": m.value, "label": m.value} for m in AzureLLMModel |
There was a problem hiding this comment.
The Azure model options here only include gpt-4o, but the Breeze Buddy Azure default is gpt-4o-automatic (see AZURE_BREEZE_BUDDY_OPENAI_MODEL default). If the playground UI relies on this list to populate a dropdown, users may be unable to select the currently configured default. Consider adding the default model string to AzureLLMModel (or generating the options from config + known models) so the options reflect what the backend actually supports.
| llm_models = { | |
| LLMProvider.AZURE.value: [ | |
| {"value": m.value, "label": m.value} for m in AzureLLMModel | |
| azure_model_values = list(dict.fromkeys([*(m.value for m in AzureLLMModel), "gpt-4o-automatic"])) | |
| llm_models = { | |
| LLMProvider.AZURE.value: [ | |
| {"value": model_value, "label": model_value} | |
| for model_value in azure_model_values |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
app/api/routers/breeze_buddy/playground/handlers.py (1)
154-162: Alignllm_modelskeying with SDK-specific payload shape.Lines 154-162 key Google Vertex models by provider only, while
llm_thinking_fieldsis keyed byprovider__sdk. Using the same key contract helps prevent invalid SDK/model combinations in the UI flow.Suggested refactor
llm_models = { LLMProvider.AZURE.value: [ {"value": m.value, "label": m.value} for m in AzureLLMModel ], - LLMProvider.GOOGLE_VERTEX.value: [ - {"value": m.value, "label": m.value} for m in GoogleVertexModel + f"{LLMProvider.GOOGLE_VERTEX.value}__{LLMSdk.GOOGLE.value}": [ + {"value": GoogleVertexModel.GEMINI_2_0_FLASH.value, "label": GoogleVertexModel.GEMINI_2_0_FLASH.value} + ], + f"{LLMProvider.GOOGLE_VERTEX.value}__{LLMSdk.ANTHROPIC.value}": [ + {"value": GoogleVertexModel.CLAUDE_3_5_SONNET.value, "label": GoogleVertexModel.CLAUDE_3_5_SONNET.value} ], }Also applies to: 179-179
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/api/routers/breeze_buddy/playground/handlers.py` around lines 154 - 162, The llm_models mapping uses provider-only keys for Google Vertex while the UI expects provider__sdk keys like llm_thinking_fields; update the llm_models dict so keys follow the provider__sdk contract (e.g., use f"{LLMProvider.GOOGLE_VERTEX.value}__vertex" or the appropriate SDK suffix) for Google Vertex entries (and any other non-Azure providers), keeping the same value lists generated from GoogleVertexModel and AzureLLMModel; also apply the same key change to the similar block referenced around the later occurrence (the other llm_models usage at ~179) so model-to-SDK combinations are validated consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/api/routers/breeze_buddy/playground/handlers.py`:
- Around line 130-152: The tts_voice_models and tts_voice_ids mappings omit the
TTSProvider.SARVAM entries while tts_providers includes "sarvam", causing
missing-key runtime issues; update the dictionaries tts_voice_models and
tts_voice_ids to include a key for TTSProvider.SARVAM.value with an appropriate
list (even if empty or a placeholder) so the client always finds a defined value
for every provider in TTSProvider; locate the references to tts_voice_models and
tts_voice_ids alongside the enums ElevenLabsVoiceModel, CartesiaVoiceModel,
ElevenLabsVoiceId, and CartesiaVoiceId and add the SARVAM entries (and mirror
this change where similar maps are created later) to keep provider maps
exhaustive.
---
Nitpick comments:
In `@app/api/routers/breeze_buddy/playground/handlers.py`:
- Around line 154-162: The llm_models mapping uses provider-only keys for Google
Vertex while the UI expects provider__sdk keys like llm_thinking_fields; update
the llm_models dict so keys follow the provider__sdk contract (e.g., use
f"{LLMProvider.GOOGLE_VERTEX.value}__vertex" or the appropriate SDK suffix) for
Google Vertex entries (and any other non-Azure providers), keeping the same
value lists generated from GoogleVertexModel and AzureLLMModel; also apply the
same key change to the similar block referenced around the later occurrence (the
other llm_models usage at ~179) so model-to-SDK combinations are validated
consistently.
🪄 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: 9b94338f-2c10-45e1-8676-7ad72ac66b28
📒 Files selected for processing (3)
app/ai/voice/agents/breeze_buddy/template/types.pyapp/ai/voice/llm/types.pyapp/api/routers/breeze_buddy/playground/handlers.py
dbed996 to
04200a7
Compare
| RAJU = "pzxut4zZz4GImZNlqQ3H" | ||
|
|
||
|
|
||
| class CartesiaVoiceModel(str, Enum): |
There was a problem hiding this comment.
@kanakagrawal-crypto When models change we need to again change these types, can you check if these providers have any api exposed which lists the models that they have ?
Summary by CodeRabbit