inlineDataParts property

Iterable<InlineDataPart> get inlineDataParts

The inline data parts of the first candidate in candidates, if any.

Returns an empty list if there are no candidates, or if the first candidate has no InlineDataPart parts. There is no error thrown if the prompt or response were blocked.

Implementation

Iterable<InlineDataPart> get inlineDataParts =>
    candidates.firstOrNull?.content.parts
        .whereType<InlineDataPart>()
        .where((p) => p.isThought != true) ??
    const [];