Response message for [PredictionService.GenerateContent].
Output only. Generated candidates.
modelVersion
string
Output only. The model version used to generate the response.
Output only. timestamp when the request is made to the server.
Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z"
, "2014-10-02T15:01:23.045123456Z"
or "2014-10-02T15:01:23+05:30"
.
responseId
string
Output only. responseId is used to identify each response. It is the encoding of the eventId.
Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.
Usage metadata about the response(s).
JSON representation |
---|
{ "candidates": [ { object ( |
Candidate
A response candidate generated from the model.
index
integer
Output only. Index of the candidate.
Output only. Content parts of the candidate.
avgLogprobs
number
Output only. Average log probability score of the candidate.
Output only. log-likelihood scores for the response tokens and top tokens
Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.
Output only. List of ratings for the safety of a response candidate.
There is at most one rating per category.
Output only. Source attribution of the generated content.
Output only. metadata specifies sources used to ground generated content.
finishMessage
string
Output only. Describes the reason the mode stopped generating tokens in more detail. This is only filled when finishReason
is set.
JSON representation |
---|
{ "index": integer, "content": { object ( |
LogprobsResult
Logprobs result
Length = total number of decoding steps.
Length = total number of decoding steps. The chosen candidates may or may not be in topCandidates.
JSON representation |
---|
{ "topCandidates": [ { object ( |
TopCandidates
Candidates with top log probabilities at each decoding step.
Sorted by log probability in descending order.
JSON representation |
---|
{
"candidates": [
{
object ( |
Candidate
Candidate for the logprobs token and score.
token
string
The candidate's token string value.
tokenId
integer
The candidate's token id value.
logProbability
number
The candidate's log probability.
JSON representation |
---|
{ "token": string, "tokenId": integer, "logProbability": number } |
FinishReason
The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.
Enums | |
---|---|
FINISH_REASON_UNSPECIFIED |
The finish reason is unspecified. |
STOP |
token generation reached a natural stopping point or a configured stop sequence. |
MAX_TOKENS |
token generation reached the configured maximum output tokens. |
SAFETY |
token generation stopped because the content potentially contains safety violations. NOTE: When streaming, content is empty if content filters blocks the output. |
RECITATION |
The token generation stopped because of potential recitation. |
OTHER |
All other reasons that stopped the token generation. |
BLOCKLIST |
token generation stopped because the content contains forbidden terms. |
PROHIBITED_CONTENT |
token generation stopped for potentially containing prohibited content. |
SPII |
token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII). |
MALFORMED_FUNCTION_CALL |
The function call generated by the model is invalid. |
SafetyRating
Safety rating corresponding to the generated content.
Output only. Harm category.
Output only. Harm probability levels in the content.
probabilityScore
number
Output only. Harm probability score.
Output only. Harm severity levels in the content.
severityScore
number
Output only. Harm severity score.
blocked
boolean
Output only. Indicates whether the content was filtered out because of this rating.
JSON representation |
---|
{ "category": enum ( |
HarmProbability
Harm probability levels in the content.
Enums | |
---|---|
HARM_PROBABILITY_UNSPECIFIED |
Harm probability unspecified. |
NEGLIGIBLE |
Negligible level of harm. |
LOW |
Low level of harm. |
MEDIUM |
Medium level of harm. |
HIGH |
High level of harm. |
HarmSeverity
Harm severity levels.
Enums | |
---|---|
HARM_SEVERITY_UNSPECIFIED |
Harm severity unspecified. |
HARM_SEVERITY_NEGLIGIBLE |
Negligible level of harm severity. |
HARM_SEVERITY_LOW |
Low level of harm severity. |
HARM_SEVERITY_MEDIUM |
Medium level of harm severity. |
HARM_SEVERITY_HIGH |
High level of harm severity. |
CitationMetadata
A collection of source attributions for a piece of content.
Output only. List of citations.
JSON representation |
---|
{
"citations": [
{
object ( |
Citation
Source attributions for content.
startIndex
integer
Output only. Start index into the content.
endIndex
integer
Output only. End index into the content.
uri
string
Output only. url reference of the attribution.
title
string
Output only. title of the attribution.
license
string
Output only. License of the attribution.
Output only. Publication date of the attribution.
JSON representation |
---|
{
"startIndex": integer,
"endIndex": integer,
"uri": string,
"title": string,
"license": string,
"publicationDate": {
object ( |
PromptFeedback
Content filter results for a prompt sent in the request.
Output only. Blocked reason.
Output only. Safety ratings.
blockReasonMessage
string
Output only. A readable block reason message.
JSON representation |
---|
{ "blockReason": enum ( |
BlockedReason
Blocked reason enumeration.
Enums | |
---|---|
BLOCKED_REASON_UNSPECIFIED |
Unspecified blocked reason. |
SAFETY |
Candidates blocked due to safety. |
OTHER |
Candidates blocked due to other reason. |
BLOCKLIST |
Candidates blocked due to the terms which are included from the terminology blocklist. |
PROHIBITED_CONTENT |
Candidates blocked due to prohibited content. |
UsageMetadata
Usage metadata about response(s).
promptTokenCount
integer
Number of tokens in the request. When cachedContent
is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.
candidatesTokenCount
integer
Number of tokens in the response(s).
thoughtsTokenCount
integer
Output only. Number of tokens present in thoughts output.
totalTokenCount
integer
Total token count for prompt, response candidates, and tool-use prompts (if present).
cachedContentTokenCount
integer
Output only. Number of tokens in the cached part in the input (the cached content).
Output only. List of modalities that were processed in the request input.
Output only. List of modalities of the cached content in the request input.
Output only. List of modalities that were returned in the response.
JSON representation |
---|
{ "promptTokenCount": integer, "candidatesTokenCount": integer, "thoughtsTokenCount": integer, "totalTokenCount": integer, "cachedContentTokenCount": integer, "promptTokensDetails": [ { object ( |