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 |
|---|---|---|
mw | MiddlewareBase | mw(类型 `MiddlewareBase`)。The mw. |
agent | Agent | 智能体(类型 `Agent`)。The agent. |
ctx | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The ctx. |
input | I | 输入消息(类型 `I`)。The input. |
next | Function<I, Flux<AgentEvent>> | 下一个(类型 `Function >`)。The next. |
Flux<AgentEvent>返回Flux。Returns flux.
源码Source
io/agentscope/core/middleware/MiddlewareChain.java:71–76