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

# Format Message • AI Agent SDK

> format_message: Render *text* for the platform's declared ``markdown_dialect``.

# format\_message

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

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

Render *text* for the platform's declared `markdown_dialect`.

This is the seam that finally *consumes* the `markdown_dialect`
capability every adapter advertises: the default keys off
`capabilities.markdown_dialect` and returns text rendered in that
flavour (e.g. MarkdownV2-escaped for Telegram, Slack `mrkdwn` for
Slack) so replies render correctly and are never dropped by a transport
that rejects unescaped specials. The default dialect `"markdown"`
yields a safe plain-text reduction, so existing adapters are unaffected.

Adapters that need the transport `parse_mode` (e.g. Telegram's
`"MarkdownV2"`) can call :func:`~praisonaiagents.bots.format_for_dialect`
directly in their send path; override this method to change formatting.

## Signature

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

## Parameters

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

### Returns

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

## Uses

* `format_for_dialect`

## Used By

* [`BasePlatformAdapter.deliver`](../functions/BasePlatformAdapter-deliver)

## Source

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