Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see
Model versions and lifecycle .
Send feedback
Interface LogprobsResult.CandidateOrBuilder (1.33.0)
Stay organized with collections
Save and categorize content based on your preferences.
public static interface LogprobsResult . CandidateOrBuilder extends MessageOrBuilder
Methods
getLogProbability()
public abstract float getLogProbability ()
The candidate's log probability.
optional float log_probability = 2;
Returns
Type
Description
float
The logProbability.
getToken()
public abstract String getToken ()
The candidate’s token string value.
optional string token = 1;
Returns
Type
Description
String
The token.
getTokenBytes()
public abstract ByteString getTokenBytes ()
The candidate’s token string value.
optional string token = 1;
Returns
Type
Description
ByteString
The bytes for token.
getTokenId()
public abstract int getTokenId ()
The candidate’s token id value.
optional int32 token_id = 3;
Returns
Type
Description
int
The tokenId.
hasLogProbability()
public abstract boolean hasLogProbability ()
The candidate's log probability.
optional float log_probability = 2;
Returns
Type
Description
boolean
Whether the logProbability field is set.
hasToken()
public abstract boolean hasToken ()
The candidate’s token string value.
optional string token = 1;
Returns
Type
Description
boolean
Whether the token field is set.
hasTokenId()
public abstract boolean hasTokenId ()
The candidate’s token id value.
optional int32 token_id = 3;
Returns
Type
Description
boolean
Whether the tokenId field is set.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-04 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Interface LogprobsResult.CandidateOrBuilder (1.32.0)\n\n public static interface LogprobsResult.CandidateOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getLogProbability()\n\n public abstract float getLogProbability()\n\nThe candidate's log probability.\n\n`optional float log_probability = 2;`\n\n### getToken()\n\n public abstract String getToken()\n\nThe candidate's token string value.\n\n`optional string token = 1;`\n\n### getTokenBytes()\n\n public abstract ByteString getTokenBytes()\n\nThe candidate's token string value.\n\n`optional string token = 1;`\n\n### getTokenId()\n\n public abstract int getTokenId()\n\nThe candidate's token id value.\n\n`optional int32 token_id = 3;`\n\n### hasLogProbability()\n\n public abstract boolean hasLogProbability()\n\nThe candidate's log probability.\n\n`optional float log_probability = 2;`\n\n### hasToken()\n\n public abstract boolean hasToken()\n\nThe candidate's token string value.\n\n`optional string token = 1;`\n\n### hasTokenId()\n\n public abstract boolean hasTokenId()\n\nThe candidate's token id value.\n\n`optional int32 token_id = 3;`"]]