Metadata-Version: 2.4
Name: coinbase-agentkit-pydantic-ai
Version: 0.1.0
Summary: Coinbase AgentKit PydanticAI extension
Author-email: Logan Kang <kcs93023@gmail.com>
License-Expression: Apache-2.0
Keywords: agent,ai,cdp,coinbase,crypto,pydantic-ai,sdk
Requires-Python: ~=3.10
Requires-Dist: coinbase-agentkit<0.8,>=0.7.2
Requires-Dist: nest-asyncio<2,>=1.6.0
Requires-Dist: pydantic-ai<0.5,>=0.4.0
Requires-Dist: pytest-asyncio<0.26,>=0.25.3
Requires-Dist: python-dotenv<2,>=1.0.1
Requires-Dist: setuptools<70,>=69.0.3
Description-Content-Type: text/markdown

# Coinbase AgentKit PydanticAI Extension

This package provides integration between Coinbase AgentKit and PydanticAI, allowing you to use AgentKit actions as tools in PydanticAI agents.

## Setup

### Prerequisites

- [CDP API Key](https://portal.cdp.coinbase.com/access/api)
- [OpenAI API Key](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)

### Installation

```bash
pip install coinbase-agentkit coinbase-agentkit-pydantic-ai
```

### Environment Setup

Set the following environment variables:

```bash
export OPENAI_API_KEY=<your-openai-api-key>
export CDP_API_KEY_ID=<your-cdp-api-key-id>
export CDP_API_KEY_SECRET=<your-cdp-api-key-secret>
export CDP_WALLET_SECRET=<your-cdp-wallet-secret>
export NETWORK_ID=<your-network-id>
```

## Usage

### Basic Setup

```python
from coinbase_agentkit import AgentKit
from coinbase_agentkit_pydantic_ai import get_pydantic_ai_tools
from pydantic_ai import Agent

# Initialize AgentKit
agent_kit = AgentKit()

# Get PydanticAI compatible tools
tools = get_pydantic_ai_tools(agent_kit)

# Create PydanticAI agent with the tools
agent = Agent(
    'openai:gpt-4o',
    tools=tools,
    system_prompt='You are a helpful crypto trading assistant.'
)

# Use the agent
result = agent.run_sync('What is my wallet balance?')
print(result.output)
```

For AgentKit configuration options, see the [Coinbase Agentkit README](https://github.com/coinbase/agentkit/blob/master/python/coinbase-agentkit/README.md).

For a full example, see the [chatbot example](https://github.com/coinbase/agentkit/blob/master/python/examples/pydantic-ai-cdp-chatbot/chatbot.py).

For PydanticAI configuration options, see the [PydanticAI Documentation](https://ai.pydantic.dev/).

## Contributing

See [CONTRIBUTING.md](https://github.com/coinbase/agentkit/blob/master/CONTRIBUTING.md) for detailed setup instructions and contribution guidelines.
