AS AgentScopeAPI 手册 / API Reference

WakeupTarget

public interface WakeupTarget
源码Source io/agentscope/harness/agent/gateway/WakeupDispatcher.java:61–94

定义 Wakeup 目标契约的接口。位于 io.agentscope.harness.agent.gateway 包。核心成员包括 isSessionRunning、runWakeup。

Thin interface for the two gateway operations the dispatcher needs. HarnessGateway implements this directly; tests can supply a stub.

方法摘要Method Summary

方法Method说明Description
public boolean isSessionRunning(String sessionId)
判断是否会话运行中。
Returns whether the session running.
public Mono<Msg> runWakeup(String sessionId)
deprecated
运行 `runWakeup`。
Triggers a wakeup run without an owning user id.
default public Mono<Msg> runWakeup(String userId, String sessionId)
default
运行 `runWakeup`。
Triggers a wakeup run for an idle session, carrying the owning user id when present.

方法详情Method Detail

isSessionRunning

public boolean isSessionRunning(String sessionId)

判断是否会话运行中。

Returns whether the session running.

参数Parameters
名称Name类型Type说明Description
sessionIdString会话标识(类型 `String`)。The session id.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/harness/agent/gateway/WakeupDispatcher.java:62

runWakeup

public Mono<Msg> runWakeup(String sessionId)
deprecated

运行 runWakeup。

Triggers a wakeup run without an owning user id.

已弃用。Deprecated. 已弃用,请改用受支持的替代 API。implementers should override `#runWakeup(String, String)` instead, so the dispatcher can propagate the owning user id. Required for runtimes that isolate agent state by `(userId, sessionId)`: without it, a wakeup-driven round loads state from an anonymous slot and the original conversation is lost. This overload is retained for backward compatibility and defaults to ignoring the user id.
参数Parameters
名称Name类型Type说明Description
sessionIdString会话标识(类型 `String`)。the session to wake up
返回Returns Mono<Msg>
返回Mono。the agent's response, or `Mono#empty()` if the session is unknown
源码Source io/agentscope/harness/agent/gateway/WakeupDispatcher.java:75–76

runWakeup

default public Mono<Msg> runWakeup(String userId, String sessionId)
default

运行 runWakeup。

Triggers a wakeup run for an idle session, carrying the owning user id when present.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。the owning user id carried by the wakeup entry; `null` or blank when the producer had none (e.g. single-tenant runtimes)
sessionIdString会话标识(类型 `String`)。the session to wake up
返回Returns Mono<Msg>
返回Mono。the agent's response, or `Mono#empty()` if the session is unknown
源码Source io/agentscope/harness/agent/gateway/WakeupDispatcher.java:91–93
基于官方固定版本源码静态生成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.