Connection-time configuration
Often you need to pass configuration to the server when starting the bot — a system prompt, preferred language, user preferences, or any other data the server needs before the pipeline runs. Pass it viarequestData in startBotAndConnect().
On the server, your endpoint receives this data as the request body and can forward relevant values to the bot process or use them to configure the pipeline:
Sending messages to the server
UsesendClientMessage() to send a fire-and-forget message to the bot. The server handles it and is not expected to send a direct response.
On the server, handle it via the on_client_message event handler or from inside a FrameProcessor:
Requesting data from the server
UsesendClientRequest() to send a message and wait for a response. Useful for querying server state or triggering an action that needs to confirm success or failure.
On the server, respond with send_server_response() or push a RTVIServerResponseFrame:
Receiving messages from the server
The server can push unsolicited messages to the client at any time — for example, to notify the client that a setting has changed. On the server, send messages viasend_server_message() or by pushing a RTVIServerMessageFrame:
API reference
Client Methods
sendClientMessage, sendClientRequest, registerFunctionCallHandlerCallbacks & Events
onServerMessage, onMessageError, and related events