Skip to main content

Coinbase AgentKit PydanticAI extension

Project description

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

Installation

pip install coinbase-agentkit coinbase-agentkit-pydantic-ai

Environment Setup

Set the following environment variables:

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

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.

For a full example, see the chatbot example.

For PydanticAI configuration options, see the PydanticAI Documentation.

Contributing

See CONTRIBUTING.md for detailed setup instructions and contribution guidelines.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coinbase_agentkit_pydantic_ai-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file coinbase_agentkit_pydantic_ai-0.1.0.tar.gz.

File metadata

File hashes

Hashes for coinbase_agentkit_pydantic_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fbaa271253a83ca4c02e95aeafe89d14df16ec57ea3e266060105e067008a06d
MD5 4bf28681236c8ff374fbefaddda22215
BLAKE2b-256 d92a7bca73afb8343c58aa500b1f0f8a1db32dfcaea2963d67245c460f693015

See more details on using hashes here.

Provenance

The following attestation bundles were made for coinbase_agentkit_pydantic_ai-0.1.0.tar.gz:

Publisher: publish_pypi_coinbase_agentkit_pydantic_ai.yml on coinbase/agentkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coinbase_agentkit_pydantic_ai-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for coinbase_agentkit_pydantic_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2e056687d7438a954a505b3f993a836ce8c3ffde9da6931024cd8339ab8b382
MD5 6802de954b71379df3e72e6f0d1a17c5
BLAKE2b-256 0b782b5aa4e76f386333983df052ef9009e2ad8934c3e1eaa9d195dd6b68d9a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for coinbase_agentkit_pydantic_ai-0.1.0-py3-none-any.whl:

Publisher: publish_pypi_coinbase_agentkit_pydantic_ai.yml on coinbase/agentkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page