File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
firebase-ai/src/main/kotlin/com/google/firebase/ai/type Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,18 @@ public class GenerateContentResponse(
44
44
candidates.first().content.parts.filterIsInstance<FunctionCallPart >()
45
45
}
46
46
47
+ /* *
48
+ * Convenience field representing all the [InlineDataPart]s in the first candidate, if they exist.
49
+ *
50
+ * This also includes any [ImagePart], but they will be represented as [InlineDataPart] instead.
51
+ */
52
+ public val inlineDataParts: List <InlineDataPart > by lazy {
53
+ candidates.first().content.parts.let { parts ->
54
+ parts.filterIsInstance<ImagePart >().map { it.toInlineDataPart() } +
55
+ parts.filterIsInstance<InlineDataPart >()
56
+ }
57
+ }
58
+
47
59
@Serializable
48
60
internal data class Internal (
49
61
val candidates : List <Candidate .Internal >? = null ,
You can’t perform that action at this time.
0 commit comments