.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 Any
~/.praisonai/channels/ and start — no packaging, no config edit.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.channels dir is still recognised while a symlinked file cannot slip the gate.
Configuration Options
Theadapter 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 fromadapter: — a registered platform always wins. To swap a built-in, register in code before startup.
Error Surface
Malformed refs fail fast with a clearValueError so a typo never starts a silent, broken channel.
Best Practices
Keep adapters in a versioned repo path
Keep adapters in a versioned repo path
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.Pin secrets via ${ENV} refs, never inline
Pin secrets via ${ENV} refs, never inline
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.Keep the drop-in file dependency-free
Keep the drop-in file dependency-free
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.Package once the adapter is stable
Package once the adapter is stable
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.Related
Bot Platform Plugins
All five registration paths and the precedence ladder.
Build a Platform Adapter
Subclass
BasePlatformAdapter — chunking, retries, typing for free.
