Method: answerQuery

グラウンディングされた生成を使用してクエリに回答します。

HTTP リクエスト

POST https://developerknowledge.googleapis.com/v1alpha:answerQuery

この URL は gRPC Transcoding 構文を使用します。

リクエストの本文

リクエストの本文には、次の構造のデータが含まれます。

JSON 表現
{
  "query": string
}
フィールド
query

string

必須。回答するクエリ。

レスポンスの本文

DeveloperKnowledge.AnswerQuery に対するレスポンス メッセージです。

成功した場合、レスポンスの本文には次の構造のデータが含まれます。

JSON 表現
{
  "answer": {
    object (Answer)
  }
}
フィールド
answer

object (Answer)

クエリに対する回答。

認可スコープ

次の OAuth スコープのいずれかが必要です。

  • https://www.googleapis.com/auth/devprofiles.full_control
  • https://www.googleapis.com/auth/cloud-platform

詳細については、OAuth 2.0 Overview をご覧ください。

回答

クエリに対する回答。

JSON 表現
{
  "answerText": string,
  "citations": [
    {
      object (AnswerCitation)
    }
  ],
  "references": [
    {
      object (AnswerReference)
    }
  ]
}
フィールド
answerText

string

回答のテキストが含まれます。

citations[]

object (AnswerCitation)

出力専用。回答の引用が含まれます。

references[]

object (AnswerReference)

出力専用。回答の参照が含まれます。

AnswerCitation

セグメントの引用情報。

JSON 表現
{
  "startIndex": integer,
  "endIndex": integer,
  "sources": [
    {
      object (CitationSource)
    }
  ]
}
フィールド
startIndex

integer

出力専用。セグメントの開始位置をバイト単位(UTF-8 Unicode)で示します(両端を含む)。ASCII 以外の文字などのマルチバイト文字がある場合、インデックスの測定値は文字列の長さよりも長くなります。

endIndex

integer

出力専用。セグメントの終了位置をバイト単位(UTF-8 Unicode)で示します(終点を含まない)。ASCII 以外の文字などのマルチバイト文字がある場合、インデックスの測定値は文字列の長さよりも長くなります。

sources[]

object (CitationSource)

出力専用。アトリビューション セグメントの引用元が含まれます。

CitationSource

引用元。

JSON 表現
{
  "referenceIndex": integer
}
フィールド
referenceIndex

integer

出力専用。references 繰り返しフィールド内の Answer.AnswerReference のインデックスが含まれます。

AnswerReference

ソースへの参照を表します。

JSON 表現
{

  // Union field content can be only one of the following:
  "documentReference": {
    object (DocumentReference)
  }
  // End of list of possible types for union field content.
}
フィールド
共用体フィールド content。参照の内容が含まれます。content は次のいずれかになります。
documentReference

object (DocumentReference)

出力専用。リファレンス ドキュメント。

DocumentReference

ドキュメントへの参照を表します。

JSON 表現
{
  "documentChunk": {
    object (DocumentChunk)
  }
}
フィールド
documentChunk

object (DocumentChunk)

出力専用。ドキュメント チャンクが含まれます。documentChunk.id フィールドは設定されず、空になります。