@Preview(value="3.8.1") public class StopLoopInterceptor extends java.lang.Object implements ReActInterceptor
通过监控动作意图的滑动窗口频率,防止智能体陷入连续重复或 A-B-A-B 型往复迭代。
| 构造器和说明 |
|---|
StopLoopInterceptor() |
StopLoopInterceptor(int maxRepeatCount,
int windowSize) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
onReason(ReActTrace trace,
AssistantMessage message)
推理节点:接收 LLM 返回的原始推理消息
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonAction, onAgentEnd, onAgentStart, onModelEnd, onModelStart, onObservation, onPlan, onThoughtinterceptCall, interceptStream, onPrepareinterceptToolpublic StopLoopInterceptor(int maxRepeatCount,
int windowSize)
maxRepeatCount - 在窗口内允许同一动作出现的次数阈值windowSize - 监控最近的 N 个动作public StopLoopInterceptor()
public void onReason(ReActTrace trace, AssistantMessage message)
ReActInterceptoronReason 在接口中 ReActInterceptor