chatRawMessage method

  1. @override
Stream<String> chatRawMessage(
  1. String messageJson, {
  2. bool enableThinking = false,
  3. SendOptions options = SendOptions.none,
})
override

Streams raw SDK JSON for a prebuilt message. This is how tool results go back: chatRaw always sends role user, and a tool result has to be role tool for the model to read it as the answer to its call.

Implementation

@override
Stream<String> chatRawMessage(
  String messageJson, {
  bool enableThinking = false,
  SendOptions options = SendOptions.none,
}) => _run(
  jsonDecode(messageJson) as Map<String, Object?>,
  raw: true,
  enableThinking: enableThinking,
  options: options,
);