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(
4444 candidates.first().content.parts.filterIsInstance<FunctionCallPart >()
4545 }
4646
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+
4759 @Serializable
4860 internal data class Internal (
4961 val candidates : List <Candidate .Internal >? = null ,
You can’t perform that action at this time.
0 commit comments