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

# Clean Json Output • AI Agent SDK

> clean_json_output: Clean and extract JSON from response text.

# clean\_json\_output

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

> This is a method of the [**Agent**](../classes/Agent) class in the [**agent**](../modules/agent) module.

Clean and extract JSON from response text.

## Signature

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

## Parameters

<ParamField query="output" type="str" required={true}>
  No description available.
</ParamField>

### Returns

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

## Used By

* [`AgentTeam.aexecute_task`](../functions/AgentTeam-aexecute_task)

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Output Concept" icon="file-export" href="/docs/concepts/output" />

  <Card title="Output Configuration" icon="gear" href="/docs/configuration/output-config" />

  <Card title="Save Output" icon="floppy-disk" href="/docs/features/save-output" />
</CardGroup>
