Worked examples
Complete Slack, web chat, and cross-platform agent loops
Each example is a full loop: connect, handle inbound messages, stream a reply, and react to feedback.
Slack
The Slack adapter forwards five flavors of event:
Status updates translate to Slack’s assistant.threads.setStatus. Suggested prompts translate to assistant.threads.setSuggestedPrompts. CardAttachment ships Block Kit JSON straight through.
Node
Python
A Block Kit card with an action button:
When the user clicks View logs, you’ll get a PlatformFeedback.buttonClick event with buttonId: "view_logs" and value: "deploy-4837".
Web chat
Every message arrives from the web platform with a DM event kind. The two web-specific concerns are audio input and session-scoped conversations (one conversation ID per browser tab).
Node
Python
The bundled playground emits WEBM_OPUS at 48 kHz from MediaRecorder. Firefox emits OGG_OPUS. Branch on the config’s encoding to pick the right STT filetype.
Cross-platform agent
In practice a single agent serves both. The only platform-specific code is whether you open a Slack thread.
Node
Python
Next steps
- Files in chat: accept uploads and return downloads
- SDK reference: every exported symbol