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

# Base Platform Adapter • AI Agent SDK

> BasePlatformAdapter: Inheritable base class for gateway platform/channel adapters.

# BasePlatformAdapter

> Defined in the [**base**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/base.md) module.

AI Agent

Inheritable base class for gateway platform/channel adapters.

Subclasses implement a **minimal abstract contract** (four methods) and
inherit **capability-driven default behaviour** (chunking, retry/backoff,
typing heartbeat, edit/delete fallbacks, formatting). Override any default
only when the platform can do better.

The base also satisfies the runtime surface `Bot`/`BotOS` drive
(`start` / `stop` / `send_message` / `probe` / `health`) with
defaults built on those primitives, so a minimal subclass runs under the
gateway as-is. `Bot` builds adapters with `token=` / `agent=` /
`config=` keyword arguments, so a subclass `__init__` should accept them.

Declare platform features by setting the class attribute
:attr:`capabilities` to a :class:`PlatformCapabilities` instance. The
default delivery path reads capabilities via `getattr` so it degrades
gracefully when a flag is absent.

## Properties

**capabilities** `PlatformCapabilities`

No description available.

**max\_retries** `int`

No description available.

**retry\_base\_delay** `float`

No description available.

**supervised\_inbound** `bool`

No description available.

## Methods

> [card] [connect()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-connect.md)
>
> Establish the platform connection.

> [card] [disconnect()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-disconnect.md)
>
> Tear down the platform connection and release resources.

> [card] [send()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-send.md)
>
> Send a single message to *chat\_id* (one API call, no chunking).

> [card] [get\_chat\_info()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-get_chat_info.md)
>
> Return metadata about a chat/channel (at least an `id` key).

> [card] [start()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-start.md)
>
> Establish the connection and run the inbound loop until stopped.

> [card] [stop()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-stop.md)
>
> Signal the inbound loop to stop and tear down the connection.

> [card] [send\_message()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-send_message.md)
>
> Runtime send entry point (`Bot.send_message`).

> [card] [probe()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-probe.md)
>
> Check connectivity/credentials without processing messages.

> [card] [health()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-health.md)
>
> Report health. Default reflects the default run state and uptime.

> [card] [canonicalize()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-canonicalize.md)
>
> Map a raw, potentially-volatile platform id to a stable canonical id.

> [card] [max\_message\_length()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-max_message_length.md)
>
> Platform max message length (0 = unlimited).

> [card] [supports\_edit()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-supports_edit.md)
>
> Whether the platform supports in-place message edits.

> [card] [supports\_typing()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-supports_typing.md)
>
> Whether the platform supports typing indicators.

> [card] [supports\_delete()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-supports_delete.md)
>
> Whether the platform supports deleting a sent message.

> [card] [format\_message()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-format_message.md)
>
> Render *text* for the platform's declared `markdown_dialect`.

> [card] [chunk()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-chunk.md)
>
> Split *text* to respect the platform max length.

> [card] [send\_typing()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-send_typing.md)
>
> Send a typing indicator. Default no-op unless capability set.

> [card] [edit\_message()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-edit_message.md)
>
> Edit an existing message.

> [card] [delete\_message()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-delete_message.md)
>
> Delete a previously sent message.

> [card] [classify\_error()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-classify_error.md)
>
> Map a native send exception into a classified :class:`SendResult`.

> [card] [deliver()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BasePlatformAdapter-deliver.md)
>
> Robustly deliver *content*, inheriting all shared machinery.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/bots/base.py#L466)
>
> `praisonaiagents/bots/base.py` at line 466


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.