Agent Run Handler Service (server/AgentRunHandler.java)

ag-ui · sdks/community/java/ag-ui/server/src/main/java/com/agui/community/server/AgentRunHandler.java · java · MIT
realtime, ai, lang:java, tag:transport

Processes agent input requests, executes AI agents, and relays event streams through an encoder. Reuse when implementing transport-neutral AI agent servers.

// Source: https://github.com/ag-ui-protocol/ag-ui | License: MIT | Copyright 2025
// Provided via justclaw.it.com; keep this notice with the code.
package com.agui.community.server;

import com.agui.community.core.agent.Agent;
import com.agui.community.core.agent.RunAgentInput;
import com.agui.community.core.serialization.Serializer;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;

/**
 * The transport-neutral heart of the AG-UI server: it parses a request body into
 * a {@link RunAgentInput}, runs an {@link Agent}, and relays the resulting
 * {@link com.agui.community.core.event.Event} stream to an {@link EventSink},
 * framing each event through an {@link EventEncoder}.
 *
 * <p>This class knows nothing about HTTP or the wire protocol. A transport
 * adapter is 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key