API Reference sycophant v#0.4.2

Copy Markdown

Modules

Unified Elixir client for multiple LLM providers.

Decoder for the AWS event stream binary framing protocol.

GenStateMachine-based agent that manages LLM conversations with tool execution, callbacks, statistics tracking, and telemetry.

Callback function types for agent lifecycle hooks.

Internal state for the agent GenStateMachine process.

Tracks token usage and cost across agent turns.

Usage snapshot for a single LLM call within an agent run.

Telemetry events for the agent lifecycle.

Behaviour and registry for provider authentication strategies.

Authentication strategy for the Anthropic API.

Authentication strategy for Azure AI Foundry.

Default authentication strategy using a Bearer token in the Authorization header. Used by OpenAI, OpenRouter, and most OpenAI-compatible providers.

Authentication strategy for AWS Bedrock using SigV4 request signing.

Authentication strategy for GitHub Copilot.

Performs the GitHub->Copilot token exchange.

Supervised GenServer that caches Copilot tokens per {github_host, sha256(gh_token)}.

Authentication strategy for the Google Gemini API.

Centralized configuration for Sycophant with schema validation.

Schema for provider-specific credentials.

Schema for Tesla HTTP client configuration.

Public conversation handle for multi-turn LLM interactions.

Three-layer credential resolution for LLM providers.

Canonical embedding parameters with Zoi validation.

Orchestrates the embedding request lifecycle.

Input struct for embedding requests.

The result of an embedding request.

Behaviour for embedding wire protocol adapters.

Wire protocol adapter for AWS Bedrock embedding models.

Wire protocol adapter for OpenAI-compatible embedding APIs.

Root error module for Sycophant, built on Splode.

Represents a message in a conversation.

Image content part for multimodal messages.

Redacted/encrypted thinking content part for assistant messages.

Text content part for multimodal messages.

Thinking content part for assistant messages with extended reasoning.

Resolves model identifiers into pipeline-ready metadata.

OpenTelemetry bridge for Sycophant telemetry events.

Shared Zoi schema fragments for LLM parameters.

Orchestrates the full LLM request lifecycle.

Represents pricing metadata from LLMDB's component-based pricing model.

A single pricing component from LLMDB's pricing model.

Reasoning output from an LLM response.

Extensible registry for auth strategies and wire protocols.

Internal struct representing a normalized LLM request.

The result of an LLM call.

Validates LLM response text against a JSON Schema.

Converts Zoi schemas to JSON Schema maps.

Holds a normalized JSON Schema alongside its pre-resolved form and origin tag.

Normalizes Zoi or JSON Schema input into a NormalizedSchema.

Validates JSON-decoded data against a NormalizedSchema using ex_json_schema.

Protocol for converting Sycophant structs to plain maps for JSON serialization.

Decodes plain maps back into Sycophant structs using "__type__" discriminators.

A streaming event delivered to the caller's stream callback.

Telemetry events for observability and metrics.

Tesla middleware for recording and replaying HTTP exchanges in tests.

Defines a tool that can be provided to an LLM.

Represents a tool invocation requested by the LLM.

Automatic tool execution loop.

HTTP transport layer built on Tesla.

Token usage statistics from an LLM response.

Behaviour for chat wire protocol adapters.

Wire protocol adapter for the Anthropic Messages API format.

Wire protocol adapter for the AWS Bedrock Converse API format.

Wire protocol adapter for GitHub Copilot's chat surface.

Wire protocol adapter for the Google Gemini API format.

Wire protocol adapter for the OpenAI Chat Completions API format.

Wire protocol adapter for the OpenAI Responses API format.