* Send a text message instead of voice.
(text: string)
| 203 | * Send a text message instead of voice. |
| 204 | */ |
| 205 | sendText(text: string): void { |
| 206 | if (!this.connection || this.state.status !== 'connected') { |
| 207 | return |
| 208 | } |
| 209 | |
| 210 | // Add user message |
| 211 | const userMessage: RealtimeMessage = { |
| 212 | id: this.generateId(), |
| 213 | role: 'user', |
| 214 | timestamp: Date.now(), |
| 215 | parts: [{ type: 'text', content: text }], |
| 216 | } |
| 217 | this.addMessage(userMessage) |
| 218 | |
| 219 | // Send to provider |
| 220 | this.connection.sendText(text) |
| 221 | } |
| 222 | |
| 223 | /** |
| 224 | * Send an image to the conversation. |
no test coverage detected