Send messages on behalf of the user programmatically
sendUserMessage()
method allows you to programmatically send text messages on behalf of the user. This is useful for sending contextual information or triggering specific persona responses without actual user input.
sendUserMessage()
are not automatically added to the
transcript. To maintain an accurate conversation history, you must manually
add these messages to your transcript display.sendUserMessage()
method differs from regular user messages in that:
sendUserMessage()
method enables you to implement your own client-side speech-to-text transcription. You can capture and transcribe audio using your preferred service, then send the transcribed messages directly:
sendUserMessage()
with proper transcript management:
sendSystemMessage()
method that will be better suited for sending contextual information and
system-level messages to the LLM. This will provide clearer separation between
user messages and system context.