ReasoningDetail class
Details about model reasoning, returned by some providers.
OpenRouter only. Not part of the official OpenAI API.
This is returned by OpenRouter when using models that support reasoning (e.g., DeepSeek R1). Different types indicate different content:
reasoning.summary: A summary of the reasoning processreasoning.text: The full reasoning textreasoning.encrypted: Encrypted reasoning data (base64 encoded)
Example
final message = response.firstChoice?.message;
if (message?.reasoningDetails != null) {
for (final detail in message!.reasoningDetails!) {
if (detail.type == 'reasoning.summary') {
print('Summary: ${detail.text}');
}
}
}
- Annotations
-
- @immutable
Constructors
- ReasoningDetail({required String type, String? text, String? data})
-
Creates a ReasoningDetail.
const
-
ReasoningDetail.fromJson(Map<
String, dynamic> json) -
Creates a ReasoningDetail from JSON.
factory
Properties
- data → String?
-
Encrypted data (for encrypted type, base64 encoded).
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isEncrypted → bool
-
Whether this is encrypted data.
no setter
- isSummary → bool
-
Whether this is a summary detail.
no setter
- isText → bool
-
Whether this is a text detail.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String?
-
The text content (for summary and text types).
final
- type → String
-
The type of reasoning detail.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts to JSON.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override