Installation
pip install composio-anthropic anthropic
Quick Start
import os
from composio import Composio
from composio_anthropic import AnthropicProvider
from anthropic import Anthropic
# Initialize
composio = Composio(provider=AnthropicProvider())
anthropic = Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY"))
# Get tools
tools = composio.tools.get(user_id="default", toolkits=["github"])
# Use with Claude
response = anthropic.messages.create(
model="claude-3-opus-20240229",
max_tokens=1024,
tools=tools,
messages=[{"role": "user", "content": "Star the composio repository"}]
)
# Handle tool calls
if response.stop_reason == "tool_use":
result = composio.provider.handle_tool_calls(
response=response,
user_id="default"
)
print(result)