MessageNormalizer class

Concrete implementation of MessageNormalizerService.

Handles response format differences across AI providers:

  • Anthropic: content blocks with type: 'text', 'thinking', 'tool_use'
  • OpenAI: choices[0].message.content + tool_calls[]
  • Gemini: candidates[0].content.parts[{text: '...'}]
  • Fallback: treats the response as plain text
Implemented types

Constructors

MessageNormalizer()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

normalize(Map<String, dynamic> providerResponse, String provider) NormalizedMessage
Normalizes a raw providerResponse map from the given provider into a NormalizedMessage.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited