REST Resource: projects.answerRecords

Resource: AnswerRecord

Answer records are records to manage answer history and feedbacks for Dialogflow.

Currently, answer record includes:

  • human agent assistant article suggestion
  • human agent assistant faq article

It doesn't include:

  • DetectIntent intent matching
  • DetectIntent knowledge

Answer records are not related to the conversation history in the Dialogflow Console. A Record is generated even when the end-user disables conversation history in the console. Records are created when there's a human agent assistant suggestion generated.

A typical workflow for customers provide feedback to an answer is:

  1. For human agent assistant, customers get suggestion via suggestions.list API. Together with the answers, AnswerRecord.name are returned to the customers.
  2. The customer uses the AnswerRecord.name to call the [answerRecords.patch][] method to send feedback about a specific answer that they believe is wrong.
JSON representation
{
  "name": string,
  "answerFeedback": {
    object (AnswerFeedback)
  },

  // Union field record can be only one of the following:
  "agentAssistantRecord": {
    object (AgentAssistantRecord)
  }
  // End of list of possible types for union field record.
}
Fields
name

string

The unique identifier of this answer record. Required for AnswerRecords.UpdateAnswerRecord method. Format: projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record ID>.

answerFeedback

object (AnswerFeedback)

Optional. The AnswerFeedback for this record. You can set this with AnswerRecords.UpdateAnswerRecord in order to give us feedback about this answer.

Union field record. Output only. The record for this answer. record can be only one of the following:
agentAssistantRecord

object (AgentAssistantRecord)

Output only. The record for human agent assistant.

AnswerFeedback

Represents feedback the customer has about the quality & correctness of a certain answer in a conversation.

JSON representation
{
  "correctnessLevel": enum (CorrectnessLevel),
  "clicked": boolean,
  "clickTime": string,
  "displayed": boolean,
  "displayTime": string,

  // Union field detail_feedback can be only one of the following:
  "agentAssistantDetailFeedback": {
    object (AgentAssistantFeedback)
  }
  // End of list of possible types for union field detail_feedback.
}
Fields
correctnessLevel

enum (CorrectnessLevel)

The correctness level of the specific answer.

clicked

boolean

Indicates whether the answer/item was clicked by the human agent or not. Default to false. For knowledge search, the answer record is considered to be clicked if the answer was copied or any URI was clicked.

clickTime

string (Timestamp format)

Time when the answer/item was clicked.

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".

displayed

boolean

Indicates whether the answer/item was displayed to the human agent in the agent desktop UI. Default to false.

displayTime

string (Timestamp format)

Time when the answer/item was displayed.

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".

Union field detail_feedback. Normally, detail feedback is provided when answer is not fully correct. detail_feedback can be only one of the following:
agentAssistantDetailFeedback

object (AgentAssistantFeedback)

Optional. Detail feedback of agent assistant suggestions.

CorrectnessLevel

The correctness level of an answer.

Enums
CORRECTNESS_LEVEL_UNSPECIFIED Correctness level unspecified.
NOT_CORRECT Answer is totally wrong.
PARTIALLY_CORRECT Answer is partially correct.
FULLY_CORRECT Answer is fully correct.

AgentAssistantFeedback

Detail feedback of Agent Assistant result.

JSON representation
{
  "answerRelevance": enum (AnswerRelevance),
  "documentCorrectness": enum (DocumentCorrectness),
  "documentEfficiency": enum (DocumentEfficiency),
  "summarizationFeedback": {
    object (SummarizationFeedback)
  },
  "knowledgeSearchFeedback": {
    object (KnowledgeSearchFeedback)
  },
  "knowledgeAssistFeedback": {
    object (KnowledgeAssistFeedback)
  }
}
Fields
answerRelevance

enum (AnswerRelevance)

Optional. Whether or not the suggested answer is relevant.

For example:

documentCorrectness

enum (DocumentCorrectness)

Optional. Whether or not the information in the document is correct.

For example:

  • Query: "Can I return the package in 2 days once received?"
  • Suggested document says: "Items must be returned/exchanged within 60 days of the purchase date."
  • Ground truth: "No return or exchange is allowed."
documentEfficiency

enum (DocumentEfficiency)

Optional. Whether or not the suggested document is efficient. For example, if the document is poorly written, hard to understand, hard to use or too long to find useful information, documentEfficiency is DocumentEfficiency.INEFFICIENT.

summarizationFeedback

object (SummarizationFeedback)

