Skip to main content

app

FastAPI application factory for agent-runtimes server.

Provides a configurable FastAPI application with:

  • ACP protocol endpoints
  • Health check endpoints
  • CORS configuration
  • OpenAPI documentation
  • Demo agent for testing

ServerConfig Objects

class ServerConfig(BaseModel)

Configuration for the agent-runtimes server.

create_app

def create_app(config: ServerConfig | None = None) -> FastAPI

Create and configure the FastAPI application.

Arguments:

  • config - Server configuration. If None, uses defaults.

Returns:

Configured FastAPI application.

create_dev_app

def create_dev_app() -> FastAPI

Create a development application with debug settings.

Returns:

FastAPI application configured for development.

create_production_app

def create_production_app(cors_origins: list[str] | None = None) -> FastAPI

Create a production application with stricter settings.

Arguments:

  • cors_origins - Allowed CORS origins. Defaults to empty list.

Returns:

FastAPI application configured for production.