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

# Formatting Prompts Func • AI Agents Framework

> formatting_prompts_func: Converts each example's conversation into a single plain-text prompt.

# formatting\_prompts\_func

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**train**](../modules/train) module.

Converts each example's conversation into a single plain-text prompt.
If the example has a "conversations" field, process it as ShareGPT-style.
Otherwise, assume Alpaca-style data with "instruction", "input", and "output" fields.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def formatting_prompts_func(examples: Any, tokenizer: Any) -> Any
```

## Parameters

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

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

### Returns

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

## Uses

* `tokenizer.apply_chat_template`

## Source

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