# sycophant v0.4.2 - Table of Contents

You are absolutely right if you use this lib!

## Pages

- [Overview](readme.md)
- [Changelog](changelog.md)
- [License](license.md)

- Guides
  - [Getting Started](getting-started.md)
  - [Architecture](architecture.md)
  - [Tool Use](tool-use.md)
  - [Error Handling](error-handling.md)
  - [Telemetry](telemetry.md)
  - [Pricing and Cost Tracking](pricing.md)
  - [Agent Mode](agent-mode.md)
  - [Serialization](serialization.md)
  - [HTTP Configuration](http-configuration.md)
  - [GitHub Copilot](github-copilot.md)

- Extending Sycophant
  - [Custom Providers](custom-providers.md)
  - [Recording Tests](recording-tests.md)

## Modules

- [Sycophant.Config.Provider](Sycophant.Config.Provider.md): Schema for provider-specific credentials.
- [Sycophant.Config.Tesla](Sycophant.Config.Tesla.md): Schema for Tesla HTTP client configuration.
- [Sycophant.Pricing](Sycophant.Pricing.md): Represents pricing metadata from LLMDB's component-based pricing model.
- [Sycophant.Pricing.Component](Sycophant.Pricing.Component.md): A single pricing component from LLMDB's pricing model.
- [Sycophant.Schema.NormalizedSchema](Sycophant.Schema.NormalizedSchema.md): Holds a normalized JSON Schema alongside its pre-resolved form and origin tag.
- [Sycophant.Schema.Normalizer](Sycophant.Schema.Normalizer.md): Normalizes Zoi or JSON Schema input into a `NormalizedSchema`.
- [Sycophant.Schema.Validator](Sycophant.Schema.Validator.md): Validates JSON-decoded data against a `NormalizedSchema` using `ex_json_schema`.
- [Sycophant.Tesla.RecorderMiddleware](Sycophant.Tesla.RecorderMiddleware.md): Tesla middleware for recording and replaying HTTP exchanges in tests.
- [Sycophant.Auth.GithubCopilot.Exchange](Sycophant.Auth.GithubCopilot.Exchange.md): Performs the GitHub->Copilot token exchange.
- [Sycophant.Auth.GithubCopilot.TokenCache](Sycophant.Auth.GithubCopilot.TokenCache.md): Supervised GenServer that caches Copilot tokens per `{github_host, sha256(gh_token)}`.
- [Sycophant.Message.Content.RedactedThinking](Sycophant.Message.Content.RedactedThinking.md): Redacted/encrypted thinking content part for assistant messages.
- [Sycophant.Message.Content.Thinking](Sycophant.Message.Content.Thinking.md): Thinking content part for assistant messages with extended reasoning.
- [Sycophant.WireProtocol.CopilotChat](Sycophant.WireProtocol.CopilotChat.md): Wire protocol adapter for GitHub Copilot's chat surface.

- Client API
  - [Sycophant](Sycophant.md): Unified Elixir client for multiple LLM providers.
  - [Sycophant.Context](Sycophant.Context.md): Public conversation handle for multi-turn LLM interactions.
  - [Sycophant.Message](Sycophant.Message.md): Represents a message in a conversation.
  - [Sycophant.Request](Sycophant.Request.md): Internal struct representing a normalized LLM request.
  - [Sycophant.Response](Sycophant.Response.md): The result of an LLM call.
  - [Sycophant.Message.Content.Image](Sycophant.Message.Content.Image.md): Image content part for multimodal messages.
  - [Sycophant.Message.Content.Text](Sycophant.Message.Content.Text.md): Text content part for multimodal messages.

- Tools &amp; Execution
  - [Sycophant.Tool](Sycophant.Tool.md): Defines a tool that can be provided to an LLM.
  - [Sycophant.ToolCall](Sycophant.ToolCall.md): Represents a tool invocation requested by the LLM.
  - [Sycophant.ToolExecutor](Sycophant.ToolExecutor.md): Automatic tool execution loop.

- Agent
  - [Sycophant.Agent](Sycophant.Agent.md): GenStateMachine-based agent that manages LLM conversations with tool execution,
callbacks, statistics tracking, and telemetry.
  - [Sycophant.Agent.Callbacks](Sycophant.Agent.Callbacks.md): Callback function types for agent lifecycle hooks.
  - [Sycophant.Agent.State](Sycophant.Agent.State.md): Internal state for the agent GenStateMachine process.

  - [Sycophant.Agent.Stats](Sycophant.Agent.Stats.md): Tracks token usage and cost across agent turns.

  - [Sycophant.Agent.Stats.Turn](Sycophant.Agent.Stats.Turn.md): Usage snapshot for a single LLM call within an agent run.

  - [Sycophant.Agent.Telemetry](Sycophant.Agent.Telemetry.md): Telemetry events for the agent lifecycle.

- Pipeline
  - [Sycophant.ModelResolver](Sycophant.ModelResolver.md): Resolves model identifiers into pipeline-ready metadata.
  - [Sycophant.Pipeline](Sycophant.Pipeline.md): Orchestrates the full LLM request lifecycle.
  - [Sycophant.ResponseValidator](Sycophant.ResponseValidator.md): Validates LLM response text against a JSON Schema.