Feedback for conversation summarization.

knowledgeSearchFeedback

object (KnowledgeSearchFeedback)

Optional. Feedback for knowledge search.

knowledgeAssistFeedback

object (KnowledgeAssistFeedback)

Optional. Feedback for knowledge assist.

AnswerRelevance

Relevance of an answer.

Enums
ANSWER_RELEVANCE_UNSPECIFIED Answer relevance unspecified.
IRRELEVANT Answer is irrelevant to query.
RELEVANT Answer is relevant to query.

DocumentCorrectness

Correctness of document.

Enums
DOCUMENT_CORRECTNESS_UNSPECIFIED Document correctness unspecified.
INCORRECT Information in document is incorrect.
CORRECT Information in document is correct.

DocumentEfficiency

Efficiency of document.

Enums
DOCUMENT_EFFICIENCY_UNSPECIFIED Document efficiency unspecified.
INEFFICIENT Document is inefficient.
EFFICIENT Document is efficient.

SummarizationFeedback

Feedback for conversation summarization.

JSON representation
{
  "startTimestamp": string,
  "submitTimestamp": string,
  "summaryText": string,
  "textSections": {
    string: string,
    ...
  }
}
Fields
startTimestamp

string (Timestamp format)

Timestamp when composing of the summary starts.

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".

submitTimestamp

string (Timestamp format)

Timestamp when the summary was submitted.

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".

summaryText

string

Text of actual submitted summary.

textSections

map (key: string, value: string)

Optional. Actual text sections of submitted summary.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

KnowledgeSearchFeedback

Feedback for knowledge search.

JSON representation
{
  "answerCopied": boolean,
  "clickedUris": [
    string
  ]
}
Fields
answerCopied

boolean

Whether the answer was copied by the human agent or not. If the value is set to be true, AnswerFeedback.clicked will be updated to be true.

clickedUris[]

string

The URIs clicked by the human agent. The value is appended for each UpdateAnswerRecordRequest. If the value is not empty, AnswerFeedback.clicked will be updated to be true.

KnowledgeAssistFeedback

Feedback for knowledge assist.

JSON representation
{
  "answerCopied": boolean,
  "clickedUris": [
    string
  ]
}
Fields
answerCopied

boolean

Whether the suggested answer was copied by the human agent. If the value is set to be true, AnswerFeedback.clicked will be updated to be true.

clickedUris[]

string

The URIs clicked by the human agent. The value is appended for each UpdateAnswerRecordRequest. If the value is not empty, AnswerFeedback.clicked will be updated to be true.

AgentAssistantRecord

Represents a record of a human agent assistant answer.

JSON representation
{

  // Union field answer can be only one of the following:
  "articleSuggestionAnswer": {
    object (ArticleAnswer)
  },
  "faqAnswer": {
    object (FaqAnswer)
  },
  "dialogflowAssistAnswer": {
    object (DialogflowAssistAnswer)
  }
  // End of list of possible types for union field answer.
}
Fields
Union field answer. Output only. The agent assistant answer. answer can be only one of the following:
articleSuggestionAnswer

object (ArticleAnswer)

Output only. The article suggestion answer.

faqAnswer

object (FaqAnswer)

Output only. The FAQ answer.

dialogflowAssistAnswer

object (DialogflowAssistAnswer)

Output only. The Dialogflow assist answer.

ArticleAnswer

Represents article answer.

JSON representation
{
  "title": string,
  "uri": string,
  "snippets": [
    string
  ],
  "metadata": {
    string: string,
    ...
  },
  "answerRecord": string
}
Fields
title

string

The article title.

uri

string

The article URI.

snippets[]

string

Output only. Article snippets.

metadata

map (key: string, value: string)

A map that contains metadata about the answer and the document from which it originates.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

answerRecord

string

The name of answer record, in the format of "projects//locations//answerRecords/"

FaqAnswer

Represents answer from "frequently asked questions".

JSON representation
{
  "answer": string,
  "confidence": number,
  "question": string,
  "source": string,
  "metadata": {
    string: string,
    ...
  },
  "answerRecord": string
}
Fields
answer

string

The piece of text from the source knowledge base document.

confidence

number

The system's confidence score that this Knowledge answer is a good match for this conversational query, range from 0.0 (completely uncertain) to 1.0 (completely certain).

question

string

The corresponding FAQ question.

source

string

Indicates which Knowledge Document this answer was extracted from. Format: projects/<Project ID>/locations/<Location ID>/agent/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>.

