> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# base • AI Agent SDK

> Base classes for PraisonAI Agent tools.

# base

<Badge color="blue">AI Agent</Badge>

Base classes for PraisonAI Agent tools.

This module provides the foundation for creating tools that can be used by agents.
External developers can create plugins by subclassing BaseTool.

Usage:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import BaseTool

class MyTool(BaseTool):
    name = "my_tool"
    description = "Does something useful"

    def run(self, query: str) -> str:
        return f"Result for {query}"
```

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.tools import base
```

## Classes

<CardGroup cols={2}>
  <Card title="ToolValidationError" icon="brackets-curly" href="../classes/ToolValidationError">
    Raised when a tool fails validation.
  </Card>

  <Card title="ToolResult" icon="brackets-curly" href="../classes/ToolResult">
    Wrapper for tool execution results.
  </Card>

  <Card title="BaseTool" icon="brackets-curly" href="../classes/BaseTool">
    Abstract base class for all PraisonAI tools.
  </Card>
</CardGroup>

## Functions

<CardGroup cols={2}>
  <Card title="resolve_model_output()" icon="function" href="../functions/resolve_model_output">
    Return a tool result's own compact, model-facing view, or `None`.
  </Card>

  <Card title="multimodal_content()" icon="function" href="../functions/multimodal_content">
    Convenience factory for building a multimodal ToolResult.
  </Card>

  <Card title="text_part()" icon="function" href="../functions/text_part">
    Build a text content part.
  </Card>

  <Card title="image_part()" icon="function" href="../functions/image_part">
    Build an image content part from raw bytes/base64 or a URL/data URI.
  </Card>

  <Card title="file_part()" icon="function" href="../functions/file_part">
    Build a generic file content part from raw bytes/base64 or a URL.
  </Card>

  <Card title="validate_tool()" icon="function" href="../functions/validate_tool">
    Validate any tool-like object.
  </Card>

  <Card title="validate_tool_schema_consistency()" icon="function" href="../functions/validate_tool_schema_consistency">
    Validate a list of tools for schema consistency with OpenAI format.
  </Card>

  <Card title="get_sorted_tool_schemas()" icon="function" href="../functions/get_sorted_tool_schemas">
    Get tool schemas sorted by function name for deterministic ordering.
  </Card>
</CardGroup>
