HttpAgent
HTTP-based agent for connecting to remote AI agents
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 Wire 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 serviceheaders
: HTTP headers to include with requestsabortController
: AbortController instance for request cancellation