Google Cloud Dialogflow Cx V3 Client - Class QueryResult (0.5.1)

Reference documentation and code samples for the Google Cloud Dialogflow Cx V3 Client class QueryResult.

Represents the result of a conversational query.

Generated from protobuf message google.cloud.dialogflow.cx.v3.QueryResult

Namespace

Google \ Cloud \ Dialogflow \ Cx \ V3

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ text string

If natural language text was provided as input, this field will contain a copy of the text.

↳ trigger_intent string

If an intent was provided as input, this field will contain a copy of the intent identifier. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>.

↳ transcript string

If natural language speech audio was provided as input, this field will contain the transcript for the audio.

↳ trigger_event string

If an event was provided as input, this field will contain the name of the event.

↳ dtmf DtmfInput

If a DTMF was provided as input, this field will contain a copy of the DtmfInput.

↳ language_code string

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

↳ parameters Google\Protobuf\Struct

The collected session 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.

↳ response_messages array<ResponseMessage>

The list of rich messages returned to the client. Responses vary from simple text messages to more sophisticated, structured payloads used to drive complex logic.

↳ webhook_ids array

The list of webhook ids in the order of call sequence.

↳ webhook_display_names array

The list of webhook display names in the order of call sequence.

↳ webhook_latencies array<Google\Protobuf\Duration>

The list of webhook latencies in the order of call sequence.

↳ webhook_tags array

The list of webhook tags in the order of call sequence.

↳ webhook_statuses array<Google\Rpc\Status>

The list of webhook call status in the order of call sequence.

↳ webhook_payloads array<Google\Protobuf\Struct>

The list of webhook payload in WebhookResponse.payload, in the order of call sequence. If some webhook call fails or doesn't return any payload, an empty Struct would be used instead.

↳ current_page Page

The current Page. Some, not all fields are filled in this message, including but not limited to name and display_name.

↳ current_flow Flow

The current Flow. Some, not all fields are filled in this message, including but not limited to name and display_name.

↳ intent Intent

The Intent that matched the conversational query. Some, not all fields are filled in this message, including but not limited to: name and display_name. This field is deprecated, please use QueryResult.match instead.

↳ intent_detection_confidence float

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. This field is deprecated, please use QueryResult.match instead.

↳ match PBMatch

Intent match result, could be an intent or an event.

↳ diagnostic_info Google\Protobuf\Struct

The free-form diagnostic info. For example, this field could contain webhook call latency. The fields of this data can change without notice, so you should not write code that depends on its structure. One of the fields is called "Alternative Matched Intents", which may aid with debugging. The following describes these intent results: - The list is empty if no intent was matched to end-user input. - Only intents that are referenced in the currently active flow are included. - The matched intent is included. - Other intents that could have matched end-user input, but did not match because they are referenced by intent routes that are out of scope, are included. - Other intents referenced by intent routes in scope that matched end-user input, but had a lower confidence score.

↳ sentiment_analysis_result SentimentAnalysisResult

The sentiment analyss result, which depends on [analyze_query_text_sentiment] [google.cloud.dialogflow.cx.v3.QueryParameters.analyze_query_text_sentiment], specified in the request.

↳ advanced_settings AdvancedSettings

Returns the current advanced settings including IVR settings. Even though the operations configured by these settings are performed by Dialogflow, the client may need to perform special logic at the moment. For example, if Dialogflow exports audio to Google Cloud Storage, then the client may need to wait for the resulting object to appear in the bucket before proceeding.

↳ allow_answer_feedback bool

Indicates whether the Thumbs up/Thumbs down rating controls are need to be shown for the response in the Dialogflow Messenger widget.

↳ data_store_connection_signals DataStoreConnectionSignals

Optional. Data store connection feature output signals. Filled only when data stores are involved in serving the query and DetectIntentRequest.populate_data_store_connection_signals is set to true in the request.

getText

If natural language text was provided as input, this field will contain a copy of the text.

Returns
Type Description
string

hasText

setText

If natural language text was provided as input, this field will contain a copy of the text.

Parameter
Name Description
var string
Returns
Type Description
$this

getTriggerIntent

If an intent was provided as input, this field will contain a copy of the intent identifier. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>.

Returns
Type Description
string

hasTriggerIntent

setTriggerIntent

If an intent was provided as input, this field will contain a copy of the intent identifier. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>.

