Appearance
FastAPI Authoring Server Example
This page embeds the full source for examples/fastapi_authoring_server.py.
python
"""Example: expose the Agent Builder authoring transport over HTTP with FastAPI."""
import uvicorn
from swarmforge.api import create_authoring_app
from swarmforge.env import get_env, get_env_int
app = create_authoring_app()
if __name__ == "__main__":
uvicorn.run(
app,
host=get_env("SWARMFORGE_HOST", default="127.0.0.1") or "127.0.0.1",
port=get_env_int("SWARMFORGE_PORT", default=8000),
)Run:
bash
python examples/fastapi_authoring_server.py