Octoroom.Agent.Processors.LLM (octoroom_agents v0.1.0)

Copy Markdown View Source

Streams the LLM's reply for each LLMContext.

Pushes LLMResponseStart, LLMText as text arrives, then ToolCalls if the model called tools, then LLMResponseEnd. Text after the first tool call isn't spoken: what came before it is the preamble ("let me check"). An interruption kills the request.

Options: :provider (:google, :openrouter, :openai) and :model, both needed; :reasoning_effort, :max_tokens, :provider_options, :stream (default true), :token (defaults to OPENAI_API_KEY for :openai; ReqLLM providers read their own keys), and :request, a fn opts, emit -> {:ok, response} | {:error, reason} end that replaces the provider (for tests; emit.({:text_delta, text}) streams text, as the providers' on_event callback does).