Parameter
Name Description
var string
Returns
Type Description
$this

getTranscript

If natural language speech audio was provided as input, this field will contain the transcript for the audio.

Returns
Type Description
string

hasTranscript

setTranscript

If natural language speech audio was provided as input, this field will contain the transcript for the audio.

Parameter
Name Description
var string
Returns
Type Description
$this

getTriggerEvent

If an event was provided as input, this field will contain the name of the event.

Returns
Type Description
string

hasTriggerEvent

setTriggerEvent

If an event was provided as input, this field will contain the name of the event.

Parameter
Name Description
var string
Returns
Type Description
$this

getDtmf

If a DTMF was provided as input, this field will contain a copy of the DtmfInput.

Returns
Type Description
DtmfInput|null

hasDtmf

setDtmf

If a DTMF was provided as input, this field will contain a copy of the DtmfInput.

Parameter
Name Description
var DtmfInput
Returns
Type Description
$this

getLanguageCode

The language that was triggered during intent detection.

See Language Support for a list of the currently supported language codes.

Returns
Type Description
string

setLanguageCode

The language that was triggered during intent detection.

See Language Support for a list of the currently supported language codes.

Parameter
Name Description
var string
Returns
Type Description
$this

getParameters

The collected session 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.
Returns
Type Description
Google\Protobuf\Struct|null

hasParameters

clearParameters

setParameters

The collected session 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.
Parameter
Name Description
var Google\Protobuf\Struct
Returns
Type Description
$this

getResponseMessages

The list of rich messages returned to the client. Responses vary from simple text messages to more sophisticated, structured payloads used to drive complex logic.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setResponseMessages

The list of rich messages returned to the client. Responses vary from simple text messages to more sophisticated, structured payloads used to drive complex logic.

Parameter
Name Description
var array<ResponseMessage>
Returns
Type Description
$this

getWebhookIds

The list of webhook ids in the order of call sequence.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setWebhookIds

The list of webhook ids in the order of call sequence.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getWebhookDisplayNames

The list of webhook display names in the order of call sequence.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setWebhookDisplayNames

The list of webhook display names in the order of call sequence.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getWebhookLatencies

The list of webhook latencies in the order of call sequence.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setWebhookLatencies

The list of webhook latencies in the order of call sequence.

Parameter
Name Description
var array<Google\Protobuf\Duration>
Returns
Type Description
$this

getWebhookTags

The list of webhook tags in the order of call sequence.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setWebhookTags

The list of webhook tags in the order of call sequence.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getWebhookStatuses

The list of webhook call status in the order of call sequence.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setWebhookStatuses

The list of webhook call status in the order of call sequence.

Parameter
Name Description
var array<Google\Rpc\Status>
Returns
Type Description
$this

getWebhookPayloads

The list of webhook payload in WebhookResponse.payload, in the order of call sequence. If some webhook call fails or doesn't return any payload, an empty Struct would be used instead.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setWebhookPayloads

The list of webhook payload in WebhookResponse.payload, in the order of call sequence. If some webhook call fails or doesn't return any payload, an empty Struct would be used instead.

Parameter
Name Description
var array<Google\Protobuf\Struct>
Returns
Type Description
$this

getCurrentPage

The current Page. Some, not all fields are filled in this message, including but not limited to name and display_name.

Returns
Type Description
Page|null

hasCurrentPage

clearCurrentPage

setCurrentPage

The current Page. Some, not all fields are filled in this message, including but not limited to name and display_name.

Parameter
Name Description
var Page
Returns
Type Description
$this

getCurrentFlow

The current Flow. Some, not all fields are filled in this message, including but not limited to name and display_name.

Returns
Type Description
Flow|null

hasCurrentFlow

clearCurrentFlow

setCurrentFlow

The current Flow. Some, not all fields are filled in this message, including but not limited to name and display_name.

Parameter
Name Description
var Flow
Returns
Type Description
$this

getIntent

The Intent that matched the conversational query. Some, not all fields are filled in this message, including but not limited to: name and display_name. This field is deprecated, please use QueryResult.match instead.

Returns
Type Description
Intent|null

hasIntent

clearIntent

setIntent

The Intent that matched the conversational query. Some, not all fields are filled in this message, including but not limited to: name and display_name. This field is deprecated, please use QueryResult.match instead.

