REST Resource: projects.locations.collections.dataStores.sessions.answers

Resource: Answer

Defines an answer.

JSON representation
{
  "name": string,
  "state": enum (State),
  "answerText": string,
  "citations": [
    {
      object (Citation)
    }
  ],
  "references": [
    {
      object (Reference)
    }
  ],
  "relatedQuestions": [
    string
  ],
  "steps": [
    {
      object (Step)
    }
  ],
  "queryUnderstandingInfo": {
    object (QueryUnderstandingInfo)
  },
  "answerSkippedReasons": [
    enum (AnswerSkippedReason)
  ],
  "createTime": string,
  "completeTime": string
}
Fields
name

string

Immutable. Fully qualified name projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*

state

enum (State)

The state of the answer generation.

answerText

string

The textual answer.

citations[]

object (Citation)

Citations.

references[]

object (Reference)

References.

relatedQuestions[]

string

Suggested related questions.

steps[]

object (Step)

Answer generation steps.

queryUnderstandingInfo

object (QueryUnderstandingInfo)

Query understanding information.

answerSkippedReasons[]

enum (AnswerSkippedReason)

Additional answer-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set.

createTime

string (Timestamp format)

Output only. Answer creation timestamp.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

completeTime

string (Timestamp format)

Output only. Answer completed timestamp.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

State

Enumeration of the state of the answer generation.

Enums
STATE_UNSPECIFIED Unknown.
IN_PROGRESS Answer generation is currently in progress.
FAILED Answer generation currently failed.
SUCCEEDED Answer generation has succeeded.

Citation

Citation info for a segment.

JSON representation
{
  "startIndex": string,
  "endIndex": string,
  "sources": [
    {
      object (CitationSource)
    }
  ]
}
Fields
startIndex

string (int64 format)

Index indicates the start of the segment, measured in bytes (UTF-8 unicode).

endIndex

string (int64 format)

End of the attributed segment, exclusive.

sources[]

object (CitationSource)

Citation sources for the attributed segment.

CitationSource

Citation source.

JSON representation
{
  "referenceId": string
}
Fields
referenceId

string

ID of the citation source.

Reference

Reference.

JSON representation
{

  // Union field content can be only one of the following:
  "unstructuredDocumentInfo": {
    object (UnstructuredDocumentInfo)
  },
  "chunkInfo": {
    object (ChunkInfo)
  }
  // End of list of possible types for union field content.
}
Fields
Union field content. Search result content. content can be only one of the following:
unstructuredDocumentInfo

object (UnstructuredDocumentInfo)

Unstructured document information.

chunkInfo

object (ChunkInfo)

Chunk information.

UnstructuredDocumentInfo

Unstructured document information.

JSON representation
{
  "document": string,
  "uri": string,
  "title": string,
  "chunkContents": [
    {
      object (ChunkContent)
    }
  ],
  "structData": {
    object
  }
}
Fields
document

string

Document resource name.

uri

string

URI for the document.

title

string

Title.

chunkContents[]

object (ChunkContent)

List of cited chunk contents derived from document content.

structData

object (Struct format)

The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result.

ChunkContent

Chunk content.

JSON representation
{
  "content": string,
  "pageIdentifier": string
}
Fields
content

string

Chunk textual content.

pageIdentifier

string

Page identifier.

ChunkInfo

Chunk information.

JSON representation
{
  "chunk": string,
  "content": string,
  "documentMetadata": {
    object (DocumentMetadata)
  },
  "relevanceScore": number
}
Fields
chunk

string

Chunk resource name.

content

string

Chunk textual content.

documentMetadata

object (DocumentMetadata)

Document metadata.

relevanceScore

number

Relevance score.

DocumentMetadata

Document metadata.

JSON representation
{
  "document": string,
  "uri": string,
  "title": string,
  "pageIdentifier": string,
  "structData": {
    object
  }
}
Fields
document

