Messaging Channels
Send messages across multiple platforms with PraisonAI channel tools
from praisonaiagents import Agent
from praisonai_tools import SignalTool
agent = Agent(name="Messenger", tools=[SignalTool()])
agent.start("Send a Signal message to +1234567890 saying hello")The user sends a message through a channel; the agent delivers it via the configured messaging tool.
Quick Start
- Simple Usage
python from praisonai_tools import SignalTool signal = SignalTool() signal.send_message(to="+1234567890", message="Hello!") - With Configuration
python from praisonai_tools import WhatsAppTool wa = WhatsAppTool() wa.send_message(to="+1234567890", message="Hello!")
Installation
pip install praisonai-toolsSignal
Signal ToolSend messages via Signal using signal-cli REST API.
Setup
- Install signal-cli REST API
Run the signal-cli-rest-api Docker container:
bash docker run -d --name signal-api -p 8080:8080 \ -v signal-cli-config:/home/.local/share/signal-cli \ bbernhard/signal-cli-rest-api - Link your device
Visit
http://localhost:8080/v1/qrcodelink?device_name=signal-apito link your Signal account. - Set environment variables
bash export SIGNAL_CLI_URL=http://localhost:8080 export SIGNAL_ACCOUNT=+1234567890
Usage
from praisonai_tools import SignalTool
signal = SignalTool()
result = signal.send_message(
to="+1234567890",
message="Hello from PraisonAI!"
)from praisonaiagents import Agent
from praisonai_tools import SignalTool
agent = Agent(
name="Notifier",
tools=[SignalTool()]
)
agent.start("Send a Signal message to +1234567890 saying hello")from praisonai_tools import SignalTool
signal = SignalTool()
# Send to group
signal.send_message(
to="group:abc123xyz",
message="Hello group!"
)
# List groups
groups = signal.list_groups()Actions
| Action | Description |
|---|---|
send | Send text message |
send_typing | Send typing indicator |
send_receipt | Send read receipt |
send_reaction | React to a message |
check | Check connection status |
list_groups | List all groups |
LINE
LINE ToolSend messages via LINE Messaging API.
Setup
- Create LINE Channel
Go to LINE Developers Console and create a Messaging API channel.
- Get credentials
Copy your Channel access token and Channel secret.
- Set environment variables
bash export LINE_CHANNEL_ACCESS_TOKEN=your_token export LINE_CHANNEL_SECRET=your_secret
Usage
from praisonai_tools import LineTool
line = LineTool()
result = line.push_message(
to="user_id",
message="Hello from PraisonAI!"
)from praisonai_tools import LineTool
line = LineTool()
result = line.broadcast(message="Hello everyone!")from praisonai_tools import LineTool
line = LineTool()
result = line.send_flex_message(
to="user_id",
alt_text="New notification",
contents={
"type": "bubble",
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{"type": "text", "text": "Hello!"}
]
}
}
)Actions
| Action | Description |
|---|---|
push | Push message to user |
reply | Reply with token |
multicast | Send to multiple users |
broadcast | Send to all followers |
get_profile | Get user profile |
get_quota | Get message quota |
iMessage
iMessage ToolSend messages via iMessage on macOS.
Setup
- Enable Messages.app
Ensure Messages.app is configured with your Apple ID.
- Grant permissions
Your terminal may need Accessibility and Automation permissions in System Preferences.
Usage
from praisonai_tools import iMessageTool
imsg = iMessageTool()
result = imsg.send_message(
to="+1234567890",
message="Hello from PraisonAI!"
)from praisonai_tools import iMessageTool
imsg = iMessageTool()
result = imsg.send_message(
to="user@example.com",
message="Hello!"
)from praisonai_tools import iMessageTool
imsg = iMessageTool()
status = imsg.check_availability()
print(status) # {'available': True, 'mode': 'applescript', 'macos': True}Actions
| Action | Description |
|---|---|
send | Send message |
check | Check availability |
list_chats | List recent chats |
Send messages via WhatsApp Business API.
Setup
- Create WhatsApp Business Account
Set up a WhatsApp Business API account.
- Get credentials
Copy your Access Token and Phone Number ID.
- Set environment variables
bash export WHATSAPP_ACCESS_TOKEN=your_token export WHATSAPP_PHONE_NUMBER_ID=your_phone_id
Usage
from praisonai_tools import WhatsAppTool
wa = WhatsAppTool()
result = wa.send_message(
to="+1234567890",
message="Hello from PraisonAI!"
)Using with Agents
All channel tools work seamlessly with PraisonAI agents:
from praisonaiagents import Agent
from praisonai_tools import SignalTool, LineTool, TelegramTool
# Create agent with multiple channels
agent = Agent(
name="MultiChannelBot",
instructions="Send notifications across multiple platforms",
tools=[SignalTool(), LineTool(), TelegramTool()]
)
# Agent decides which channel to use
agent.start("Notify John on Signal and the team on LINE about the meeting")Channel Comparison
| Feature | Signal | LINE | iMessage | Telegram | |
|---|---|---|---|---|---|
| Text | ✅ | ✅ | ✅ | ✅ | ✅ |
| Media | ✅ | ✅ | ❌ | ✅ | ✅ |
| Groups | ✅ | ✅ | ✅ | ✅ | ✅ |
| Reactions | ✅ | ❌ | ❌ | ❌ | ✅ |
| Typing | ✅ | ❌ | ❌ | ❌ | ✅ |
| Read Receipts | ✅ | ❌ | ❌ | ✅ | ✅ |
| Broadcast | ❌ | ✅ | ❌ | ✅ | ✅ |
| Platform | Any | Any | macOS | Any | Any |
Environment Variables
All Channel Environment Variables
| Variable | Channel | Description |
|---|---|---|
SIGNAL_CLI_URL | Signal | signal-cli REST API URL |
SIGNAL_ACCOUNT | Signal | Your Signal phone number |
LINE_CHANNEL_ACCESS_TOKEN | LINE | LINE channel access token |
LINE_CHANNEL_SECRET | LINE | LINE channel secret |
IMESSAGE_API_URL | iMessage | REST API URL (optional) |
IMESSAGE_MODE | iMessage | “applescript” or “rest” |
WHATSAPP_ACCESS_TOKEN | WhatsApp Business API token | |
WHATSAPP_PHONE_NUMBER_ID | Phone number ID | |
TELEGRAM_BOT_TOKEN | Telegram | Telegram Bot API token |
DISCORD_BOT_TOKEN | Discord | Discord bot token |
SLACK_BOT_TOKEN | Slack | Slack bot token |
Best Practices
Use channels for long-running agents
Channel-based communication is ideal for agents that need to send progress updates during execution.
Keep message payloads small
Send references (IDs, paths) rather than full data through channels to avoid memory issues.
Handle channel timeouts
Always set a timeout when waiting for channel messages to prevent agents from hanging.
Use typed messages
Define a message format for each channel to make inter-agent communication predictable.