Parameter
Name Description
var Intent
Returns
Type Description
$this

getIntentDetectionConfidence

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. This field is deprecated, please use QueryResult.match instead.

Returns
Type Description
float

setIntentDetectionConfidence

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. This field is deprecated, please use QueryResult.match instead.

Parameter
Name Description
var float
Returns
Type Description
$this

getMatch

Intent match result, could be an intent or an event.

Returns
Type Description
PBMatch|null

hasMatch

clearMatch

setMatch

Intent match result, could be an intent or an event.

Parameter
Name Description
var PBMatch
Returns
Type Description
$this

getDiagnosticInfo

The free-form diagnostic info. For example, this field could contain webhook call latency. The fields of this data can change without notice, so you should not write code that depends on its structure.

One of the fields is called "Alternative Matched Intents", which may aid with debugging. The following describes these intent results:

  • The list is empty if no intent was matched to end-user input.
  • Only intents that are referenced in the currently active flow are included.
  • The matched intent is included.
  • Other intents that could have matched end-user input, but did not match because they are referenced by intent routes that are out of scope, are included.
  • Other intents referenced by intent routes in scope that matched end-user input, but had a lower confidence score.
Returns
Type Description
Google\Protobuf\Struct|null

hasDiagnosticInfo

clearDiagnosticInfo

setDiagnosticInfo

The free-form diagnostic info. For example, this field could contain webhook call latency. The fields of this data can change without notice, so you should not write code that depends on its structure.

One of the fields is called "Alternative Matched Intents", which may aid with debugging. The following describes these intent results:

  • The list is empty if no intent was matched to end-user input.
  • Only intents that are referenced in the currently active flow are included.
  • The matched intent is included.
  • Other intents that could have matched end-user input, but did not match because they are referenced by intent routes that are out of scope, are included.
  • Other intents referenced by intent routes in scope that matched end-user input, but had a lower confidence score.
Parameter
Name Description
var Google\Protobuf\Struct
Returns
Type Description
$this

getSentimentAnalysisResult

The sentiment analyss result, which depends on analyze_query_text_sentiment, specified in the request.

Returns
Type Description
SentimentAnalysisResult|null

hasSentimentAnalysisResult

clearSentimentAnalysisResult

setSentimentAnalysisResult

The sentiment analyss result, which depends on analyze_query_text_sentiment, specified in the request.

Parameter
Name Description
var SentimentAnalysisResult
Returns
Type Description
$this

getAdvancedSettings

Returns the current advanced settings including IVR settings. Even though the operations configured by these settings are performed by Dialogflow, the client may need to perform special logic at the moment. For example, if Dialogflow exports audio to Google Cloud Storage, then the client may need to wait for the resulting object to appear in the bucket before proceeding.

Returns
Type Description
AdvancedSettings|null

hasAdvancedSettings

clearAdvancedSettings

setAdvancedSettings

Returns the current advanced settings including IVR settings. Even though the operations configured by these settings are performed by Dialogflow, the client may need to perform special logic at the moment. For example, if Dialogflow exports audio to Google Cloud Storage, then the client may need to wait for the resulting object to appear in the bucket before proceeding.

Parameter
Name Description
var AdvancedSettings
Returns
Type Description
$this

getAllowAnswerFeedback

Indicates whether the Thumbs up/Thumbs down rating controls are need to be shown for the response in the Dialogflow Messenger widget.

Returns
Type Description
bool

setAllowAnswerFeedback

Indicates whether the Thumbs up/Thumbs down rating controls are need to be shown for the response in the Dialogflow Messenger widget.

Parameter
Name Description
var bool
Returns
Type Description
$this

getDataStoreConnectionSignals

Optional. Data store connection feature output signals.

Filled only when data stores are involved in serving the query and DetectIntentRequest.populate_data_store_connection_signals is set to true in the request.

Returns
Type Description
DataStoreConnectionSignals|null

hasDataStoreConnectionSignals

clearDataStoreConnectionSignals

setDataStoreConnectionSignals

Optional. Data store connection feature output signals.

Filled only when data stores are involved in serving the query and DetectIntentRequest.populate_data_store_connection_signals is set to true in the request.

Parameter
Name Description
var DataStoreConnectionSignals
Returns
Type Description
$this

getQuery

Returns
Type Description
string