decode method

  1. @override
Stream<ChatResponseUpdate> decode(
  1. Stream<String> tokens
)
override

Splits a raw generated-token stream into M.E.AI updates, separating prose (TextContent), reasoning (TextReasoningContent), and tool calls (FunctionCallContent).

Text and tool calls must be emitted in separate updates: FunctionInvokingChatClient suppresses any update carrying a function call, so combining them would drop the prose.

Implementation

@override
Stream<ChatResponseUpdate> decode(Stream<String> tokens) =>
    const MarkedToolCallDecoder(
      openMarker: '<tool_call>',
      parse: _parse,
    ).decode(tokens);