public static ImmutableList<FunctionCall> getFunctionCalls(GenerateContentResponse response) {
    getFinishReason(response);
    return response.getCandidates(0).getContent().getPartsList().stream()
        .filter((part) -> part.hasFunctionCall())
        .map((part) -> part.getFunctionCall())
        .collect(ImmutableList.toImmutableList());
  }
Gets the list of function calls in a GenerateContentResponse.

@param response a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance
@return a list of {@link com.google.cloud.vertexai.api.FunctionCall} in the response
@throws IllegalArgumentException if the response has 0 or more than 1 candidates
java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/ResponseHandler.java