start • AI Agent SDK

start: Establish the connection and run the inbound loop until stopped.

start

Async

Method

</div>

This is a method of the BasePlatformAdapter class in the base module.

Establish the connection and run the inbound loop until stopped.

This is the seam the wrapper’s supervision layer wraps: an adapter’s `start` should run its inbound source (poll/listen/socket) and only return when the channel is stopped cleanly, raising on an unexpected drop so the supervisor can reconnect with backoff. Concrete adapters with a blocking platform loop override this.

Default: :meth:connect (passing `is_reconnect on supervised restarts), raise if it fails so the supervisor backs off, then hold until :meth:stop — suitable for push/callback transports whose connect` registers their inbound listener.

Signature

python
async def start() -> None

Uses

  • asyncio.Event
  • connect
  • ConnectionError
  • stop_event.is_set
  • time.time
  • stop_event.wait
  • contextlib.suppress
  • disconnect

Used By

Source

View on GitHub

praisonaiagents/bots/base.py at line 554