replace_routes=False
functionality which allows your
custom routes to take precedence over conflicting AgentOS routes.
When replace_routes=False
:
- Your custom routes (/, /health) will be preserved
- Conflicting AgentOS routes will be skipped
- Non-conflicting AgentOS routes will still be added
replace_routes=True
(default):
- AgentOS routes will override your custom routes
- Warnings will be logged about the conflicts
Code
cookbook/agent_os/override_routes.py
Usage
1
Create a virtual environment
Open the
Terminal
and create a python virtual environment.2
Set Environment Variables
3
Install libraries
4
Setup PostgreSQL Database
5
Run Example with FastAPI CLI
6
Run Example with Python