Table of Contents

Class AgentHub

Namespace
JD.AI.Gateway.Hubs
Assembly
JD.AI.Gateway.dll

Real-time hub for agent interactions — streaming responses, tool calls, status updates.

public sealed class AgentHub : Hub, IDisposable
Inheritance
AgentHub
Implements
Inherited Members

Constructors

AgentHub(AgentPoolService)

Real-time hub for agent interactions — streaming responses, tool calls, status updates.

public AgentHub(AgentPoolService pool)

Parameters

pool AgentPoolService

Methods

OnConnectedAsync()

Called when a new connection is established with the hub.

public override Task OnConnectedAsync()

Returns

Task

A Task that represents the asynchronous connect.

StreamChat(string, string, CancellationToken)

Client sends a message to an agent; response is streamed back as chunks.

public IAsyncEnumerable<AgentStreamChunk> StreamChat(string agentId, string message, CancellationToken ct = default)

Parameters

agentId string
message string
ct CancellationToken

Returns

IAsyncEnumerable<AgentStreamChunk>