Codex.Voice.Models.OpenAISTTSession (Codex SDK v0.16.1)

Copy Markdown View Source

Buffered streamed transcription session.

This GenServer consumes a StreamedAudioInput until it closes, then submits the aggregated audio to the configured STT model and yields completed transcript turns to callers.

Summary

Functions

Returns a specification to start this module under a supervisor.

Start a new streaming transcription session.

Types

t()

@type t() :: %Codex.Voice.Models.OpenAISTTSession{
  api_key: String.t() | nil,
  completion: :done | {:error, term()} | nil,
  input: Codex.Voice.Input.StreamedAudioInput.t(),
  listener_task: Task.t() | nil,
  model: String.t(),
  settings: Codex.Voice.Config.STTSettings.t(),
  stream_task: Task.t() | nil,
  stt_model: Codex.Voice.Models.OpenAISTT.t(),
  trace_include_sensitive_audio_data: boolean(),
  trace_include_sensitive_data: boolean(),
  transcripts: [String.t()],
  waiters: [{GenServer.from(), reference()}],
  websocket: pid() | nil
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Start a new streaming transcription session.

Options

  • :input - StreamedAudioInput to read audio from (required)
  • :settings - STTSettings for transcription options (required)
  • :stt_model - Optional OpenAISTT model struct to use as-is
  • :model - Model name to use when :stt_model is not provided
  • :api_key - API key (defaults to OPENAI_API_KEY env var)
  • :base_url - API base URL when :stt_model is not provided
  • :client - Optional HTTP client when :stt_model is not provided
  • :trace_include_sensitive_data - Whether to include text in traces
  • :trace_include_sensitive_audio_data - Whether to include audio in traces