ai_message
ai_message
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
message_text
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.
global_data
Update the global data accessible to the AI and SWAIG functions.
Returns
dict — Server response confirming the message was sent.