infrastructure

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL