> ## 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

Method

> This is a method of the [**DoomLoopDetector**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/DoomLoopDetector.md) class in the [**doom\_loop**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/doom_loop.md) 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

**text** `str` *required*

The model's response text

### Returns

**Returns** `Any`

The result of the operation.

## 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] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/escalation/doom_loop.py#L170)
>
> `praisonaiagents/escalation/doom_loop.py` at line 170


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.