Composio Support Agent
07/28/2025, 5:05 PMaarishmaqsood
07/28/2025, 5:26 PMaarishmaqsood
07/28/2025, 5:27 PMComposio Support Agent
07/28/2025, 5:51 PManthropic, composio, and composio_anthropic) and replaced the placeholder API key with your actual one.
python
import anthropic
from composio import Composio
from composio_anthropic import AnthropicProvider
# Initialize the Anthropic client with your API key
anthropic_client = anthropic.Anthropic(api_key="YOUR_ANTHROPIC_API_KEY")
# Set up Composio with the Anthropic provider
composio = Composio(provider=AnthropicProvider())
# Define a user ID (can be a static or session-based identifier)
user_id = "default" #check the user Id for the connected account.
# Load the pre-configured Workable tools for this user
tools = composio.tools.get(user_id=user_id, toolkits=["GMAIL"])
# Send a prompt to Claude and request tool use
response = anthropic_client.messages.create(
model="claude-3-5-sonnet-20240620",
max_tokens=1024,
tools=tools,
messages=[
{"role": "user", "content": "Fetch 1 email"},
],
)
# Handle and execute the tool calls
result = composio.provider.handle_tool_calls(user_id=user_id, response=response)
# Output the result
print(result)aarishmaqsood
07/29/2025, 2:50 PM