public class ResponseHandler extends Object
| Constructor and Description |
|---|
ResponseHandler() |
| Modifier and Type | Method and Description |
|---|---|
static Content |
getContent(GenerateContentResponse response)
Gets the content in a GenerateContentResponse.
|
static Candidate.FinishReason |
getFinishReason(GenerateContentResponse response)
Gets the finish reason in a GenerateContentResponse.
|
static com.google.common.collect.ImmutableList<FunctionCall> |
getFunctionCalls(GenerateContentResponse response)
Gets the list of function calls in a GenerateContentResponse.
|
static String |
getText(GenerateContentResponse response)
Gets the text message in a GenerateContentResponse.
|
public static String getText(GenerateContentResponse response)
response - a GenerateContentResponse instanceIllegalArgumentException - if the response has 0 or more than 1 candidates, or if the
response is blocked by safety reason or unauthorized citationspublic static com.google.common.collect.ImmutableList<FunctionCall> getFunctionCalls(GenerateContentResponse response)
response - a GenerateContentResponse instanceFunctionCall in the responseIllegalArgumentException - if the response has 0 or more than 1 candidatespublic static Content getContent(GenerateContentResponse response)
response - a GenerateContentResponse instanceContent in the responseIllegalArgumentException - if the response has 0 or more than 1 candidates, or if the
response is blocked by safety reason or unauthorized citationspublic static Candidate.FinishReason getFinishReason(GenerateContentResponse response)
response - a GenerateContentResponse instanceFinishReason in the responseIllegalArgumentException - if the response has 0 or more than 1 candidatesCopyright © 2024 Google LLC. All rights reserved.