Skip to content

Latest commit

 

History

History
71 lines (45 loc) · 1.92 KB

File metadata and controls

71 lines (45 loc) · 1.92 KB

AgentKit Autogen Extension

Microsoft Autogen extension of AgentKit. Enables agentic workflows to interact with onchain actions.

Setup

Prerequisites

Installation

pip install coinbase-agentkit coinbase-agentkit-autogen

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>

Usage

Basic Setup

from coinbase_agentkit import AgentKit
from coinbase_agentkit_autogen import get_autogen_tools

from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console


agentKit = AgentKit()

model_client = OpenAIChatCompletionClient(model="gpt-4o-mini")

tools = get_autogen_tools(agentKit)

agent = AssistantAgent(
    name="assistant",
    model_client=model_client,
    tools=tools,
    system_message="You are a helpful agent"
)

async def main() -> None:
    await Console(agent.run_stream(task="Show me my wallet information."))
    await model_client.close()

await main()

For AgentKit configuration options, see the Coinbase Agentkit README.

For Autogen configuration options, see the Autogen Documentation

For a full example, see the chatbot example.

Contributing

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