Host agents as Playground Applications.
Agents
, Workflows
, and Teams
on the Agno Playground.
Playground
:
db_url
.OPENAI_API_KEY
environment variable.http://localhost:7777
. API docs (if enabled in settings) are typically at http://localhost:7777/docs
.Playground
: Wraps Agno agents, teams, or workflows in an API.Playground.serve
: Serves the Playground FastAPI app using Uvicorn.Playground
class is the main entry point for creating Agno Playground applications. It allows you to easily expose your agents, teams, and workflows through a web interface with Agent Playground or Agent UI.
Playground
ClassParameter | Type | Default | Description |
---|---|---|---|
agents | Optional[List[Agent]] | None | List of Agno Agent instances. |
teams | Optional[List[Team]] | None | List of Agno Team instances. |
workflows | Optional[List[Workflow]] | None | List of Agno Workflow instances. |
settings | Optional[PlaygroundSettings] | None | Playground configuration. Defaults if None . |
api_app | Optional[FastAPI] | None | Existing FastAPI app. A new one is created if None . |
router | Optional[APIRouter] | None | Existing APIRouter. A new one is created if None . |
app_id | Optional[str] | None | App identifier (autogenerated if not set). |
name | Optional[str] | None | Name for the App. |
description | Optional[str] | None | Description for the App. |
agents
, teams
, or workflows
.
Method | Parameters | Return Type | Description |
---|---|---|---|
get_app | use_async: bool = True prefix: str = "/v1" | FastAPI | Returns configured FastAPI app (async by default). Sets prefix, error handlers, CORS, docs. |
get_router | APIRouter | Returns the synchronous APIRouter for playground endpoints. | |
get_async_router | APIRouter | Returns the asynchronous APIRouter for playground endpoints. |
prefix
(default /v1
) combined with the playground router’s prefix (/playground
). For example, the status endpoint is typically /v1/playground/status
.
Parameter | Type | Default | Description |
---|---|---|---|
app | Union[str, FastAPI] | N/A | FastAPI app instance or import string (Required). |
host | str | "localhost" | Host to bind. |
port | int | 7777 | Port to bind. |
reload | bool | False | Enable auto-reload for development. |