Sequential railway pipeline.
Steps execute in order. Each step receives the previous step's unwrapped
{:ok, value} result. The pipeline halts on the first {:error, reason}.
Ad-hoc usage
Pipeline.run([
fn query -> AI.chat([msg(query)], provider: :openai) end,
fn %Response{content: text} -> String.upcase(text) end
], "Hello")DSL usage
defmodule MyPipeline do
use PhoenixAI.Pipeline
step :search do
fn query -> AI.chat([msg(query)], provider: :openai) end
end
end
MyPipeline.run("Hello")
Summary
Functions
Executes a list of step functions sequentially.
Defines a named step in a pipeline module.
Types
Functions
Executes a list of step functions sequentially.
Each step receives the unwrapped value from the previous step's {:ok, value}.
Halts on first {:error, reason}. Raw (non-tuple) returns are auto-wrapped
in {:ok, value}.
Defines a named step in a pipeline module.
The block must return a function fn input -> {:ok, result} | {:error, reason} | term() end.