feat: support config-level api_key for transcription#2112
feat: support config-level api_key for transcription#2112theonlyhennygod merged 1 commit intomainfrom
Conversation
|
Caution Review failedThe pull request is closed. Note
|
| Cohort / File(s) | Summary |
|---|---|
Config Schema & Persistence src/config/schema.rs, src/channels/mod.rs |
Added transcription.api_key field to TranscriptionConfig with encryption/decryption during load and save. Updated schema tests to verify round-trip serialization and default initialization. |
Transcription Credential Resolution src/channels/transcription.rs |
Updated transcribe_audio public API to accept &TranscriptionConfig parameter. Changed credential resolution to prioritize config.api_key over GROQ_API_KEY environment variable. Updated error messages and tests to reflect new resolution order. |
Gateway API Masking & Restoration src/gateway/api.rs |
Extended config masking, restoration, and hydration logic to handle the new transcription.api_key field during config save operations and mask/restore sensitive values. |
Sequence Diagram
sequenceDiagram
participant Loader as Config Loader
participant Store as Secret Store
participant Transcriber as transcribe_audio()
participant Config as TranscriptionConfig
participant GROQ as GROQ API
Loader->>Store: load_runtime_defaults_from_config_file
Store-->>Loader: decrypt transcription.api_key
Loader->>Config: transcription.api_key (decrypted)
Transcriber->>Config: Check config.api_key
alt config.api_key is set
Config-->>Transcriber: api_key from config
else config.api_key is empty
Transcriber->>Transcriber: Check GROQ_API_KEY env var
Transcriber-->>Transcriber: fallback to env var
end
Transcriber->>GROQ: POST with resolved api_key
GROQ-->>Transcriber: audio transcription result
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
✨ Finishing Touches
- 📝 Generate docstrings (stacked PR)
- 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
issue-2108-transcription-api-key
Comment @coderabbitai help to get the list of available commands and usage tips.
PR intake checks failed (blocking)Fast safe checks found blocking safety issues:
Action items:
Detected Linear keys: none Run logs: https://github.com/zeroclaw-labs/zeroclaw/actions/runs/22502205485 Detected blocking line issues (sample):
Detected advisory line issues (sample):
|
|
Thanks for contributing to ZeroClaw. For faster review, please ensure:
See |
Summary
transcription.api_keyto config schemaGROQ_API_KEYfallbackTesting
Closes #2108
Summary by CodeRabbit
New Features
Bug Fixes