Documentation
¶
Overview ¶
Package infrastructure adapts the speech module's domain port onto speech-to-text provider APIs. Transport and provider response parsing live here; audio validation stays in the domain's WAV validator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetaSpeechService ¶
type MetaSpeechService struct {
// contains filtered or unexported fields
}
MetaSpeechService transcribes audio with Meta Model API's Muse Voice Transcribe model over the multipart file endpoint.
func NewMetaSpeechService ¶
func NewMetaSpeechService(apiKey, baseURL, model string, httpClient *http.Client) *MetaSpeechService
NewMetaSpeechService creates a Muse Voice Transcribe client. baseURL is optional — pass "" for the Meta Model API default. A nil httpClient gets a deadline-free client; the caller's context bounds the request.
func (*MetaSpeechService) Transcribe ¶
func (s *MetaSpeechService) Transcribe( ctx context.Context, audio []byte, language string, ) (speechdomain.Transcription, error)
Transcribe uploads WAV audio to Meta Model API and returns the transcript with its detected turns. Language is an optional bias hint; empty means auto-detect.
type OpenAISpeechService ¶
type OpenAISpeechService struct {
// contains filtered or unexported fields
}
OpenAISpeechService transcribes audio with any OpenAI-compatible transcription endpoint (POST /v1/audio/transcriptions).
func NewOpenAISpeechService ¶
func NewOpenAISpeechService(apiKey, baseURL, model string, httpClient *http.Client) *OpenAISpeechService
NewOpenAISpeechService creates an OpenAI-compatible transcription client. baseURL is required (e.g. "https://api.openai.com", "http://localhost:11434/v1"). A nil httpClient gets a deadline-free client; the caller's context bounds the request.
func (*OpenAISpeechService) Transcribe ¶
func (s *OpenAISpeechService) Transcribe( ctx context.Context, audio []byte, language string, ) (speechdomain.Transcription, error)
Transcribe uploads WAV audio to the transcription endpoint and returns the text. Language is an optional ISO-639-1 hint; empty means auto-detect.