ChannelRuntimeContextResolver
@FunctionalInterface public interface ChannelRuntimeContextResolver
源码Source
io/agentscope/harness/agent/gateway/channel/ChannelRuntimeContextResolver.java:33–44定义渠道运行时上下文解析器契约的接口。位于 io.agentscope.harness.agent.gateway.channel 包。核心成员包括 resolve。
Resolves a caller-provided RuntimeContext for a Channel / Gateway turn.
Applications can plug this into io.agentscope.harness.agent.gateway.HarnessGateway (or via io.agentscope.harness.agent.gateway.GatewayBootstrap) to attach request-scoped values such as
tenant information, force-sync flags, or tool dependencies. Gateway identity fields (sessionId, userId, outboundAddress, …) are still applied after resolution and
take precedence over conflicting caller values.
Return null to leave the existing caller context (from ChannelRuntimeContextRequest#callerContext()) unchanged.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public RuntimeContext resolve(ChannelRuntimeContextRequest request) | 用于当前渠道轮次的解析运行时上下文。 Resolve the runtime context for the current channel turn. |
方法详情Method Detail
resolve
public RuntimeContext resolve(ChannelRuntimeContextRequest request)
用于当前渠道轮次的解析运行时上下文。
Resolve the runtime context for the current channel turn.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
request | ChannelRuntimeContextRequest | 请求(类型 `ChannelRuntimeContextRequest`)。channel turn metadata, including any caller-supplied context |
RuntimeContext返回RuntimeContext。a runtime context to use as the merge base, or `null` to keep `ChannelRuntimeContextRequest#callerContext()`
源码Source
io/agentscope/harness/agent/gateway/channel/ChannelRuntimeContextResolver.java:43