GrpcTransport
public final class GrpcTransport implements AutoCloseable
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:58–441gRPC 传输层,承载智能体的部署、调度与服务化运行。位于 io.agentscope.extensions.controlplane.transport 包,实现 AutoCloseable。核心成员包括 setSessionCommandHandler、setExecutionAttemptHandler、setConversationTurnHandler、setEventAckHandler、isConnected、updateIdentity。
ASDP upstream channel: a single bidirectional gRPC stream multiplexing every report type, the same shape the Go control plane and the Python SDK use.
Reconnects with capped exponential backoff. The bridge owns the durable event outbox and only
advances it after receiving EventReportAck; non-event telemetry remains best effort.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
SessionCommandHandler | 接口interface | 定义会话命令处理器契约的接口。 Receives `SessionCommand` pushed down by the control plane. |
ExecutionAttemptCommandHandler | 接口interface | 定义执行尝试命令处理器契约的接口。 Receives a fenced execution-attempt command from the control plane. |
ConversationTurnCommandHandler | 接口interface | 定义会话轮次命令处理器契约的接口。 Receives a fenced online conversation turn from the control plane. |
EventAckHandler | 接口interface | 定义事件确认处理器契约的接口。 Receives a durable commit acknowledgement for a Level-2 event report. |
构造器摘要Constructor Summary
方法摘要Method Summary
构造器详情Constructor Detail
GrpcTransport
public GrpcTransport(String target, String credential, String agentId, String agentKey, String bindingId, String tenant, String namespace, String instanceKey, long generation, String runtime, String sdkVersion, Collection<String> capabilities, String sessionAffinity)
初始化 GrpcTransport 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
target | String | 目标(类型 `String`)。The target. |
credential | String | 凭证对象(类型 `String`)。The credential. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
agentKey | String | 智能体键(类型 `String`)。The agent key. |
bindingId | String | 绑定标识(类型 `String`)。The binding id. |
tenant | String | 租户(类型 `String`)。The tenant. |
namespace | String | 命名空间(类型 `String`)。The namespace. |
instanceKey | String | 实例键(类型 `String`)。The instance key. |
generation | long | generation(类型 `long`)。The generation. |
runtime | String | 运行时(类型 `String`)。The runtime. |
sdkVersion | String | sdk 版本(类型 `String`)。The sdk version. |
capabilities | Collection<String> | 能力(类型 `Collection`)。The capabilities. |
sessionAffinity | String | 会话 Affinity(类型 `String`)。The session affinity. |
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:123–150方法详情Method Detail
setSessionCommandHandler
public void setSessionCommandHandler(SessionCommandHandler handler)
设置会话命令处理器。
Sets the session command handler.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
handler | SessionCommandHandler | 处理器(类型 `SessionCommandHandler`)。The handler. |
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:152–154setExecutionAttemptHandler
public void setExecutionAttemptHandler(ExecutionAttemptCommandHandler handler)
设置执行尝试处理器。
Sets the execution attempt handler.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
handler | ExecutionAttemptCommandHandler | 处理器(类型 `ExecutionAttemptCommandHandler`)。The handler. |
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:156–158setConversationTurnHandler
public void setConversationTurnHandler(ConversationTurnCommandHandler handler)
设置会话轮次处理器。
Sets the conversation turn handler.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
handler | ConversationTurnCommandHandler | 处理器(类型 `ConversationTurnCommandHandler`)。The handler. |
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:160–162setEventAckHandler
public void setEventAckHandler(EventAckHandler handler)
设置事件确认处理器。
Sets the event ack handler.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
handler | EventAckHandler | 处理器(类型 `EventAckHandler`)。The handler. |
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:164–166isConnected
public boolean isConnected()
判断是否已连接。
Returns whether the connected.
booleanio/agentscope/extensions/controlplane/transport/GrpcTransport.java:168–170updateIdentity
public void updateIdentity(String credential, String agentId, String bindingId, String instanceKey, long generation)
更新身份。
Refreshes the fenced Catalog identity used by the next connection attempt.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
credential | String | 凭证对象(类型 `String`)。The credential. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
bindingId | String | 绑定标识(类型 `String`)。The binding id. |
instanceKey | String | 实例键(类型 `String`)。The instance key. |
generation | long | generation(类型 `long`)。The generation. |
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:178–198start
public void start()
执行启动相关操作。
Returns the start.
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:200–211reportSessions
public void reportSessions(List<SessionSnapshot> snapshots)
设置报告会话。
Performs the report sessions operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshots | List<SessionSnapshot> | snapshots(类型 `List`)。The snapshots. |
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:274–284reportEvents
public boolean reportEvents(String reportId, List<SessionEventMsg> events)
执行报告事件相关操作。
Performs the report events operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
reportId | String | 报告标识(类型 `String`)。The report id. |
events | List<SessionEventMsg> | 事件列表(类型 `List`)。The events. |
booleanio/agentscope/extensions/controlplane/transport/GrpcTransport.java:286–299reportContext
public void reportContext(ContextReport report)
设置报告上下文。
Performs the report context operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
report | ContextReport | 报告(类型 `ContextReport`)。The report. |
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:301–303reportInventory
public void reportInventory(InventoryReport report)
设置报告清单。
Performs the report inventory operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
report | InventoryReport | 报告(类型 `InventoryReport`)。The report. |
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:305–307reportExecutionAttempt
public void reportExecutionAttempt(ExecutionAttemptReport report)
设置报告执行尝试。
Performs the report execution attempt operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
report | ExecutionAttemptReport | 报告(类型 `ExecutionAttemptReport`)。The report. |
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:309–311reportConversationTurn
public void reportConversationTurn(ConversationTurnReport report)
设置报告会话轮次。
Performs the report conversation turn operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
report | ConversationTurnReport | 报告(类型 `ConversationTurnReport`)。The report. |
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:313–315close
public void close()
关闭连接并释放相关资源。
Releases resources and connections.
io/agentscope/extensions/controlplane/transport/GrpcTransport.java:349–373嵌套类详情Nested Class Detail
SessionCommandHandler
@FunctionalInterface public interface SessionCommandHandler定义会话命令处理器契约的接口。位于 io.agentscope.extensions.controlplane.transport 包。核心成员包括 onCommand。
Receives SessionCommand pushed down by the control plane.
ExecutionAttemptCommandHandler
@FunctionalInterface public interface ExecutionAttemptCommandHandler定义执行尝试命令处理器契约的接口。位于 io.agentscope.extensions.controlplane.transport 包。核心成员包括 onExecutionAttempt。
Receives a fenced execution-attempt command from the control plane.
ConversationTurnCommandHandler
@FunctionalInterface public interface ConversationTurnCommandHandler定义会话轮次命令处理器契约的接口。位于 io.agentscope.extensions.controlplane.transport 包。核心成员包括 onConversationTurn。
Receives a fenced online conversation turn from the control plane.
EventAckHandler
@FunctionalInterface public interface EventAckHandler定义事件确认处理器契约的接口。位于 io.agentscope.extensions.controlplane.transport 包。核心成员包括 onAck。
Receives a durable commit acknowledgement for a Level-2 event report.