AS AgentScopeAPI 手册 / API Reference

JevAutoModeMiddleware

public final class JevAutoModeMiddleware implements MiddlewareBase
源码Source io/agentscope/extensions/judge/jev/example/JevAutoModeMiddleware.java:72–343

Jev Auto 模式中间件,在智能体执行流程中提供横切扩展。位于 io.agentscope.extensions.judge.jev.example 包,实现 MiddlewareBase。核心成员包括 builder、order、onActing、DEFAULT_DENY_MESSAGE。

Uses Jev to decide, before execution, whether a guarded tool call is safe enough to run automatically.

For every tool call whose name appears in guardedTools, this middleware asks Jev a yes/no risk question built from the conversation history and the tool input. Calls whose P(safe) is at least safetyThreshold pass through; the rest get a synthetic DENIED tool result written to the conversation state and are never dispatched to the toolkit. Tool calls that were already explicitly allowed by the user (state ALLOWED) skip the check entirely, so this guardrail cannot override a human confirmation.

The check runs in #onActing, after any outer middleware that filters or rewrites tool calls and immediately before the core permission/execution pipeline. This makes it complementary to the deterministic PermissionEngine: a call that passes the Jev assessment is still subject to permission deny rules inside the core acting pipeline, so this middleware adds a model-driven pre-check for the specific tools it guards without replacing the rule-based engine.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
构建器,用于构建并配置目标实例。
A class in io.agentscope.extensions.judge.jev.example that evaluates agent behaviour and records tracing and telemetry data.

字段摘要Field Summary

字段Field类型Type说明Description
DEFAULT_DENY_MESSAGE
staticfinal
String
默认拒绝消息字段。
The DEFAULT DENY MESSAGE field.

方法摘要Method Summary

方法Method说明Description
public static Builder builder(JevClient client)
static
返回构建器实例。
Performs the builder operation.
public int order()
返回顺序。
Returns the order.
public Flux<AgentEvent> onActing(Agent agent, RuntimeContext ctx, ActingInput input, Function<ActingInput, Flux<AgentEvent>> next)
处理执行事件。
Performs the on acting operation.

字段详情Field Detail

DEFAULT_DENY_MESSAGE

public static final String DEFAULT_DENY_MESSAGE
staticfinal

默认拒绝消息字段。声明为 public static final String DEFAULT_DENY_MESSAGE。

The DEFAULT DENY MESSAGE field.

源码Source io/agentscope/extensions/judge/jev/example/JevAutoModeMiddleware.java:76–79

方法详情Method Detail

builder

public static Builder builder(JevClient client)
static

返回构建器实例。

Performs the builder operation.

参数Parameters
名称Name类型Type说明Description
clientJevClient客户端(类型 `JevClient`)。The client.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/judge/jev/example/JevAutoModeMiddleware.java:98–101

order

public int order()

返回顺序。

Returns the order.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/judge/jev/example/JevAutoModeMiddleware.java:107–110

onActing

public Flux<AgentEvent> onActing(Agent agent, RuntimeContext ctx, ActingInput input, Function<ActingInput, Flux<AgentEvent>> next)

处理执行事件。

Performs the on acting operation.

参数Parameters
名称Name类型Type说明Description
agentAgent智能体(类型 `Agent`)。The agent.
ctxRuntimeContext运行时上下文(类型 `RuntimeContext`)。The ctx.
inputActingInput输入消息(类型 `ActingInput`)。The input.
nextFunction<ActingInput, Flux<AgentEvent>>下一个(类型 `Function >`)。The next.
返回Returns Flux<AgentEvent>
返回Flux。Returns flux.
源码Source io/agentscope/extensions/judge/jev/example/JevAutoModeMiddleware.java:112–146

嵌套类详情Nested Class Detail

Builder

public static final class Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.judge.jev.example 包。核心成员包括 guardedTool、guardedTools、safetyThreshold、denyMessage、failOpen、build。

A class in io.agentscope.extensions.judge.jev.example that evaluates agent behaviour and records tracing and telemetry data. Declared in io.agentscope.extensions.judge.jev.example.

继承成员Inherited Members

继承自Methods inherited from MiddlewareBase
基于官方固定版本源码静态生成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.