examples/integrations/crewai/README.md
This example demonstrates how to integrate Crew AI with TensorZero to create a simple chatbot that can call external APIs.
We provide a blank TensorZero configuration in example/tensorzero/tensorzero.toml.
You can define custom functions, metrics, and more as needed.
For this example, we simply call the model openai::gpt-4o-mini with the default function.
example/ directory: cd example/crewai CLI utility.uv: uv syncOPENAI_API_KEY).OPENAI_API_KEY environment variable.crewai run.Running the Crew
╭────────────────────────────────────────────── Crew Execution Started ──────────────────────────────────────────────╮
│ │
│ Crew Execution Started │
│ Name: crew │
│ ID: 24a156f1-3021-4f35-b585-6a12a05b5fd1 │
│ │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
# Agent: Weather Analyst
## Task: Report the weather for the current day based on the location provided.
# Agent: Weather Analyst
## Thought: I need to get the current temperature for New York City to report the weather for today.
## Using tool: Temperature Tool
## Tool Input:
"{\"location\": \"New York City\"}"
## Tool Output:
{"location": "New York City", "temperature": 70, "unit": "F"}
# Agent: Weather Analyst
## Final Answer:
The current weather in New York City is 70°F.
🚀 Crew: crew
└── 📋 Task: 727ab50d-b22b-4c83-9459-fe8bc2794e84
Assigned to: Weather Analyst
Status: ✅ Completed
└── 🔧 Used Temperature Tool (1)
╭───────────────────────────────────────────────── Task Completion ──────────────────────────────────────────────────╮
│ │
│ Task Completed │
│ Name: 727ab50d-b22b-4c83-9459-fe8bc2794e84 │
│ Agent: Weather Analyst │
│ │
│ │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────────────────────────────── Crew Completion ──────────────────────────────────────────────────╮
│ │
│ Crew Execution Completed │
│ Name: crew │
│ ID: 24a156f1-3021-4f35-b585-6a12a05b5fd1 │
│ │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