Synaptic.Voice.StreamingTTSAdapter behaviour (synaptic v0.3.0-alpha.9)

View Source

Optional behaviour for providers that can synthesize a single assistant turn over a persistent TTS stream.

Summary

Callbacks

cancel_stream(stream)

@callback cancel_stream(stream :: pid()) :: :ok

finish_stream(stream, opts)

@callback finish_stream(stream :: pid(), opts :: keyword()) :: :ok

push_text(stream, text_chunk, opts)

@callback push_text(stream :: pid(), text_chunk :: String.t(), opts :: keyword()) :: :ok

start_stream(owner, opts)

@callback start_stream(owner :: pid(), opts :: keyword()) ::
  {:ok, pid()} | {:error, term()}

stop(stream, reason)

@callback stop(stream :: pid(), reason :: term()) :: :ok