Are you sure you want to delete this access key?
This example shows how to use CrewAI agents with promptfoo to evaluate AI agent performance.
CrewAI is a framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
You can run this example with:
npx promptfoo@latest init --example crewai
This example requires the following:
You need to set the OpenAI API key. Choose one of these methods:
export OPENAI_API_KEY=your-api-key-here
Create a .env
file in this directory:
OPENAI_API_KEY=your-api-key-here
If using a .env
file, uncomment python-dotenv
in requirements.txt
and reinstall dependencies.
Install Python packages:
pip install -r requirements.txt
Note: The openai package and other dependencies (langchain, pydantic, etc.) will be automatically installed as dependencies of crewai.
Install promptfoo CLI:
npm install -g promptfoo
agent.py
: Contains the CrewAI agent setup and promptfoo provider interfacepromptfooconfig.yaml
: Configures prompts, providers, and tests for evaluationWhen using a real LLM, you may notice that the agent's output is not always reliable, especially for more complex queries. For example, the agent may fail to return valid JSON or may not return a response at all. This is a common challenge when working with LLMs.
Run the evaluation:
promptfoo eval
Explore results in browser:
promptfoo view
If you see authentication errors:
Press p or to see the previous file or, n or to see the next file
Browsing data directories saved to S3 is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with AWS S3!
Are you sure you want to delete this access key?
Browsing data directories saved to Google Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Google Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to Azure Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Azure Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to S3 compatible storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with your S3 compatible storage!
Are you sure you want to delete this access key?