string

Document resource name.

uri

string

URI for the document.

title

string

Title.

pageIdentifier

string

Page identifier.

structData

object (Struct format)

The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result.

Step

Step information.

JSON representation
{
  "state": enum (State),
  "description": string,
  "thought": string,
  "actions": [
    {
      object (Action)
    }
  ]
}
Fields
state

enum (State)

The state of the step.

description

string

The description of the step.

thought

string

The thought of the step.

actions[]

object (Action)

Actions.

State

Enumeration of the state of the step.

Enums
STATE_UNSPECIFIED Unknown.
IN_PROGRESS Step is currently in progress.
FAILED Step currently failed.
SUCCEEDED Step has succeeded.

Action

Action.

JSON representation
{
  "observation": {
    object (Observation)
  },

  // Union field action can be only one of the following:
  "searchAction": {
    object (SearchAction)
  }
  // End of list of possible types for union field action.
}
Fields
observation

object (Observation)

Observation.

Union field action. The action. action can be only one of the following:
searchAction

object (SearchAction)

Search action.

SearchAction

Search action.

JSON representation
{
  "query": string
}
Fields
query

string

The query to search.

Observation

Observation.

JSON representation
{
  "searchResults": [
    {
      object (SearchResult)
    }
  ]
}
Fields
searchResults[]

object (SearchResult)

Search results observed by the search action, it can be snippets info or chunk info, depending on the citation type set by the user.

SearchResult

JSON representation
{
  "document": string,
  "uri": string,
  "title": string,
  "snippetInfo": [
    {
      object (SnippetInfo)
    }
  ],
  "chunkInfo": [
    {
      object (ChunkInfo)
    }
  ]
}
Fields
document

string

Document resource name.

uri

string

URI for the document.

title

string

Title.

snippetInfo[]

object (SnippetInfo)

If citation_type is DOCUMENT_LEVEL_CITATION, populate document level snippets.

chunkInfo[]

object (ChunkInfo)

If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, populate chunk info.

SnippetInfo

Snippet information.

JSON representation
{
  "snippet": string,
  "snippetStatus": string
}
Fields
snippet

string

Snippet content.

snippetStatus

string

Status of the snippet defined by the search team.

ChunkInfo

Chunk information.

JSON representation
{
  "chunk": string,
  "content": string,
  "relevanceScore": number
}
Fields
chunk

string

Chunk resource name.

content

string

Chunk textual content.

relevanceScore

number

Relevance score.

QueryUnderstandingInfo

Query understanding information.

JSON representation
{
  "queryClassificationInfo": [
    {
      object (QueryClassificationInfo)
    }
  ]
}
Fields
queryClassificationInfo[]

object (QueryClassificationInfo)

Query classification information.

QueryClassificationInfo

Query classification information.

JSON representation
{
  "type": enum (Type),
  "positive": boolean
}
Fields
type

enum (Type)

Query classification type.

positive

boolean

Classification output.

Type

Query classification types.

Enums
TYPE_UNSPECIFIED Unspecified query classification type.
ADVERSARIAL_QUERY Adversarial query classification type.
NON_ANSWER_SEEKING_QUERY Non-answer-seeking query classification type.

AnswerSkippedReason

An enum for answer skipped reasons.

Enums
ANSWER_SKIPPED_REASON_UNSPECIFIED Default value. The answer skipped reason is not specified.
ADVERSARIAL_QUERY_IGNORED The adversarial query ignored case.
NON_ANSWER_SEEKING_QUERY_IGNORED The non-answer seeking query ignored case.
OUT_OF_DOMAIN_QUERY_IGNORED

The out-of-domain query ignored case.

Google skips the answer if there are no high-relevance search results.

POTENTIAL_POLICY_VIOLATION

The potential policy violation case.

Google skips the answer if there is a potential policy violation detected. This includes content that may be violent or toxic.

Methods

get

Gets a Answer.