Skip to main content

Overview

The speak method allows you to make the AI agent speak specific text directly, without any processing. It’s basically Text-to-Speech.

Using speak Method

The React SDK provides a speak method on the conversation object:
The text will be added to the context as a message item.

Key Differences

MethodPurposeBehavior
sendText()Send user messageAI processes the message and generates a response
speak()Direct speech outputAI speaks the exact text provided without processing

Example Usage

Common Use Cases

  • System announcements: Status updates or notifications
  • Predefined responses: Quick replies without AI processing
  • Error messages: Speaking error states directly
  • Welcome messages: Greeting users with specific text
  • Instructions: Providing step-by-step guidance

Complete Example