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

# Unified Diff • AI Agent SDK

> unified_diff: Render a unified before/after diff for previewing the change.

# unified\_diff

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

> This is a method of the [**ConfigDiff**](../classes/ConfigDiff) class in the [**doctor\_protocol**](../modules/doctor_protocol) module.

Render a unified before/after diff for previewing the change.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def unified_diff() -> str
```

### Returns

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

## Uses

* `splitlines`
* `json.dumps`
* `difflib.unified_diff`

## Used By

* [`ConfigDiff.unified_diff`](../functions/ConfigDiff-unified_diff)
* [`RepairPlan.render_diffs`](../functions/RepairPlan-render_diffs)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/runtime/doctor_protocol.py#L32">
  `praisonaiagents/runtime/doctor_protocol.py` at line 32
</Card>
