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

# generate • AI Agents Framework

> generate: Generates a team structure for the specified topic.

# generate

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

Generates a team structure for the specified topic.

## Signature

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

## Parameters

<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 full path of the YAML file containing the generated team structure.
</ResponseField>

### Exceptions

<AccordionGroup>
  <Accordion title="Exception">
    If the generation process fails.
  </Accordion>
</AccordionGroup>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
generator = AutoGenerator(framework="crewai", topic="Create a movie script about Cat in Mars")
    path = generator.generate()
    print(path)
```

## Uses

* `get_user_content`
* `json.loads`
* `response.model_dump_json`
* `convert_and_save`
* `abspath`

## Used By

* [`main`](../functions/main)
* [`TrainModel.inference`](../functions/TrainModel-inference)
* [`TrainVisionModel.vision_inference`](../functions/TrainVisionModel-vision_inference)

## Source

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