Overview
Thespeak
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 aspeak
method on the conversation object:
The text will be added to the context as a message item.
Key Differences
Method | Purpose | Behavior |
---|---|---|
sendText() | Send user message | AI processes the message and generates a response |
speak() | Direct speech output | AI 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