API Reference alloy v#0.7.4

Copy Markdown View Source

Modules

Model-agnostic agent harness for Elixir.

Configuration for an agent run.

Event envelope construction and runtime opts normalization.

OTP-backed persistent agent process.

Mutable state for an agent run.

The core agent loop.

Manus-style context compaction.

Estimates token counts using a chars/4 heuristic.

Normalized message struct used throughout Alloy.

Behaviour for middleware that wraps the agent loop.

Provider model metadata used for context budgeting.

Behaviour for LLM providers.

Provider for Anthropic's Claude Messages API.

Provider for OpenAI's Responses API.

Generic OpenAI-compatible provider.

Shared OpenAI-format SSE stream parser.

Provider retry, backoff, fallback, and streaming dispatch logic.

Shared SSE (Server-Sent Events) framing utilities.

A scripted test provider that returns pre-configured responses in order.

Structured result from an agent run.

Serializable session container.

ExUnit helpers for testing agents built with Alloy.

Behaviour for tools that agents can call.

Built-in tool: execute shell commands via bash -rc (restricted shell).

Built-in tool: search-and-replace edits on files.

Built-in tool: read files with line numbers.

Built-in tool: write files, creating parent directories as needed.

Executes tool calls and returns result messages.

Builds tool schemas and function maps from tool modules.

Token usage tracking across turns.