AS AgentScopeAPI 手册 / API Reference

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
requestChannelRuntimeContextRequest请求(类型 `ChannelRuntimeContextRequest`)。channel turn metadata, including any caller-supplied context
返回Returns 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
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.