chatRaw method

  1. @override
Stream<String> chatRaw(
  1. String text, {
  2. List<Uint8List>? imageBytes,
  3. Uint8List? audioBytes,
  4. bool enableThinking = false,
})
override

Implementation

@override
Stream<String> chatRaw(
  String text, {
  List<Uint8List>? imageBytes,
  Uint8List? audioBytes,
  bool enableThinking = false,
}) {
  return chatRawMessage(
    jsonEncode({
      'role': 'user',
      'content': [
        for (final image in imageBytes ?? const <Uint8List>[])
          {'type': 'image', 'blob': base64Encode(image)},
        if (audioBytes != null)
          {'type': 'audio', 'blob': base64Encode(audioBytes)},
        {'type': 'text', 'text': text},
      ],
    }),
    enableThinking: enableThinking,
  );
}