Release Notes: v0.12.1¶
Release Date: 2026-06-14
Summary¶
Internal refactoring release that reduces code duplication across client packages. All public APIs remain unchanged.
What Changed¶
Generic Provider Client¶
Extracted common multi-provider management logic into a new provider.Client[T] generic type. This is embedded by domain-specific clients:
// Before: Each client had duplicate code
type Client struct {
providers map[string]Provider
primary string
fallbacks []string
// ... 30+ lines of duplicate methods
}
// After: Embed generic client
type Client struct {
*provider.Client[Provider]
hook observability.TTSHook // Domain-specific fields only
}
Affected packages:
tts.Client— embedsprovider.Client[tts.Provider]stt.Client— embedsprovider.Client[stt.Provider]realtime.Client— embedsprovider.Client[realtime.Provider]
AudioFormat Consolidation¶
Removed duplicate AudioFormat struct from realtime/provider.go. The audio/format package is now the single source of truth.
Added encoding-based aliases for provider-agnostic usage:
import "github.com/plexusone/omnivoice-core/audio/format"
// Provider-specific names (existing)
format.OpenAI // PCM16 24kHz mono
format.GeminiInput // PCM16 16kHz mono
// Encoding-based aliases (new)
format.PCM16_24kHz // Same as format.OpenAI
format.PCM16_16kHz // Same as format.GeminiInput
Impact¶
| Metric | Before | After |
|---|---|---|
| Duplicate client code | ~180 lines | 0 lines |
| AudioFormat definitions | 2 | 1 |
| Public API changes | — | None |
Installation¶
Migration Guide¶
From v0.12.0¶
No migration required. All public APIs are unchanged.
The only visible change is if you were using the internal realtime.FormatPCM16_24kHz or realtime.FormatPCM16_16kHz constants (which were undocumented). Use format.PCM16_24kHz or format.OpenAI instead:
// Before (if you used internal constants)
realtime.FormatPCM16_24kHz // Removed
// After
format.PCM16_24kHz // Or format.OpenAI
Full Changelog¶
See CHANGELOG.md for the complete list of changes.