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)

僅供輸出。促成這項歸因的來源 ID。

content

object (Content)

用來組成這項歸因的來源內容。

AttributionSourceId

促成這項歸因的來源 ID。

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)

內嵌段落的 ID。

semanticRetrieverChunk

object (SemanticRetrieverChunk)

透過 Semantic Retriever 擷取的 Chunk ID。

GroundingPassageId

GroundingPassage 中的部分 ID。

JSON 表示法
{
  "passageId": string,
  "partIndex": integer
}
欄位
passageId

string

僅供輸出。符合 GenerateAnswerRequestGroundingPassage.id 的段落 ID。

partIndex

integer

僅供輸出。GenerateAnswerRequestGroundingPassage.content 中部分的索引。

SemanticRetrieverChunk

透過 SemanticRetrieverConfigGenerateAnswerRequest 中指定的語意擷取器所擷取的 Chunk ID。

JSON 表示法
{
  "source": string,
  "chunk": string
}
欄位
source

string

僅供輸出。與要求 SemanticRetrieverConfig.source 相符的來源名稱。範例:corpora/123corpora/123/documents/abc

chunk

string

僅供輸出。包含歸因文字的 Chunk 名稱。範例:corpora/123/documents/abc/chunks/xyz