rpc_ai_message
rpc_ai_message
Send a message, global data, or both to the AI agent running on another call. Useful for cross-call coordination, such as notifying a held caller’s agent about a status change or handing it a value to speak later.
A message lands as a turn in the other agent’s conversation, where it competes
with everything else arriving that moment. Global data is merged silently into
the other call’s global_data and stays there until a prompt expands it with
${global_data.key}, which makes it the more reliable channel for content a
later step needs to say.
Parameters
call_id
Call ID of the target call whose AI agent should receive the message.
message_text
The message text to inject into the target AI’s conversation.
role
Role for the injected message. Typically "system" for instructions. Sent
only when message_text is given.
global_data
Object merged into the target call’s global_data. See also
rpc_ai_global_data().
Raises
ValueError when neither message_text nor global_data is given.
Returns
FunctionResult — self, for chaining.