aiMessage
Send a message to an active AI agent session on the call. Use this to inject context, instructions, or simulated user input into a running AI conversation.
This method requires an active AI session started via
ai(). Calling it without
an active session has no effect.
Parameters
messageText
The message text to send to the AI agent.
role
The role of the message sender. Valid values:
"user"— simulate user input"system"— send a system-level instruction"assistant"— inject an assistant response
reset
Reset configuration. Allows resetting AI state such as the conversation history or functions.
globalData
Update the global data accessible to the AI and SWAIG functions.
Returns
Promise<Record<string, unknown>> — Server response confirming the message was sent.