Files
cc-connect/core
54f27c1634 feat(speech): add Gemini as STT provider (#479)
Add Google Gemini as a speech-to-text provider, complementing the
existing OpenAI Whisper, Groq, and Qwen options. Gemini's multimodal
API accepts audio as inline base64 data and returns transcribed text.

This is useful for users who already have a Google AI Studio API key
(free tier available) and prefer not to set up separate STT service
accounts.

Changes:
- core/speech.go: GeminiSTT struct implementing SpeechToText interface
  via Gemini's generateContent endpoint with query-param auth
- config/config.go: [speech.gemini] config section (api_key, model)
- cmd/cc-connect/main.go: "gemini" case in provider switch
- core/speech_test.go: 6 unit tests covering success, language param,
  API errors, empty response, and invalid JSON

Config example:
  [speech]
    enabled = true
    provider = "gemini"
  [speech.gemini]
    api_key = "AIza..."
    model = "gemini-flash-latest"

Co-authored-by: Cigarrr <cigarrr@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 22:26:14 +08:00
..
2026-02-28 10:38:24 +08:00