Metadata-Version: 2.4
Name: meshagent-anthropic
Version: 0.37.1
Summary: Anthropic Building Blocks for Meshagent
License-Expression: Apache-2.0
Project-URL: Documentation, https://docs.meshagent.com
Project-URL: Website, https://www.meshagent.com
Project-URL: Source, https://www.meshagent.com
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pytest~=8.4
Requires-Dist: pytest-asyncio~=0.26
Requires-Dist: meshagent-api~=0.37.1
Requires-Dist: meshagent-agents~=0.37.1
Requires-Dist: meshagent-tools~=0.37.1
Requires-Dist: anthropic~=0.78.0
Requires-Dist: html-to-markdown~=2.24.3
Dynamic: license-file

# [Meshagent](https://www.meshagent.com)

## MeshAgent Anthropic
The `meshagent.anthropic` package provides adapters to integrate Anthropic models (Messages API) with MeshAgent tools and agents.

### Messages Adapter
- `AnthropicMessagesAdapter`: wraps the Anthropic Messages API. It turns `Toolkit` objects into Anthropic tool definitions, executes tool calls, and returns the final assistant response.

```Python Python
from meshagent.anthropic import AnthropicMessagesAdapter

adapter = AnthropicMessagesAdapter(model="claude-3-5-sonnet-latest")
```

Compaction can be enabled through Anthropic context management:

```Python Python
adapter = AnthropicMessagesAdapter(
    model="claude-sonnet-4-5",
    context_management="auto",
    compaction_threshold=150000,
)
```

You can also pass `base_url=` to `AnthropicMessagesAdapter`. If omitted, MeshAgent reads `ANTHROPIC_BASE_URL` from the environment when constructing the provider client.

### Tool Response Adapter
`AnthropicMessagesToolResponseAdapter` converts a tool's structured response into Anthropic `tool_result` blocks that can be inserted back into the conversation.

---
### Learn more about MeshAgent on our website or check out the docs for additional examples!

**Website**: [www.meshagent.com](https://www.meshagent.com/)

**Documentation**: [docs.meshagent.com](https://docs.meshagent.com/)

---
