Class JevToolSelectionMiddleware
- All Implemented Interfaces:
io.agentscope.core.middleware.MiddlewareBase
Always-included tools are preserved. Optional tools are ranked by Jev and only those with a
probability above the synthetic "none" option are kept, up to maxTools.
The filter runs in onReasoning(io.agentscope.core.agent.Agent, io.agentscope.core.agent.RuntimeContext, io.agentscope.core.middleware.ReasoningInput, java.util.function.Function<io.agentscope.core.middleware.ReasoningInput, reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent>>) on every reasoning step, so it re-selects tools as
the conversation grows. Tool sets larger than the Jev choice limit are chunked, each chunk's
winner is shortlisted, and the shortlist is reranked in a second request. When Jev fails and
failOpen is set (the default), the original tool list is kept.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder(Function<SystemOneRequest, reactor.core.publisher.Mono<SystemOneResult>> jevCall) Creates a builder from a Jev call function.reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent>onReasoning(io.agentscope.core.agent.Agent agent, io.agentscope.core.agent.RuntimeContext ctx, io.agentscope.core.middleware.ReasoningInput input, Function<io.agentscope.core.middleware.ReasoningInput, reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent>> next) intorder()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.agentscope.core.middleware.MiddlewareBase
onActing, onAgent, onModelCall, onSystemPrompt
-
Field Details
-
DEFAULT_ALWAYS_INCLUDE_TOOLS
-
-
Method Details
-
builder
-
builder
public static JevToolSelectionMiddleware.Builder builder(Function<SystemOneRequest, reactor.core.publisher.Mono<SystemOneResult>> jevCall) Creates a builder from a Jev call function. Useful for wrappingJevClient.systemOne(io.agentscope.extensions.judge.jev.SystemOneRequest)with request/response logging or metrics. -
order
public int order()- Specified by:
orderin interfaceio.agentscope.core.middleware.MiddlewareBase
-
onReasoning
public reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent> onReasoning(io.agentscope.core.agent.Agent agent, io.agentscope.core.agent.RuntimeContext ctx, io.agentscope.core.middleware.ReasoningInput input, Function<io.agentscope.core.middleware.ReasoningInput, reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent>> next) - Specified by:
onReasoningin interfaceio.agentscope.core.middleware.MiddlewareBase
-