You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(live): support translate voices, bidiGenerateContent method, and status 4/14 #354
internal/api/gemini.go: add "bidiGenerateContent" to geminiServedMethods so /v1beta/models/*:bidiGenerateContent is recognized as a served Gemini method (returning 400 WebSocket upgrade guidance on plain HTTP rather than falling through as an unserved method).
internal/aistudio/bidi.go:
Allow request.Voice in bidiVariantTranslation and encode configuration[15] (SpeechConfig: [voiceConfig, languageCode]) when Voice or TargetLanguage is set for gemini-4-live-translate.
Support voice_ / voicekey_ replicated custom voice identifiers in encodeBidiVoiceConfig (VoiceConfig field 5[voiceId] instead of prebuiltVoiceConfig field 1).
Map gRPC status codes 4 (DEADLINE_EXCEEDED -> 504) and 14 (UNAVAILABLE -> 503) in parseBidiStatusPayload.
internal/aistudio/bidi_test.go, internal/api/gemini_live_test.go: add unit tests covering translation voice/language encoding, replicated voice encoding, gRPC status 4/14 mapping, and geminiServedMethods handling for bidiGenerateContent.
验证 / Verification
Ran go test -mod=readonly -trimpath ./internal/aistudio/... ./internal/api/... — all tests pass (internal/aistudio0.047s, internal/api0.090s).
Ran go vet -mod=readonly ./internal/aistudio/... ./internal/api/... — passed with no issues.
Activity