File tree 1 file changed +7
-3
lines changed
firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,14 @@ class GenerateContentResponse(
33
33
/* * Convenience field representing the first text part in the response, if it exists. */
34
34
val text: String? by lazy { firstPartAs<TextPart >()?.text }
35
35
36
- /* * Convenience field representing the first text part in the response, if it exists. */
37
- val functionCall: FunctionCallPart ? by lazy { firstPartAs() }
36
+ /* * Convenience field to get all the function call parts in the request, if they exist */
37
+ val functionCalls: List <FunctionCallPart > by lazy {
38
+ candidates.first().content.parts.filterIsInstance<FunctionCallPart >()
39
+ }
38
40
39
- /* * Convenience field representing the first text part in the response, if it exists. */
41
+ /* *
42
+ * Convenience field representing the first function response part in the response, if it exists.
43
+ */
40
44
val functionResponse: FunctionResponsePart ? by lazy { firstPartAs() }
41
45
42
46
private inline fun <reified T : Part > firstPartAs (): T ? {
You can’t perform that action at this time.
0 commit comments