chat method
Send a message and get streaming response as plain text chunks.
Implementation
Stream<String> chat(
String text, {
Uint8List? imageBytes,
Uint8List? audioBytes,
bool enableThinking = false,
}) {
final messageJson =
buildMessageJson(text, imageBytes: imageBytes, audioBytes: audioBytes);
final extraContext = enableThinking ? '{"enable_thinking": true}' : null;
return sendMessageStreamRaw(messageJson, extraContext: extraContext)
.map(extractTextFromResponse);
}