rename TranscriptionAdapter to BatchAdapter, add StreamingAdapter interface

This commit is contained in:
leonardotrapani
2026-02-01 00:35:38 +01:00
parent c23ac60b8f
commit db7e3951a5
12 changed files with 57 additions and 22 deletions
+25
View File
@@ -0,0 +1,25 @@
package transcriber
import "context"
// TranscriptionResult represents a single transcription result from a streaming adapter
type TranscriptionResult struct {
Text string // the transcription text (partial or final)
IsFinal bool // true if this is a final result, false for interim results
Error error // non-nil if an error occurred
}
// StreamingAdapter interface for streaming transcription backends (send audio in real-time)
type StreamingAdapter interface {
// Start initiates the streaming connection with the given language setting
Start(ctx context.Context, language string) error
// SendChunk sends a chunk of audio data to the transcription service
SendChunk(audio []byte) error
// Results returns a channel that receives transcription results (partial and final)
Results() <-chan TranscriptionResult
// Close gracefully closes the streaming connection
Close() error
}