AS AgentScopeAPI 手册 / API Reference

FlushTrigger

public static final class FlushTrigger
源码Source io/agentscope/harness/agent/memory/MemoryConfig.java:86–148

刷新 Trigger,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.harness.agent.memory 包。核心成员包括 always、never、throttled、mode、minGap、equals。

Trigger policy for io.agentscope.harness.agent.middleware.MemoryFlushMiddleware.

A throttled trigger allows the first eligible call immediately. Its minimum gap is measured between subsequent per-call flushes, independently of consolidation maintenance. #never() disables only this per-call flush path.

throttled(Duration.ZERO) normalises to #always() so callers do not need a special branch for the degenerate case.

方法摘要Method Summary

方法Method说明Description
public static FlushTrigger always()
static
返回 `always` 结果。
Returns the always.
public static FlushTrigger never()
static
返回 `never` 结果。
Returns the never.
public static FlushTrigger throttled(Duration minGap)
static
设置该参数。
Performs the throttled operation.
public FlushMode mode()
返回模式。
Returns the mode.
public Duration minGap()
返回 `minGap` 结果。
Returns the min gap.
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
public int hashCode()
返回 `hashCode` 结果。
Returns the hash code.
public String toString()
返回 `toString` 结果。
Returns the to string.

方法详情Method Detail

always

public static FlushTrigger always()
static

返回 always 结果。

Returns the always.

返回Returns FlushTrigger
返回FlushTrigger。Returns flush trigger.
源码Source io/agentscope/harness/agent/memory/MemoryConfig.java:101–103

never

public static FlushTrigger never()
static

返回 never 结果。

Returns the never.

返回Returns FlushTrigger
返回FlushTrigger。Returns flush trigger.
源码Source io/agentscope/harness/agent/memory/MemoryConfig.java:105–107

throttled

public static FlushTrigger throttled(Duration minGap)
static

设置该参数。

Performs the throttled operation.

参数Parameters
名称Name类型Type说明Description
minGapDuration最小 Gap(类型 `Duration`)。The min gap.
返回Returns FlushTrigger
返回FlushTrigger。Returns flush trigger.
源码Source io/agentscope/harness/agent/memory/MemoryConfig.java:109–120

mode

public FlushMode mode()

返回模式。

Returns the mode.

返回Returns FlushMode
返回FlushMode。Returns flush mode.
源码Source io/agentscope/harness/agent/memory/MemoryConfig.java:122–124

minGap

public Duration minGap()

返回 minGap 结果。

Returns the min gap.

返回Returns Duration
返回时长。Returns duration.
源码Source io/agentscope/harness/agent/memory/MemoryConfig.java:126–128

equals

public boolean equals(Object o)

设置该参数。

Performs the equals operation.

参数Parameters
名称Name类型Type说明Description
oObjecto(类型 `Object`)。The o.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/harness/agent/memory/MemoryConfig.java:130–135

hashCode

public int hashCode()

返回 hashCode 结果。

Returns the hash code.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/harness/agent/memory/MemoryConfig.java:137–140

toString

public String toString()

返回 toString 结果。

Returns the to string.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/memory/MemoryConfig.java:142–147
基于官方固定版本源码静态生成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.