Behaviour for speech-to-text adapters.
Streaming is modelled as a state machine:
stream_start/1→ opaque stream refstream_chunk/2→ feed audio, get updated refstream_end/1→ finalise, return transcript
Implementations may proxy real streaming APIs or buffer locally.
Summary
Types
Callbacks
@callback stream_chunk(stream_ref(), chunk :: binary()) :: {:ok, stream_ref()} | {:error, term()}
@callback stream_end(stream_ref()) :: {:ok, transcript()} | {:error, term()}
@callback stream_start(opts :: keyword()) :: {:ok, stream_ref()} | {:error, term()}
@callback transcribe(audio :: binary(), opts :: keyword()) :: {:ok, transcript()} | {:error, term()}