Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SpeechHandler ¶
type SpeechHandler struct {
// contains filtered or unexported fields
}
SpeechHandler handles voice-dictation transcription requests.
func NewSpeechHandler ¶
func NewSpeechHandler( transcriber SpeechTranscriber, enhancer TranscriptionEnhancer, logger kernel.Logger, ) *SpeechHandler
NewSpeechHandler creates a new SpeechHandler. A nil logger degrades to a discard sink so the handler is safe to construct in any context.
func (*SpeechHandler) Transcribe ¶
func (h *SpeechHandler) Transcribe(w http.ResponseWriter, r *http.Request)
Transcribe handles the "Dictate with AI" endpoint: it transcribes the uploaded WAV, enhances the transcript into TipTap content, and returns both plus SEO metadata.
type SpeechTranscriber ¶
type SpeechTranscriber interface {
Transcribe(
ctx context.Context,
audio []byte,
language string,
) (speechdomain.Transcription, error)
}
SpeechTranscriber is the speech-to-text port the handler transcribes uploads with. Provider adapters implement it in infrastructure.
type TranscriptionEnhancer ¶
type TranscriptionEnhancer interface {
EnhanceTranscription(
ctx context.Context,
transcript string,
) (textgendomain.EnhanceResult, error)
}
TranscriptionEnhancer turns a raw transcript into a polished TipTap document. The text generation service satisfies it structurally once the dictation prompt ships.