InsightsCardResponse class

A typed response for life insights cards.

Example usage:

final response = await Syni.generate(SyniRequest(
  personaId: 'life.insights.v1',
  input: 'What should I focus on today?',
));
final insights = InsightsCardResponse.fromSyniResponse(response);
for (final card in insights.cards) {
  print('${card.title}: ${card.body}');
}

Constructors

InsightsCardResponse({required List<InsightCard> cards, String? summary, required SyniResponseMeta meta})
const
InsightsCardResponse.fromSyniResponse(SyniResponse response)
Creates an InsightsCardResponse from a raw SyniResponse.
factory

Properties

cards List<InsightCard>
The list of insight cards.
final
cardsByPriority List<InsightCard>
Gets cards sorted by priority (highest first).
no setter
hasCards bool
Whether there are any cards available.
no setter
hashCode int
The hash code for this object.
no setterinherited
meta SyniResponseMeta
Response metadata from Syni.
final
primaryCard InsightCard?
Gets the primary/first card, if available.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
summary String?
Optional summary or overview message.
final

Methods

cardsByType(InsightCardType type) List<InsightCard>
Gets cards filtered by type.
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