AS AgentScopeAPI 手册 / API Reference

MiddlewareMethod

@FunctionalInterface public interface MiddlewareMethod<I>
源码Source io/agentscope/core/middleware/MiddlewareChain.java:69–77

定义中间件方法契约的接口。位于 io.agentscope.core.middleware 包。核心成员包括 apply。

Functional interface representing one of the onion-pattern middleware hooks.

方法摘要Method Summary

方法Method说明Description
public Flux<AgentEvent> apply(MiddlewareBase mw, Agent agent, RuntimeContext ctx, I input, Function<I, Flux<AgentEvent>> next)
执行 `apply` 方法。
Performs the apply operation.

方法详情Method Detail

apply

public Flux<AgentEvent> apply(MiddlewareBase mw, Agent agent, RuntimeContext ctx, I input, Function<I, Flux<AgentEvent>> next)

执行 apply 方法。

Performs the apply operation.

参数Parameters
名称Name类型Type说明Description
mwMiddlewareBasemw(类型 `MiddlewareBase`)。The mw.
agentAgent智能体(类型 `Agent`)。The agent.
ctxRuntimeContext运行时上下文(类型 `RuntimeContext`)。The ctx.
inputI输入消息(类型 `I`)。The input.
nextFunction<I, Flux<AgentEvent>>下一个(类型 `Function >`)。The next.
返回Returns Flux<AgentEvent>
返回Flux。Returns flux.
源码Source io/agentscope/core/middleware/MiddlewareChain.java:71–76
基于官方固定版本源码静态生成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.