Response message for [PredictionService.GenerateContent].
JSON representation |
---|
{ "candidates": [ { object ( |
Fields | |
---|---|
candidates[] |
Output only. Generated candidates. |
promptFeedback |
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. |
usageMetadata |
Usage metadata about the response(s). |
Candidate
A response candidate generated from the model.
JSON representation |
---|
{ "index": integer, "content": { object ( |
Fields | |
---|---|
index |
Output only. Index of the candidate. |
content |
Output only. Content parts of the candidate. |
finishReason |
Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens. |
safetyRatings[] |
Output only. List of ratings for the safety of a response candidate. There is at most one rating per category. |
citationMetadata |
Output only. Source attribution of the generated content. |
groundingMetadata |
Output only. metadata specifies sources used to ground generated content. |
finishMessage |
Output only. Describes the reason the mode stopped generating tokens in more detail. This is only filled when |
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 |
Natural stop point of the model or provided stop sequence. |
MAX_TOKENS |
The maximum number of tokens as specified in the request was reached. |
SAFETY |
The token generation was stopped as the response was flagged for safety reasons. NOTE: When streaming the Candidate.content will be empty if content filters blocked the output. |
RECITATION |
The token generation was stopped as the response was flagged for unauthorized citations. |
OTHER |
All other reasons that stopped the token generation |
BLOCKLIST |
The token generation was stopped as the response was flagged for the terms which are included from the terminology blocklist. |
PROHIBITED_CONTENT |
The token generation was stopped as the response was flagged for the prohibited contents. |
SPII |
The token generation was stopped as the response was flagged for Sensitive Personally Identifiable Information (SPII) contents. |
MALFORMED_FUNCTION_CALL |
The function call generated by the model is invalid. |
SafetyRating
Safety rating corresponding to the generated content.
JSON representation |
---|
{ "category": enum ( |
Fields | |
---|---|
category |
Output only. Harm category. |
probability |
Output only. Harm probability levels in the content. |
probabilityScore |
Output only. Harm probability score. |
severity |
Output only. Harm severity levels in the content. |
severityScore |
Output only. Harm severity score. |
blocked |
Output only. Indicates whether the content was filtered out because of this rating. |
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.
JSON representation |
---|
{
"citations": [
{
object ( |
Fields | |
---|---|
citations[] |
Output only. List of citations. |
Citation
Source attributions for content.
JSON representation |
---|
{
"startIndex": integer,
"endIndex": integer,
"uri": string,
"title": string,
"license": string,
"publicationDate": {
object ( |
Fields | |
---|---|
startIndex |
Output only. Start index into the content. |
endIndex |
Output only. End index into the content. |
uri |
Output only. url reference of the attribution. |
title |
Output only. title of the attribution. |
license |
Output only. License of the attribution. |
publicationDate |
Output only. Publication date of the attribution. |
GroundingMetadata
metadata returned to client when grounding is enabled.
JSON representation |
---|
{ "webSearchQueries": [ string ], "groundingChunks": [ { object ( |
Fields | |
---|---|
webSearchQueries[] |
Optional. Web search queries for the following-up web search. |
groundingChunks[] |
List of supporting references retrieved from specified grounding source. |
groundingSupports[] |
Optional. List of grounding support. |
searchEntryPoint |
Optional. Google search entry for the following-up web searches. |
SearchEntryPoint
Google search entry point.
JSON representation |
---|
{ "renderedContent": string, "sdkBlob": string } |
Fields | |
---|---|
renderedContent |
Optional. Web content snippet that can be embedded in a web page or an app webview. |
sdkBlob |
Optional. Base64 encoded JSON representing array of <search term, search url> tuple. A base64-encoded string. |
GroundingChunk
Grounding chunk.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field chunk_type . Chunk type. chunk_type can be only one of the following: |
|
web |
Grounding chunk from the web. |
retrievedContext |
Grounding chunk from context retrieved by the retrieval tools. |
Web
Chunk from the web.
JSON representation |
---|
{ "uri": string, "title": string } |
Fields | |
---|---|
uri |
URI reference of the chunk. |
title |
title of the chunk. |
RetrievedContext
Chunk from context retrieved by the retrieval tools.
JSON representation |
---|
{ "uri": string, "title": string } |
Fields | |
---|---|
uri |
URI reference of the attribution. |
title |
title of the attribution. |
GroundingSupport
Grounding support.
JSON representation |
---|
{
"groundingChunkIndices": [
integer
],
"confidenceScores": [
number
],
"segment": {
object ( |
Fields | |
---|---|
groundingChunkIndices[] |
A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. |
confidenceScores[] |
confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the groundingChunkIndices. |
segment |
Segment of the content this support belongs to. |
Segment
Segment of the content.
JSON representation |
---|
{ "partIndex": integer, "startIndex": integer, "endIndex": integer, "text": string } |
Fields | |
---|---|
partIndex |
Output only. The index of a Part object within its parent Content object. |
startIndex |
Output only. Start index in the given Part, measured in bytes. offset from the start of the Part, inclusive, starting at zero. |
endIndex |
Output only. End index in the given Part, measured in bytes. offset from the start of the Part, exclusive, starting at zero. |
text |
Output only. The text corresponding to the segment from the response. |
PromptFeedback
Content filter results for a prompt sent in the request.
JSON representation |
---|
{ "blockReason": enum ( |
Fields | |
---|---|
blockReason |
Output only. Blocked reason. |
safetyRatings[] |
Output only. Safety ratings. |
blockReasonMessage |
Output only. A readable block reason message. |
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).
JSON representation |
---|
{ "promptTokenCount": integer, "candidatesTokenCount": integer, "totalTokenCount": integer } |
Fields | |
---|---|
promptTokenCount |
Number of tokens in the request. |
candidatesTokenCount |
Number of tokens in the response(s). |
totalTokenCount |
|