Metadata-Version: 2.4
Name: agentmail-toolkit
Version: 0.3.0
Summary: AgentMail Toolkit
Requires-Python: >=3.11
Requires-Dist: agentmail>=0.4.10
Requires-Dist: filetype>=1.2.0
Requires-Dist: langchain>=1.1.0
Requires-Dist: livekit-agents>=1.3.5
Requires-Dist: openai-agents>=0.6.1
Requires-Dist: pydantic>=2.12.5
Requires-Dist: pymupdf>=1.26.6
Requires-Dist: python-docx>=1.2.0
Description-Content-Type: text/markdown

# AgentMail Toolkit

The AgentMail Toolkit integrates popular agent frameworks including OpenAI Agents SDK, LangChain, and LiveKit Agents with the AgentMail API.

## Setup

Get your API key from [AgentMail](https://agentmail.to)

### Installation

```sh
pip install agentmail-toolkit
```

### Configuration

```sh
export AGENTMAIL_API_KEY=your-api-key
```

### Usage

```python
from agentmail_toolkit.openai import AgentMailToolkit
from agents import Agent

agent = Agent(
    name="Email Agent",
    instructions="You are an agent created by AgentMail that can send, receive, and manage emails.",
    tools=AgentMailToolkit().get_tools(),
)
```

### Errors

A failed tool call (an AgentMail API error, or any other exception) is surfaced
as a real failure, not a disguised success — each adapter raises the way its
framework expects: `RuntimeError` (OpenAI Agents SDK), `ToolException`
(LangChain, which becomes an error `ToolMessage`), or `ToolError` (LiveKit
Agents).

### Attachment downloads

`get_attachment`'s text extraction (PDF/DOCX) only follows `https://`
download URLs, applies a 15-second fetch timeout, and caps the downloaded
body at 25MB — attachments outside these bounds, or that fail to parse, are
returned without extracted text instead of raising.
