Package com.google.genai.types
Class ComputeTokensResponse
-
- All Implemented Interfaces:
public abstract class ComputeTokensResponse extends JsonSerializable
Response for computing tokens.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classComputeTokensResponse.BuilderBuilder for ComputeTokensResponse.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description ComputeTokensResponse()
-
Method Summary
Modifier and Type Method Description abstract Optional<HttpResponse>sdkHttpResponse()Used to retain the full HTTP response. abstract Optional<List<TokensInfo>>tokensInfo()Lists of tokens info from the input. static ComputeTokensResponse.Builderbuilder()Instantiates a builder for ComputeTokensResponse. abstract ComputeTokensResponse.BuildertoBuilder()Creates a builder with the same values as this instance. static ComputeTokensResponsefromJson(String jsonString)Deserializes a JSON string to a ComputeTokensResponse object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
sdkHttpResponse
abstract Optional<HttpResponse> sdkHttpResponse()
Used to retain the full HTTP response.
-
tokensInfo
abstract Optional<List<TokensInfo>> tokensInfo()
Lists of tokens info from the input. A ComputeTokensRequest could have multiple instances with a prompt in each instance. We also need to return lists of tokens info for the request with multiple instances.
-
builder
static ComputeTokensResponse.Builder builder()
Instantiates a builder for ComputeTokensResponse.
-
toBuilder
abstract ComputeTokensResponse.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static ComputeTokensResponse fromJson(String jsonString)
Deserializes a JSON string to a ComputeTokensResponse object.
-
-
-
-