AI Integration Quick Reference
AI Integration Quick Reference
CometChat.init() + CometChat.login() completed, AI features enabled in Dashboard
Event flow: Run Start -> Tool Call(s) -> Text Message Stream -> Run FinishedAgents only respond to text messages.
Sending a Message to an AI Agent
Send a text message to an agent’s UID like any other user:- Swift
Agent Run Lifecycle and Message Flow
When a user sends a text message to an Agent:- The platform starts a run and streams real-time events via
AIAssistantEventsDelegate - After the run completes, persisted Agentic Messages arrive via
CometChatMessageDelegate
Real-time Events
Events are received viaonAIAssistantEventReceived as AIAssistantBaseEvent objects, in this order:
Run Start and Run Finished are always emitted. Tool Call events only appear when tools are invoked. Text Message events are always emitted and carry the assistant’s reply incrementally.- Swift
Agentic Messages
After the run completes, these messages arrive viaCometChatMessageDelegate:
- Swift
Next Steps
AI Chatbots
Set up AI-powered chatbots for automated conversations
AI Moderation
Automatically moderate messages with AI
AI User Copilot
AI-powered features like smart replies and conversation summaries
Send Messages
Send text messages that trigger AI Agent responses