metadata

map (key: string, value: string)

A map that contains metadata about the answer and the document from which it originates.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

answerRecord

string

The name of answer record, in the format of "projects//locations//answerRecords/"

DialogflowAssistAnswer

Represents a Dialogflow assist answer.

JSON representation
{
  "answerRecord": string,

  // Union field result can be only one of the following:
  "queryResult": {
    object (QueryResult)
  },
  "intentSuggestion": {
    object (IntentSuggestion)
  }
  // End of list of possible types for union field result.
}
Fields
answerRecord

string

The name of answer record, in the format of "projects//locations//answerRecords/"

Union field result. Result from DetectIntent for one matched intent. result can be only one of the following:
queryResult

object (QueryResult)

Result from v2 agent.

intentSuggestion

object (IntentSuggestion)

An intent suggestion generated from conversation.

QueryResult

Represents the result of conversational query or event processing.

JSON representation
{
  "queryText": string,
  "languageCode": string,
  "speechRecognitionConfidence": number,
  "action": string,
  "parameters": {
    object
  },
  "allRequiredParamsPresent": boolean,
  "cancelsSlotFilling": boolean,
  "fulfillmentText": string,
  "fulfillmentMessages": [
    {
      object (Message)
    }
  ],
  "webhookSource": string,
  "webhookPayload": {
    object
  },
  "outputContexts": [
    {
      object (Context)
    }
  ],
  "intent": {
    object (Intent)
  },
  "intentDetectionConfidence": number,
  "diagnosticInfo": {
    object
  },
  "sentimentAnalysisResult": {
    object (SentimentAnalysisResult)
  },
  "knowledgeAnswers": {
    object (KnowledgeAnswers)
  }
}
Fields
queryText

string

The original conversational query text:

  • If natural language text was provided as input, queryText contains a copy of the input.
  • If natural language speech audio was provided as input, queryText contains the speech recognition result. If speech recognizer produced multiple alternatives, a particular one is picked.
  • If automatic spell correction is enabled, queryText will contain the corrected user input.
languageCode

string

The language that was triggered during intent detection. See Language Support for a list of the currently supported language codes.

speechRecognitionConfidence

number

The Speech recognition confidence between 0.0 and 1.0. A higher number indicates an estimated greater likelihood that the recognized words are correct. The default of 0.0 is a sentinel value indicating that confidence was not set.

This field is not guaranteed to be accurate or set. In particular this field isn't set for StreamingDetectIntent since the streaming endpoint has separate confidence estimates per portion of the audio in StreamingRecognitionResult.

action

string

The action name from the matched intent.

parameters

object (Struct format)

The collection of extracted parameters.

Depending on your protocol or client library language, this is a map, associative array, symbol table, dictionary, or JSON object composed of a collection of (MapKey, MapValue) pairs:

  • MapKey type: string
  • MapKey value: parameter name
  • MapValue type: If parameter's entity type is a composite entity then use map, otherwise, depending on the parameter value type, it could be one of string, number, boolean, null, list or map.
  • MapValue value: If parameter's entity type is a composite entity then use map from composite entity property names to property values, otherwise, use parameter value.
allRequiredParamsPresent

boolean

This field is set to:

  • false if the matched intent has required parameters and not all of the required parameter values have been collected.
  • true if all required parameter values have been collected, or if the matched intent doesn't contain any required parameters.
cancelsSlotFilling

boolean

Indicates whether the conversational query triggers a cancellation for slot filling. For more information, see the cancel slot filling documentation.

fulfillmentText

string

The text to be pronounced to the user or shown on the screen. Note: This is a legacy field, fulfillmentMessages should be preferred.

fulfillmentMessages[]

object (Message)

The collection of rich messages to present to the user.

webhookSource

string

If the query was fulfilled by a webhook call, this field is set to the value of the source field returned in the webhook response.

webhookPayload

object (Struct format)

If the query was fulfilled by a webhook call, this field is set to the value of the payload field returned in the webhook response.

outputContexts[]

object (Context)

The collection of output contexts. If applicable, outputContexts.parameters contains entries with name <parameter name>.original containing the original parameter values before the query.

intent

object (Intent)

The intent that matched the conversational query. Some, not all fields are filled in this message, including but not limited to: name, displayName, endInteraction and isFallback.

intentDetectionConfidence

number

