Raven
Raven copied to clipboard
feat(ai): add send message raven ai function
Add "Send Message" AI Function for Agent Communication
Overview
Introduces a new Send Message AI function that allows bots to send messages to users and channels mentioned in conversations.
Key Features
- Message Targeting: Parses
@usernameand#channelmentions from messages - Multi-format Support: Handles text content, file attachments, and document links
- Auto-channel Creation: Creates DM channels for user mentions automatically
- Validation: Ensures either content or file is provided
Technical Changes
- Added
send_message()function with mention parsing logic - Added
extract_channel_mentions()method toRavenMessageclass - Added
current_message_idparameter passing in AI handler to let the bot know the current message which would contain the mentions.
Impact
- Enables proactive bot communication workflows. In future we can use this function to handover tasks between agents.
- Allows bots to notify relevant users about document updates, alerts, etc.
- Supports multi-modal messaging (text, files, document links)
Video and Screenshots:
Expenso sends created expense claim to other user via mention(An example of us being able to send DocTypeLinks) -
https://github.com/user-attachments/assets/bbc525f7-4946-469d-9485-97bbb4d4d4a7
Report Wizard sends insights and charts generated to user and channel mentions -
This looks great.. Does this logic account for messages where the agent is explicitly mentioned (@agent_name) in channels?