Sycophant.Pipeline
(sycophant v0.4.2)
Copy Markdown
Orchestrates the full LLM request lifecycle.
The pipeline executes these steps in order:
- Model Resolution - Resolves the model spec to provider metadata via LLMDB
- Parameter Validation - Validates LLM parameters through Zoi schemas
- Credential Resolution - Finds credentials (per-request > app config > env vars)
- Wire Encoding - Converts the request into provider-specific JSON
- HTTP Transport - Sends the request via Tesla (sync or streaming)
- Wire Decoding - Parses the provider response back into Sycophant structs
- Tool Execution - Auto-executes tool calls if tools have functions set
- Cost Enrichment - Calculates token costs from LLMDB pricing data
- Response Validation - Validates structured output against schema if provided
- Context Attachment - Stores conversation state for continuation
Summary
Functions
Executes a full LLM request pipeline: resolves model, validates params, encodes, transports, and decodes.
Functions
@spec call( [Sycophant.Message.t()], keyword() ) :: {:ok, Sycophant.Response.t()} | {:error, Splode.Error.t()}
Executes a full LLM request pipeline: resolves model, validates params, encodes, transports, and decodes.