Record Response • AI Agent SDK

record_response: Record model response text for content streaming loop detection.

record_response

Method

</div>

This is a method of the DoomLoopDetector class in the doom_loop module.

Record model response text for content streaming loop detection.

Hashes sliding window chunks and tracks repetition counts. Inspired by gemini-cli’s sliding window approach.

Signature

python
def record_response(text: str) -> Any

Parameters

ParamField str

The model’s response text

Returns

ResponseField Any

The result of the operation.

Uses

  • hexdigest
  • hashlib.sha256
  • chunk.encode

Used By

Source

View on GitHub

praisonaiagents/escalation/doom_loop.py at line 170