The phidata cookbook contains in-depth examples and code. From basic assistants, function calling, structured output to advanced fine-tuning and evaluations.

You can run each recipe individually or clone the phidata repo and run it from there.

Clone the cookbook

1

Fork & clone the phidata repo

We recommend forking the phidata repo first so you can customize the cookbooks.

Fork & clone the phidata repo

git clone https://github.com/phidatahq/phidata

cd into the phidata directory

cd phidata
2

Create a virtual environment

Create a virtual environment with the required libraries and install the project in editable mode. You can use a helper script or run these steps manually.

./scripts/create_venv.sh
source phienv/bin/activate
3

Run any recipe

Set your OPENAI_API_KEY

export OPENAI_API_KEY=sk-***

Install openai and duckduckgo-search

pip install openai duckduckgo-search

Run the assistants/web_search.py recipe

python cookbook/assistants/web_search.py