public class ResponseHandlerDeprecated. This class and its package are deprecated. See the migration guide for more details.
Helper class to post-process GenerateContentResponse.
Static Methods
getContent(GenerateContentResponse response) (deprecated)
public static Content getContent(GenerateContentResponse response)Gets the content in a GenerateContentResponse.
| Parameter | |
|---|---|
| Name | Description |
response |
GenerateContentResponsea com.google.cloud.vertexai.api.GenerateContentResponse instance |
| Returns | |
|---|---|
| Type | Description |
Content |
the com.google.cloud.vertexai.api.Content in the response |
getFinishReason(GenerateContentResponse response) (deprecated)
public static Candidate.FinishReason getFinishReason(GenerateContentResponse response)Gets the finish reason in a GenerateContentResponse.
| Parameter | |
|---|---|
| Name | Description |
response |
GenerateContentResponsea com.google.cloud.vertexai.api.GenerateContentResponse instance |
| Returns | |
|---|---|
| Type | Description |
Candidate.FinishReason |
the com.google.cloud.vertexai.api.FinishReason in the response |
getFunctionCalls(GenerateContentResponse response) (deprecated)
public static ImmutableList<FunctionCall> getFunctionCalls(GenerateContentResponse response)Gets the list of function calls in a GenerateContentResponse.
| Parameter | |
|---|---|
| Name | Description |
response |
GenerateContentResponsea com.google.cloud.vertexai.api.GenerateContentResponse instance |
| Returns | |
|---|---|
| Type | Description |
com.google.common.collect.ImmutableList<FunctionCall> |
a list of com.google.cloud.vertexai.api.FunctionCall in the response |
getText(GenerateContentResponse response) (deprecated)
public static String getText(GenerateContentResponse response)Gets the text message in a GenerateContentResponse.
| Parameter | |
|---|---|
| Name | Description |
response |
GenerateContentResponsea com.google.cloud.vertexai.api.GenerateContentResponse instance |
| Returns | |
|---|---|
| Type | Description |
String |
a String that aggregates all the text parts in the response |
Constructors
ResponseHandler() (deprecated)
public ResponseHandler()