- Wire Protocols
  - [Sycophant.WireProtocol](Sycophant.WireProtocol.md): Behaviour for chat wire protocol adapters.
  - [Sycophant.WireProtocol.AnthropicMessages](Sycophant.WireProtocol.AnthropicMessages.md): Wire protocol adapter for the Anthropic Messages API format.
  - [Sycophant.WireProtocol.BedrockConverse](Sycophant.WireProtocol.BedrockConverse.md): Wire protocol adapter for the AWS Bedrock Converse API format.
  - [Sycophant.WireProtocol.GoogleGemini](Sycophant.WireProtocol.GoogleGemini.md): Wire protocol adapter for the Google Gemini API format.
  - [Sycophant.WireProtocol.OpenAICompletions](Sycophant.WireProtocol.OpenAICompletions.md): Wire protocol adapter for the OpenAI Chat Completions API format.
  - [Sycophant.WireProtocol.OpenAIResponses](Sycophant.WireProtocol.OpenAIResponses.md): Wire protocol adapter for the OpenAI Responses API format.

- Embeddings
  - [Sycophant.EmbeddingParams](Sycophant.EmbeddingParams.md): Canonical embedding parameters with Zoi validation.
  - [Sycophant.EmbeddingPipeline](Sycophant.EmbeddingPipeline.md): Orchestrates the embedding request lifecycle.
  - [Sycophant.EmbeddingRequest](Sycophant.EmbeddingRequest.md): Input struct for embedding requests.
  - [Sycophant.EmbeddingResponse](Sycophant.EmbeddingResponse.md): The result of an embedding request.
  - [Sycophant.EmbeddingWireProtocol](Sycophant.EmbeddingWireProtocol.md): Behaviour for embedding wire protocol adapters.
  - [Sycophant.EmbeddingWireProtocol.BedrockEmbed](Sycophant.EmbeddingWireProtocol.BedrockEmbed.md): Wire protocol adapter for AWS Bedrock embedding models.
  - [Sycophant.EmbeddingWireProtocol.OpenAIEmbed](Sycophant.EmbeddingWireProtocol.OpenAIEmbed.md): Wire protocol adapter for OpenAI-compatible embedding APIs.

- Authentication
  - [Sycophant.Auth](Sycophant.Auth.md): Behaviour and registry for provider authentication strategies.
  - [Sycophant.Auth.Anthropic](Sycophant.Auth.Anthropic.md): Authentication strategy for the Anthropic API.
  - [Sycophant.Auth.Azure](Sycophant.Auth.Azure.md): Authentication strategy for Azure AI Foundry.
  - [Sycophant.Auth.Bearer](Sycophant.Auth.Bearer.md): Default authentication strategy using a Bearer token in the
Authorization header. Used by OpenAI, OpenRouter, and most
OpenAI-compatible providers.

  - [Sycophant.Auth.Bedrock](Sycophant.Auth.Bedrock.md): Authentication strategy for AWS Bedrock using SigV4 request signing.
  - [Sycophant.Auth.GithubCopilot](Sycophant.Auth.GithubCopilot.md): Authentication strategy for GitHub Copilot.
  - [Sycophant.Auth.Google](Sycophant.Auth.Google.md): Authentication strategy for the Google Gemini API.

- Telemetry &amp; Observability
  - [Sycophant.OpenTelemetry](Sycophant.OpenTelemetry.md): OpenTelemetry bridge for Sycophant telemetry events.
  - [Sycophant.Telemetry](Sycophant.Telemetry.md): Telemetry events for observability and metrics.

- Serialization
  - [Sycophant.Serializable](Sycophant.Serializable.md): Protocol for converting Sycophant structs to plain maps for JSON serialization.
  - [Sycophant.Serializable.Decoder](Sycophant.Serializable.Decoder.md): Decodes plain maps back into Sycophant structs using `"__type__"` discriminators.

- Configuration
  - [Sycophant.Config](Sycophant.Config.md): Centralized configuration for Sycophant with schema validation.
  - [Sycophant.Credentials](Sycophant.Credentials.md): Three-layer credential resolution for LLM providers.
  - [Sycophant.ParamDefs](Sycophant.ParamDefs.md): Shared Zoi schema fragments for LLM parameters.

- Data Types
  - [Sycophant.Reasoning](Sycophant.Reasoning.md): Reasoning output from an LLM response.
  - [Sycophant.StreamChunk](Sycophant.StreamChunk.md): A streaming event delivered to the caller's stream callback.
  - [Sycophant.Usage](Sycophant.Usage.md): Token usage statistics from an LLM response.

- Errors
  - [Sycophant.Error](Sycophant.Error.md): Root error module for Sycophant, built on Splode.

- Infrastructure
  - [Sycophant.AWS.EventStream](Sycophant.AWS.EventStream.md): Decoder for the AWS event stream binary framing protocol.
  - [Sycophant.Registry](Sycophant.Registry.md): Extensible registry for auth strategies and wire protocols.
  - [Sycophant.Schema.JsonSchema](Sycophant.Schema.JsonSchema.md): Converts Zoi schemas to JSON Schema maps.
  - [Sycophant.Transport](Sycophant.Transport.md): HTTP transport layer built on Tesla.

