db620d33df
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
2.6 KiB
2.6 KiB
AG-UI Package (agent-framework-ag-ui)
AG-UI protocol integration for building agent UIs with the AG-UI standard.
Main Classes
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)InMemoryAGUIThreadSnapshotStore- Memory-only latest AG-UI Thread Snapshot store for local development, demos, and tests
Types
AGUIRequest/AGUIChatOptions- Request typesAGUIThreadSnapshot/AGUIThreadSnapshotStore- Replayable thread snapshot model and scoped async store protocolavailableInterrupts/resume- Optional canonical AG-UIInterruptandResumeEntryprotocol dataAgentState/RunMetadata- State management typesPredictStateConfig- Configuration for state prediction
Protocol Notes
- 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. - Interrupted runs complete with
RUN_FINISHED.outcome.type == "interrupt"and canonicaloutcome.interrupts; do not document or add new flows that depend on the legacy top-levelRUN_FINISHED.interruptfield. InterruptandResumeEntrycome from theag-ui-protocolpackage (ag_ui.core), not from an Agent Framework-specific interrupt model.- SSE keepalive is endpoint-owned transport behavior configured through
add_agent_framework_fastapi_endpoint(keepalive_seconds=...). It emits SSE comments only; do not addPING,HEARTBEAT, orKEEPALIVEAG-UI events, and do not add runner-level keepalive settings.
Usage
from agent_framework.ag_ui import add_agent_framework_fastapi_endpoint
from fastapi import FastAPI
app = FastAPI()
add_agent_framework_fastapi_endpoint(app, agent)
Import Path
from agent_framework.ag_ui import AGUIChatClient, add_agent_framework_fastapi_endpoint
# or directly:
from agent_framework_ag_ui import AGUIChatClient