Candidate

模型生成的候选回答。

JSON 表示法
{
  "content": {
    object (Content)
  },
  "finishReason": enum (FinishReason),
  "safetyRatings": [
    {
      object (SafetyRating)
    }
  ],
  "citationMetadata": {
    object (CitationMetadata)
  },
  "tokenCount": integer,
  "groundingAttributions": [
    {
      object (GroundingAttribution)
    }
  ],
  "index": integer
}
字段
content

object (Content)

仅供输出。从模型返回的生成内容。

finishReason

enum (FinishReason)

可选。仅供输出。模型停止生成令牌的原因。

如果为空,则表示模型尚未停止生成令牌。

safetyRatings[]

object (SafetyRating)

对候选回答的安全性的评分列表。

每个类别最多只能有一个评分。

citationMetadata

object (CitationMetadata)

仅供输出。模型生成的候选字词的引用信息。

此字段可能会填入 content 中包含的任何文本的朗诵信息。这些段落从基础 LLM 训练数据中受版权保护的材料中“抄袭”而来。

tokenCount

integer

仅供输出。此候选定位设置的令牌数。

groundingAttributions[]

object (GroundingAttribution)

仅供输出。提供有根据的回答的来源的归因信息。

对于 GenerateAnswer 调用,系统会填充此字段。

index

integer

仅供输出。候选项列表中候选字词的索引。

FinishReason

定义模型停止生成令牌的原因。

枚举
FINISH_REASON_UNSPECIFIED 默认值。此值未使用。
STOP 模型的自然停靠点或提供的停靠站。
MAX_TOKENS 已达到请求中指定的令牌数量上限。
SAFETY 出于安全原因,举报了候选人的内容。
RECITATION 该候选人的内容因背书原因被举报。
OTHER 原因未知。

GroundingAttribution

提供回答的来源的提供方说明。

JSON 表示法
{
  "sourceId": {
    object (AttributionSourceId)
  },
  "content": {
    object (Content)
  }
}
字段
sourceId

object (AttributionSourceId)

仅供输出。做出此提供方说明的来源的标识符。

content

object (Content)

构成此提供方说明的依据来源内容。

AttributionSourceId

做出此提供方说明的来源的标识符。

JSON 表示法
{

  // Union field source can be only one of the following:
  "groundingPassage": {
    object (GroundingPassageId)
  },
  "semanticRetrieverChunk": {
    object (SemanticRetrieverChunk)
  }
  // End of list of possible types for union field source.
}
字段

联合字段 source

source 只能是下列其中一项:

groundingPassage

object (GroundingPassageId)

内嵌段落的标识符。

semanticRetrieverChunk

object (SemanticRetrieverChunk)

通过语义检索器提取的 Chunk 的标识符。

GroundingPassageId

GroundingPassage 中某个部分的标识符。

JSON 表示法
{
  "passageId": string,
  "partIndex": integer
}
字段
passageId

string

仅供输出。与 GenerateAnswerRequestGroundingPassage.id 匹配的段落的 ID。

partIndex

integer

仅供输出。GenerateAnswerRequestGroundingPassage.content 中部分的索引。

SemanticRetrieverChunk

使用 SemanticRetrieverConfig 通过 GenerateAnswerRequest 中指定的语义检索器检索的 Chunk 的标识符。

JSON 表示法
{
  "source": string,
  "chunk": string
}
字段
source

string

仅供输出。与请求的 SemanticRetrieverConfig.source 匹配的来源的名称。示例:corpora/123corpora/123/documents/abc

chunk

string

仅供输出。包含归因文字的 Chunk 的名称。示例:corpora/123/documents/abc/chunks/xyz