Skip to main content

HttpAgent

The HttpAgent extends AbstractAgent to provide HTTP-based connectivity to remote AI agents. It handles the request/response cycle and transforms the HTTP event stream into standard Agent User Interaction Protocol events.

Configuration

When creating an HTTP agent, you need to provide an HttpAgentConfig object:

Creating an HttpAgent

Methods

runAgent()

Executes the agent by making an HTTP request to the configured endpoint. Returns an observable event stream.

Parameters

abortRun()

Cancels the current HTTP request using the AbortController.

Protected Methods

requestInit()

Configures the HTTP request. Override this method to customize how requests are made.
Default implementation:

run()

Implements the abstract run() method from AbstractAgent using HTTP requests.

Properties

  • url: The endpoint URL for the agent service
  • headers: HTTP headers to include with requests
  • abortController: AbortController instance for request cancellation