Google Cloud Dialogflow Cx V3 Client - Class QueryResult (0.1.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
NameDescription
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/<Project ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>.

↳ 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 Google\Cloud\Dialogflow\Cx\V3\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<Google\Cloud\Dialogflow\Cx\V3\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_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 Google\Cloud\Dialogflow\Cx\V3\Page

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

↳ intent Google\Cloud\Dialogflow\Cx\V3\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 Google\Cloud\Dialogflow\Cx\V3\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 Google\Cloud\Dialogflow\Cx\V3\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 Google\Cloud\Dialogflow\Cx\V3\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.

getText

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

Returns
TypeDescription
string

hasText

setText

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getTriggerIntent

If an intent was provided as input, this field will contain a copy of the intent identifier. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>.

Returns
TypeDescription
string

hasTriggerIntent

setTriggerIntent

If an intent was provided as input, this field will contain a copy of the intent identifier. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getTranscript

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

Returns
TypeDescription
string

hasTranscript

setTranscript

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getTriggerEvent

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

Returns
TypeDescription
string

hasTriggerEvent

setTriggerEvent

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDtmf

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

Returns
TypeDescription
Google\Cloud\Dialogflow\Cx\V3\DtmfInput|null

hasDtmf

setDtmf

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

Parameter
NameDescription
var Google\Cloud\Dialogflow\Cx\V3\DtmfInput
Returns
TypeDescription
$this

getLanguageCode

The language that was triggered during intent detection.

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

Returns
TypeDescription
string

setLanguageCode

The language that was triggered during intent detection.

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

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var Google\Protobuf\Struct
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var array<Google\Cloud\Dialogflow\Cx\V3\ResponseMessage>
Returns
TypeDescription
$this

getWebhookStatuses

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

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setWebhookStatuses

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

Parameter
NameDescription
var array<Google\Rpc\Status>
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var array<Google\Protobuf\Struct>
Returns
TypeDescription
$this

getCurrentPage

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

Returns
TypeDescription
Google\Cloud\Dialogflow\Cx\V3\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
NameDescription
var Google\Cloud\Dialogflow\Cx\V3\Page
Returns
TypeDescription
$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
TypeDescription
Google\Cloud\Dialogflow\Cx\V3\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
NameDescription
var Google\Cloud\Dialogflow\Cx\V3\Intent
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var float
Returns
TypeDescription
$this

getMatch

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

Returns
TypeDescription
Google\Cloud\Dialogflow\Cx\V3\PBMatch|null

hasMatch

clearMatch

setMatch

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

Parameter
NameDescription
var Google\Cloud\Dialogflow\Cx\V3\PBMatch
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var Google\Protobuf\Struct
Returns
TypeDescription
$this

getSentimentAnalysisResult

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

Returns
TypeDescription
Google\Cloud\Dialogflow\Cx\V3\SentimentAnalysisResult|null

hasSentimentAnalysisResult

clearSentimentAnalysisResult

setSentimentAnalysisResult

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

Parameter
NameDescription
var Google\Cloud\Dialogflow\Cx\V3\SentimentAnalysisResult
Returns
TypeDescription
$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
TypeDescription
Google\Cloud\Dialogflow\Cx\V3\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
NameDescription
var Google\Cloud\Dialogflow\Cx\V3\AdvancedSettings
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var bool
Returns
TypeDescription
$this

getQuery

Returns
TypeDescription
string