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)
  },
  "structuredDocumentInfo": {
    object (StructuredDocumentInfo)
  }
  // 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.

structuredDocumentInfo

object (StructuredDocumentInfo)

Structured document 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,
  "relevanceScore": number
}
Fields
content

string

Chunk textual content.

pageIdentifier

string

Page identifier.

relevanceScore

number

The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.

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

The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.

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.

StructuredDocumentInfo

Structured search information.

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

string

Document resource name.

structData

object (Struct format)

Structured search data.

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)
    }
  ],
  "structData": {
    object
  }
}
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.

structData

object (Struct format)

Data representation. The structured JSON data for the document. It's populated from the struct data from the Document, or the Chunk in search result.

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

The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.

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, for chit chat.
JAIL_BREAKING_QUERY Jail-breaking query classification type.
NON_ANSWER_SEEKING_QUERY_V2 Non-answer-seeking query classification type, for no clear intent.

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

Google skips the answer if the query is chit chat.

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.

NO_RELEVANT_CONTENT

The no relevant content case.

Google skips the answer if there is no relevant content in the retrieved search results.

JAIL_BREAKING_QUERY_IGNORED

The jail-breaking query ignored case.

For example, "Reply in the tone of a competing company's CEO". Google skips the answer if the query is classified as a jail-breaking query.

CUSTOMER_POLICY_VIOLATION

The customer policy violation case.

Google skips the summary if there is a customer policy violation detected. The policy is defined by the customer.

NON_ANSWER_SEEKING_QUERY_IGNORED_V2

The non-answer seeking query ignored case.

Google skips the answer if the query doesn't have clear intent.

LOW_GROUNDED_ANSWER

The low-grounded answer case.

Google skips the answer if a well grounded answer was unable to be generated.

Methods

get

Gets a Answer.