Format Message • AI Agent SDK
format_message: Render *text* for the platform's declared “markdown_dialect“.
format_message
Method
</div>
This is a method of the BasePlatformAdapter class in the 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
def format_message(text: str) -> strParameters
strNo description available.
Returns
strThe result of the operation.
Uses
format_for_dialect
Used By
Source
View on GitHubpraisonaiagents/bots/base.py at line 735