Understand how AG-UI connects front-end applications to AI agents
HttpAgent
or
specialized clients for connecting to existing protocols.run(input: RunAgentInput) -> Observable<BaseEvent>
HttpAgent
that can be used to connect to
any endpoint that accepts POST requests with a body of type RunAgentInput
and
sends a stream of BaseEvent
objects.
HttpAgent
supports the following transports:
RUN_STARTED
, RUN_FINISHED
, RUN_ERROR
STEP_STARTED
, STEP_FINISHED
TEXT_MESSAGE_START
, TEXT_MESSAGE_CONTENT
, TEXT_MESSAGE_END
TOOL_CALL_START
, TOOL_CALL_ARGS
, TOOL_CALL_END
STATE_SNAPSHOT
, STATE_DELTA
, MESSAGES_SNAPSHOT
RAW
, CUSTOM
STATE_SNAPSHOT
: Complete state representation at a point in timeSTATE_DELTA
: Incremental state changes using JSON Patch format (RFC 6902)MESSAGES_SNAPSHOT
: Complete conversation historyrunAgent
parametersTOOL_CALL_START
→ TOOL_CALL_ARGS
→
TOOL_CALL_END
eventsBaseEvent
: