> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Record Response • AI Agent SDK

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

# record\_response

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**DoomLoopDetector**](../classes/DoomLoopDetector) class in the [**doom\_loop**](../modules/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 theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def record_response(text: str) -> Any
```

## Parameters

<ParamField query="text" type="str" required={true}>
  The model's response text
</ParamField>

### Returns

<ResponseField name="Returns" type="Any">
  The result of the operation.
</ResponseField>

## Uses

* `hexdigest`
* `hashlib.sha256`
* `chunk.encode`

## Used By

* [`Agent.run_autonomous_async`](../functions/Agent-run_autonomous_async)
* [`DoomLoopTracker.record_response`](../functions/DoomLoopTracker-record_response)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/escalation/doom_loop.py#L170">
  `praisonaiagents/escalation/doom_loop.py` at line 170
</Card>
