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

# Convert And Save • AI Agents Framework

> convert_and_save: Converts the provided JSON data into the desired YAML format and saves it to a file.

# convert\_and\_save

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

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

Converts the provided JSON data into the desired YAML format and saves it to a file.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def convert_and_save(json_data: Any, merge: Any) -> Any
```

## Parameters

<ParamField query="json_data" type="Any" required={true}>
  The JSON data representing the team structure.
</ParamField>

<ParamField query="merge" type="Any" required={false} default="False">
  Whether to merge with existing agents.yaml file instead of overwriting.
</ParamField>

### Returns

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

## Uses

* `exists`
* `merge_with_existing_agents`
* `yaml.dump`

## Used By

* [`AutoGenerator.generate`](../functions/AutoGenerator-generate)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai/praisonai/auto.py#L743">
  `praisonai/auto.py` at line 743
</Card>
