The following example shows the general structure of how to build a FastAPI application. For concrete implementations of agents with specific abilities, see the examples section.
STEP 1: Create a Project
- Create a new Encord Project:
- Create and source a new virtual environment.
- Install dependencies.
STEP 2: Define the Agent
Create amain.py
file using the following template:
main.py
my_agent
function with the logic you want to execute when the agent is triggered.
You can inject multiple different dependencies into the function if necessary.
STEP 3: Test the Agent
Trigger the agent by running it locally.This means starting an API at
localhost:8080/my_agent
that expects a POST request with JSON
data with the following format:my_project
directory and run:
The single quotes around
<the_pasted_url>
are important and should be there because you might copy a url with, e.g., an &
character that have a special meaning if it is not within a string (or escaped).STEP 4: Deployment
This section is under construction.