mix pixir.smoke.workflows.echo_provider (pixir v0.1.0)

Copy Markdown View Source

Summary

Functions

Produces a deterministic assistant-like summary based on the first :user_message in state.history.

Functions

stream(map, opts)

@spec stream(map(), Keyword.t()) :: {:ok, map()}

Produces a deterministic assistant-like summary based on the first :user_message in state.history.

If the first user message contains a line starting with Step:, the identifier after that prefix is used; otherwise "unknown" is used. Returns an {:ok, map} shaped like a workflow provider response with text set to "summary:<step>", empty reasoning fields, no function calls, and finish_reason: :stop.

Parameters

  • state: Map containing a :history key with a list of message maps (each message is expected to have :type and data["text"]).
  • _opts: Unused options (kept for provider compatibility).

Examples

iex> Mix.Tasks.Pixir.Smoke.Workflows.EchoProvider.stream(%{history: [%{type: :user_message, data: %{"text" => "Step: alpha"}}]}, [])
{:ok, %{text: "summary:alpha", reasoning: "", reasoning_items: [], function_calls: [], finish_reason: :stop}}