AG-UI protocol integration for building agent UIs with the AG-UI standard.
AgentFrameworkAgent- Wraps agents for AG-UI compatibilityAgentFrameworkWorkflow- Wraps nativeWorkflowobjects, or acceptsworkflow_factory(thread_id)for thread-scoped workflow instances without subclassingAGUIChatClient- Chat client that speaks AG-UI protocolAGUIHttpService- HTTP service for AG-UI endpointsAGUIEventConverter- Converts between Agent Framework and AG-UI eventsadd_agent_framework_fastapi_endpoint()- Add AG-UI endpoint to FastAPI app (SupportsAgentRunorWorkflow)
AGUIRequest/AGUIChatOptions- Request typesavailableInterrupts/resume- Optional interrupt configuration and continuation payloadsAgentState/RunMetadata- State management typesPredictStateConfig- Configuration for state prediction
- Outbound custom events are emitted as AG-UI
CUSTOM. - Usage metadata from
Content(type="usage")is surfaced asCUSTOMevents withname="usage". - Inbound custom event aliases are accepted:
CUSTOM,CUSTOM_EVENT, andcustom_event. - Multimodal user inputs support both legacy (
text,binary) and draft-style (image,audio,video,document) shapes. RUN_FINISHED.interruptcan be emitted for pause/request-info flows, and interruption metadata is preserved in converters.
from agent_framework.ag_ui import add_agent_framework_fastapi_endpoint
from fastapi import FastAPI
app = FastAPI()
add_agent_framework_fastapi_endpoint(app, agent)from agent_framework.ag_ui import AGUIChatClient, add_agent_framework_fastapi_endpoint
# or directly:
from agent_framework_ag_ui import AGUIChatClient