Streaming and Chunking
Clawdbot supports real-time streaming responses and automatic message chunking to ensure a smooth user experience across various platforms.
Streaming
What is Streaming?
Streaming allows AI responses to be displayed in real-time as they're generated, rather than waiting for the complete response before sending.
Stream Modes
{
channels: {
telegram: {
// Disable streaming
streamMode: "off",
// Partial streaming (periodic updates)
streamMode: "partial",
// Block streaming (update after complete blocks)
streamMode: "block"
}
}
}Mode Descriptions
| Mode | Description | Use Case |
|---|---|---|
off | Send once after completion | Low latency needs |
partial | Periodic message updates | Real-time feedback |
block | Update after complete paragraphs | Balanced experience |
Message Chunking
Automatic Chunking
Long messages are automatically split into multiple smaller messages:
{
channels: {
whatsapp: {
// Maximum characters per chunk
textChunkLimit: 4000
},
telegram: {
textChunkLimit: 4000
},
discord: {
textChunkLimit: 2000
}
}
}Chunking Rules
- Split at sentence boundaries (preferred)
- Split at paragraph boundaries
- Forced split (when limit reached)
Platform Limits
| Platform | Message Limit | Recommended Chunk Size |
|---|---|---|
| ~64KB | 4000 | |
| Telegram | 4096 | 4000 |
| Discord | 2000 | 2000 |
| Slack | 40000 | 4000 |
| Signal | ~64KB | 4000 |
Media Handling
Media Size Limits
{
media: {
// Images max 6MB
imageMaxMb: 6,
// Videos max 16MB
videoMaxMb: 16,
// Documents max 100MB
documentMaxMb: 100,
// Audio max 16MB
audioMaxMb: 16
}
}Media Optimization
Clawdbot automatically optimizes media files:
- Image compression and resizing
- Video transcoding
- Audio format conversion
Response Configuration
Acknowledgment Reactions
Automatically send emoji reactions when messages are received:
{
channels: {
whatsapp: {
// Reaction on message received
ackReaction: "👀",
// Reaction while processing
processingReaction: "🤔",
// Reaction when done
doneReaction: "✅"
}
}
}Typing Indicator
Show "typing..." status:
{
channels: {
telegram: {
// Enable typing indicator
typingIndicator: true
}
}
}Advanced Settings
Draft Streaming
Enable draft streaming in private chats:
{
channels: {
telegram: {
// Private chats only
draftStreaming: true
}
}
}Reply Mode
Control message reply behavior:
{
channels: {
telegram: {
// Reply mode
replyToMode: "first", // Reply to first only
// or
replyToMode: "all", // Reply to all
// or
replyToMode: "off" // Don't use replies
}
}
}Inline Buttons
Add interactive buttons to messages:
{
channels: {
telegram: {
// Enable inline buttons
inlineButtons: true
}
}
}Performance Optimization
Network Optimization
{
network: {
// Retry attempts
retryAttempts: 3,
// Retry delay (milliseconds)
retryDelay: 1000,
// Timeout (milliseconds)
timeout: 30000
}
}Cache Settings
{
cache: {
// Media cache size (MB)
mediaCacheSize: 100,
// Cache expiry (seconds)
expiry: 3600
}
}Next Steps
- Channel Configuration - Detailed platform configuration
- Configuration - Complete configuration reference