The intent detection confidence. Values range from 0.0 (completely uncertain) to 1.0 (completely certain). This value is for informational purpose only and is only used to help match the best intent within the classification threshold. This value may change for the same end-user expression at any time due to a model retraining or change in implementation. If there are multiple knowledgeAnswers messages, this value is set to the greatest knowledgeAnswers.match_confidence value in the list.

diagnosticInfo

object (Struct format)

Free-form diagnostic information for the associated detect intent request. The fields of this data can change without notice, so you should not write code that depends on its structure. The data may contain:

  • webhook call latency
  • webhook errors
sentimentAnalysisResult

object (SentimentAnalysisResult)

The sentiment analysis result, which depends on the sentimentAnalysisRequestConfig specified in the request.

knowledgeAnswers

object (KnowledgeAnswers)

The result from Knowledge Connector (if any), ordered by decreasing KnowledgeAnswers.match_confidence.

SentimentAnalysisResult

The result of sentiment analysis. Sentiment analysis inspects user input and identifies the prevailing subjective opinion, especially to determine a user's attitude as positive, negative, or neutral. For [Participants.DetectIntent][], it needs to be configured in DetectIntentRequest.query_params. For [Participants.StreamingDetectIntent][], it needs to be configured in StreamingDetectIntentRequest.query_params. And for Participants.AnalyzeContent and Participants.StreamingAnalyzeContent, it needs to be configured in ConversationProfile.human_agent_assistant_config

JSON representation
{
  "queryTextSentiment": {
    object (Sentiment)
  }
}
Fields
queryTextSentiment

object (Sentiment)

The sentiment analysis result for queryText.

Sentiment

The sentiment, such as positive/negative feeling or association, for a unit of analysis, such as the query text. See: https://cloud.google.com/natural-language/docs/basics#interpreting_sentiment_analysis_values for how to interpret the result.

JSON representation
{
  "score": number,
  "magnitude": number
}
Fields
score

number

Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).

magnitude

number

A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment, regardless of score (positive or negative).

KnowledgeAnswers

Represents the result of querying a Knowledge base.

JSON representation
{
  "answers": [
    {
      object (Answer)
    }
  ]
}
Fields
answers[]

object (Answer)

A list of answers from Knowledge Connector.

Answer

An answer from Knowledge Connector.

JSON representation
{
  "source": string,
  "faqQuestion": string,
  "answer": string,
  "matchConfidenceLevel": enum (MatchConfidenceLevel),
  "matchConfidence": number
}
Fields
source

string

Indicates which Knowledge Document this answer was extracted from. Format: projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>.

faqQuestion

string

The corresponding FAQ question if the answer was extracted from a FAQ Document, empty otherwise.

answer

string

The piece of text from the source knowledge base document that answers this conversational query.

matchConfidenceLevel

enum (MatchConfidenceLevel)

The system's confidence level that this knowledge answer is a good match for this conversational query. NOTE: The confidence level for a given <query, answer> pair may change without notice, as it depends on models that are constantly being improved. However, it will change less frequently than the confidence score below, and should be preferred for referencing the quality of an answer.

matchConfidence

number

The system's confidence score that this Knowledge answer is a good match for this conversational query. The range is from 0.0 (completely uncertain) to 1.0 (completely certain). Note: The confidence score is likely to vary somewhat (possibly even for identical requests), as the underlying model is under constant improvement. It may be deprecated in the future. We recommend using matchConfidenceLevel which should be generally more stable.

MatchConfidenceLevel

Represents the system's confidence that this knowledge answer is a good match for this conversational query.

Enums
MATCH_CONFIDENCE_LEVEL_UNSPECIFIED Not specified.
LOW Indicates that the confidence is low.
MEDIUM Indicates our confidence is medium.
HIGH Indicates our confidence is high.

IntentSuggestion

Represents an intent suggestion.

JSON representation
{
  "displayName": string,
  "description": string,

  // Union field intent can be only one of the following:
  "intentV2": string
  // End of list of possible types for union field intent.
}
Fields
displayName

string

The display name of the intent.

description

string

Human readable description for better understanding an intent like its scope, content, result etc. Maximum character limit: 140 characters.

Union field intent. The name of the intent. intent can be only one of the following:
intentV2

string

The unique identifier of this intent. Format: projects/<Project ID>/locations/<Location ID>/agent/intents/<Intent ID>.

Methods

get
(deprecated)

Deprecated.

list

Returns the list of all answer records in the specified project in reverse chronological order.

patch

Updates the specified answer record.