langgraph_agent_toolkit.service.handler.lifespan(app)[source][source]

Create a lifespan context manager for the FastAPI app.

Parameters:

app (FastAPI)

Return type:

AsyncGenerator[None, None]

langgraph_agent_toolkit.service.handler.custom_generate_unique_id(route)[source][source]

Use the route’s function name as its OpenAPI operationId.

Yields idiomatic operationIds for client codegen (e.g. invoke instead of FastAPI’s default invoke_invoke_post). Routes that share a function (the /{agent_id}/... variant and its default alias) set an explicit operation_id on the /{agent_id}/... decorator to stay unique.

Parameters:

route (APIRoute)

Return type:

str

langgraph_agent_toolkit.service.handler.create_app()[source][source]

Create and configure the FastAPI application.

Return type:

FastAPI