Skip to content

API Reference

This section provides detailed API documentation for the Azad codebase, generated from docstrings and type annotations in the source code.

Core Components

Agent System

The Agent class is the core of Azad, managing tasks, handling tool calls, and coordinating the execution of the AI agent. It works with the Environment to interact with the outside world.

Task Management

The Task Lifecycle system manages the lifecycle of tasks, including entry, execution, and exit. Tasks are represented using the Mind Map data structure, which maintains the state of conversations and tool interactions.

AI Network

The AI Network component handles communication with language model providers, processes streaming responses, and manages context window exceeded errors with compression.

Prompt Dialects

The Prompt Dialect system supports multiple prompt formats (XML, Native, JSON) for different model requirements. Each dialect has its own parser and formatter.

Compression

The Compression system helps manage context windows for large conversations, using strategies like truncation and summarization.

Tools

Azad includes Predefined Tools for common operations, as well as support for server-executed tools requiring specific environments.

Package Structure

The Azad codebase is organized into the following packages:

  • azad: The root package containing the main agent, environment, and task lifecycle components.
  • azad.ainetwork: Components for communicating with language model providers.
  • azad.compression: Context window management and compression strategies.
  • azad.network: Network interfaces and protocols.
  • azad.predefined_tools: Built-in tools for common operations.
  • azad.prompts: Prompt formatting and parsing for different dialects.
  • azad.server_tools: Server-executed tools requiring specific environments.
  • azad.slipstream: Network communication and protocol handling.

Using the API Reference

Each module's documentation includes:

  • Class and function signatures with type annotations
  • Docstrings explaining the purpose and usage
  • Parameter descriptions
  • Return value descriptions
  • Source code links

You can navigate the API reference using the sidebar, or search for specific classes, functions, or modules using the search bar.