Skip to main content
Point a channel at your adapter class from YAML, or drop a .py file into .praisonai/channels/, and praisonai gateway start picks it up — no pip install, no register_platform() call. Your agent replies on the custom channel the same way it does on a built-in one — the channel is just a new door into the same agent.

Quick Start

1

YAML adapter: import string

Point a channel at your adapter class with a dotted "module:Class" string. The gateway imports, validates, and self-registers it before startup.
2

Drop-in file

Copy a single-file adapter into ~/.praisonai/channels/ and start — no packaging, no config edit.
Any BasePlatformAdapter subclass in the file registers under its platform_name.

How It Works

The gateway resolves a channel’s adapter class from three inputs, self-registers it, then starts it like any built-in. A single-file adapter needs only the four abstract methods:

Choosing Between the Surfaces

Five registration paths reach the same adapter class — pick the one that matches your packaging.

Precedence Ladder

The first surface that resolves a channel key wins — a registered platform is never shadowed.

Trust Model

User-global drop-ins are trusted; project-local drop-ins require an explicit opt-in.
Files in ./.praisonai/channels/ (project-local) load only when PRAISONAI_ALLOW_PROJECT_PLUGINS=true. This mirrors the single-file plugin trust gate: code that ships inside a checked-out repo should not run on the gateway host without your consent. Files in ~/.praisonai/channels/ (user-global) are trusted and always load.
The trust check is scoped to the channels directory, so a symlinked channels dir is still recognised while a symlinked file cannot slip the gate.

Configuration Options

The adapter field is the only new YAML key — it is a loader-only hint and is never passed to the adapter’s __init__. If the adapter class exposes a channel_descriptor (attribute or callable), that descriptor is used at registration; otherwise the channel registers with descriptor=None.

Common Patterns

Enterprise intranet chat (YAML adapter:)

Point a channel at a packaged internal adapter and pull the token from the environment.

Prototype in one file (drop-in)

Skip packaging entirely — drop a single file into the user-global directory.

Overriding a built-in

You cannot silently override a built-in from adapter: — a registered platform always wins. To swap a built-in, register in code before startup.

Error Surface

Malformed refs fail fast with a clear ValueError so a typo never starts a silent, broken channel.

Best Practices

Store the adapter file in a checked-in project path and copy it into ~/.praisonai/channels/ at deploy time, so the running channel is reproducible from source control.
Reference tokens as ${INTRANET_TOKEN} in gateway.yaml. Never inline a secret in the YAML or the drop-in file — both are easy to leak.
A single-file adapter should import only BasePlatformAdapter and stdlib. Do heavy SDK imports lazily inside connect() so a missing dependency never breaks gateway startup.
When an adapter is shared across teams, promote it to a praisonai.channels entry point. Packaging gives you versioning and dependency pinning that a drop-in file cannot.

Bot Platform Plugins

All five registration paths and the precedence ladder.

Build a Platform Adapter

Subclass BasePlatformAdapter — chunking, retries, typing for free.