Skip to main content
The source defines three Crawl4aiTools agents. It runs the default pruning agent and the explicit enable_crawl agent; the raw no-pruning agent is configured but not executed.
crawl4ai_tools.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Set up Crawl4AI

Install the browser dependencies required by Crawl4AI:
5

Run the example

Save the code above as crawl4ai_tools.py, then run:
Full source: cookbook/91_tools/crawl4ai_tools.py