DetectIntentResponse

The message returned from the sessions.detectIntent method.

JSON representation
{
  "responseId": string,
  "queryResult": {
    object (QueryResult)
  },
  "alternativeQueryResults": [
    {
      object (QueryResult)
    }
  ],
  "webhookStatus": {
    object (Status)
  },
  "outputAudio": string,
  "outputAudioConfig": {
    object (OutputAudioConfig)
  }
}
Fields
responseId

string

The unique identifier of the response. It can be used to locate a response in the training example set or for reporting issues.

queryResult

object (QueryResult)

The selected results of the conversational query or event processing. See alternativeQueryResults for additional potential results.

alternativeQueryResults[]

object (QueryResult)

If Knowledge Connectors are enabled, there could be more than one result returned for a given query or event, and this field will contain all results except for the top one, which is captured in queryResult. The alternative results are ordered by decreasing QueryResult.intent_detection_confidence. If Knowledge Connectors are disabled, this field will be empty until multiple responses for regular intents are supported, at which point those additional results will be surfaced here.

webhookStatus

object (Status)

Specifies the status of the webhook request.

outputAudio

string (bytes format)

The audio data bytes encoded as specified in the request. Note: The output audio is generated based on the values of default platform text responses found in the queryResult.fulfillment_messages field. If multiple default text responses exist, they will be concatenated when generating audio. If no default platform text responses exist, the generated audio content will be empty.

A base64-encoded string.

outputAudioConfig

object (OutputAudioConfig)

The config used by the speech synthesizer to generate the output audio.

QueryResult

Represents the result of conversational query or event processing.

JSON representation
{
  "queryText": string,
  "languageCode": string,
  "speechRecognitionConfidence": number,
  "action": string,
  "parameters": {
    object
  },
  "allRequiredParamsPresent": 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.

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.

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)

The free-form diagnostic info. For example, this field could contain webhook call latency. The string keys of the Struct's fields map can change without notice.

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 as configured by sentimentAnalysisRequestConfig.

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.

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.
Was this page helpful? Let us know how we did:

Send feedback about...

Need help? Visit our support page.