FlushTrigger
public static final class FlushTrigger
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()
返回 always 结果。
Returns the always.
FlushTriggerio/agentscope/harness/agent/memory/MemoryConfig.java:101–103never
public static FlushTrigger never()
返回 never 结果。
Returns the never.
FlushTriggerio/agentscope/harness/agent/memory/MemoryConfig.java:105–107throttled
public static FlushTrigger throttled(Duration minGap)
设置该参数。
Performs the throttled operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
minGap | Duration | 最小 Gap(类型 `Duration`)。The min gap. |
FlushTriggerio/agentscope/harness/agent/memory/MemoryConfig.java:109–120mode
public FlushMode mode()
返回模式。
Returns the mode.
FlushModeio/agentscope/harness/agent/memory/MemoryConfig.java:122–124minGap
public Duration minGap()
返回 minGap 结果。
Returns the min gap.
Durationio/agentscope/harness/agent/memory/MemoryConfig.java:126–128equals
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
o | Object | o(类型 `Object`)。The o. |
booleanio/agentscope/harness/agent/memory/MemoryConfig.java:130–135hashCode
public int hashCode()
返回 hashCode 结果。
Returns the hash code.
intio/agentscope/harness/agent/memory/MemoryConfig.java:137–140toString
public String toString()
返回 toString 结果。
Returns the to string.
Stringio/agentscope/harness/agent/memory/MemoryConfig.java:142–147