> ## 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**](../modules/base) module.

<Badge color="blue">AI Agent</Badge>

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.

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

<ResponseField name="capabilities" type="PlatformCapabilities">
  No description available.
</ResponseField>

<ResponseField name="max_retries" type="int">
  No description available.
</ResponseField>

<ResponseField name="retry_base_delay" type="float">
  No description available.
</ResponseField>

<ResponseField name="supervised_inbound" type="bool">
  No description available.
</ResponseField>

## Methods

<CardGroup cols={2}>
  <Card title="connect()" icon="function" href="../functions/BasePlatformAdapter-connect">
    Establish the platform connection.
  </Card>

  <Card title="disconnect()" icon="function" href="../functions/BasePlatformAdapter-disconnect">
    Tear down the platform connection and release resources.
  </Card>

  <Card title="send()" icon="function" href="../functions/BasePlatformAdapter-send">
    Send a single message to *chat\_id* (one API call, no chunking).
  </Card>

  <Card title="get_chat_info()" icon="function" href="../functions/BasePlatformAdapter-get_chat_info">
    Return metadata about a chat/channel (at least an `id` key).
  </Card>

  <Card title="start()" icon="function" href="../functions/BasePlatformAdapter-start">
    Establish the connection and run the inbound loop until stopped.
  </Card>

  <Card title="stop()" icon="function" href="../functions/BasePlatformAdapter-stop">
    Signal the inbound loop to stop and tear down the connection.
  </Card>

  <Card title="max_message_length()" icon="function" href="../functions/BasePlatformAdapter-max_message_length">
    Platform max message length (0 = unlimited).
  </Card>

  <Card title="supports_edit()" icon="function" href="../functions/BasePlatformAdapter-supports_edit">
    Whether the platform supports in-place message edits.
  </Card>

  <Card title="supports_typing()" icon="function" href="../functions/BasePlatformAdapter-supports_typing">
    Whether the platform supports typing indicators.
  </Card>

  <Card title="format_message()" icon="function" href="../functions/BasePlatformAdapter-format_message">
    Render *text* for the platform's declared `markdown_dialect`.
  </Card>

  <Card title="chunk()" icon="function" href="../functions/BasePlatformAdapter-chunk">
    Split *text* to respect the platform max length.
  </Card>

  <Card title="send_typing()" icon="function" href="../functions/BasePlatformAdapter-send_typing">
    Send a typing indicator. Default no-op unless capability set.
  </Card>

  <Card title="edit_message()" icon="function" href="../functions/BasePlatformAdapter-edit_message">
    Edit an existing message.
  </Card>

  <Card title="delete_message()" icon="function" href="../functions/BasePlatformAdapter-delete_message">
    Delete a message. Default: not supported → returns False.
  </Card>

  <Card title="classify_error()" icon="function" href="../functions/BasePlatformAdapter-classify_error">
    Map a native send exception into a classified :class:`SendResult`.
  </Card>

  <Card title="deliver()" icon="function" href="../functions/BasePlatformAdapter-deliver">
    Robustly deliver *content*, inheriting all shared machinery.
  </Card>
</CardGroup>

## Source

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