Package google.cloud.dialogflow.cx.v3

Index

PageInfo

Represents page information communicated to and from the webhook.

Fields
current_page

string

Always present for WebhookRequest. Ignored for WebhookResponse. The unique identifier of the current page. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>.

form_info

FormInfo

Optional for both WebhookRequest and WebhookResponse. Information about the form.

FormInfo

Represents form information.

Fields
parameter_info[]

ParameterInfo

Optional for both WebhookRequest and WebhookResponse. The parameters contained in the form. Note that the webhook cannot add or remove any form parameter.

ParameterInfo

Represents parameter information.

Fields
display_name

string

Always present for WebhookRequest. Required for WebhookResponse. The human-readable name of the parameter, unique within the form. This field cannot be modified by the webhook.

required

bool

Optional for both WebhookRequest and WebhookResponse. Indicates whether the parameter is required. Optional parameters will not trigger prompts; however, they are filled if the user specifies them. Required parameters must be filled before form filling concludes.

state

ParameterState

Always present for WebhookRequest. Required for WebhookResponse. The state of the parameter. This field can be set to INVALID by the webhook to invalidate the parameter; other values set by the webhook will be ignored.

value

Value

Optional for both WebhookRequest and WebhookResponse. The value of the parameter. This field can be set by the webhook to change the parameter value.

just_collected

bool

Optional for WebhookRequest. Ignored for WebhookResponse. Indicates if the parameter value was just collected on the last conversation turn.

ParameterState

Represents the state of a parameter.

Enums
PARAMETER_STATE_UNSPECIFIED Not specified. This value should be never used.
EMPTY Indicates that the parameter does not have a value.
INVALID Indicates that the parameter value is invalid. This field can be used by the webhook to invalidate the parameter and ask the server to collect it from the user again.
FILLED Indicates that the parameter has a value.

ResponseMessage

Represents a response message that can be returned by a conversational agent.

Response messages are also used for output audio synthesis. The approach is as follows:

  • If at least one OutputAudioText response is present, then all OutputAudioText responses are linearly concatenated, and the result is used for output audio synthesis.
  • If the OutputAudioText responses are a mixture of text and SSML, then the concatenated result is treated as SSML; otherwise, the result is treated as either text or SSML as appropriate. The agent designer should ideally use either text or SSML consistently throughout the bot design.
  • Otherwise, all Text responses are linearly concatenated, and the result is used for output audio synthesis.

This approach allows for more sophisticated user experience scenarios, where the text displayed to the user may differ from what is heard.

Fields
Union field message. Required. The rich response message. message can be only one of the following:
text

Text

Returns a text response.

payload

Struct

Returns a response containing a custom, platform-specific payload.

conversation_success

ConversationSuccess

Indicates that the conversation succeeded.

output_audio_text

OutputAudioText

A text or ssml response that is preferentially used for TTS output audio synthesis, as described in the comment on the ResponseMessage message.

live_agent_handoff

LiveAgentHandoff

Hands off conversation to a human agent.

end_interaction

EndInteraction

Output only. A signal that indicates the interaction with the Dialogflow agent has ended. This message is generated by Dialogflow only when the conversation reaches END_SESSION or END_PAGE page. It is not supposed to be defined by the user. It's guaranteed that there is at most one such message in each response.

play_audio

PlayAudio

Signal that the client should play an audio clip hosted at a client-specific URI. Dialogflow uses this to construct mixed_audio. However, Dialogflow itself does not try to read or process the URI in any way.

mixed_audio

MixedAudio

Output only. An audio response message composed of both the synthesized Dialogflow agent responses and responses defined via play_audio. This message is generated by Dialogflow only and not supposed to be defined by the user.

ConversationSuccess

Indicates that the conversation succeeded, i.e., the bot handled the issue that the customer talked to it about.

Dialogflow only uses this to determine which conversations should be counted as successful and doesn't process the metadata in this message in any way. Note that Dialogflow also considers conversations that get to the conversation end page as successful even if they don't return ConversationSuccess.

You may set this, for example: * In the entry_fulfillment of a Page if entering the page indicates that the conversation succeeded. * In a webhook response when you determine that you handled the customer issue.

Fields
metadata

Struct

Custom metadata. Dialogflow doesn't impose any structure on this.

EndInteraction

Indicates that interaction with the Dialogflow agent has ended. This message is generated by Dialogflow only and not supposed to be defined by the user.

LiveAgentHandoff

Indicates that the conversation should be handed off to a live agent.

Dialogflow only uses this to determine which conversations were handed off to a human agent for measurement purposes. What else to do with this signal is up to you and your handoff procedures.

You may set this, for example: * In the entry_fulfillment of a Page if entering the page indicates something went extremely wrong in the conversation. * In a webhook response when you determine that the customer issue can only be handled by a human.

Fields
metadata

Struct

Custom metadata for your handoff procedure. Dialogflow doesn't impose any structure on this.

MixedAudio

Represents an audio message that is composed of both segments synthesized from the Dialogflow agent prompts and ones hosted externally at the specified URIs. The external URIs are specified via play_audio. This message is generated by Dialogflow only and not supposed to be defined by the user.

Fields
segments[]

Segment

Segments this audio response is composed of.

Segment

Represents one segment of audio.

Fields
allow_playback_interruption

bool

Output only. Whether the playback of this segment can be interrupted by the end user's speech and the client should then start the next Dialogflow request.

Union field content. Content of the segment. content can be only one of the following:
audio

bytes

Raw audio synthesized from the Dialogflow agent's response using the output config specified in the request.

uri

string

Client-specific URI that points to an audio clip accessible to the client. Dialogflow does not impose any validation on it.

OutputAudioText

A text or ssml response that is preferentially used for TTS output audio synthesis, as described in the comment on the ResponseMessage message.

Fields
allow_playback_interruption

bool

Output only. Whether the playback of this message can be interrupted by the end user's speech and the client can then starts the next Dialogflow request.

Union field source. The source, which is either plain text or SSML. source can be only one of the following:
text

string

The raw text to be synthesized.

ssml

string

The SSML text to be synthesized. For more information, see SSML.

PlayAudio

Specifies an audio clip to be played by the client as part of the response.

Fields
audio_uri

string

Required. URI of the audio clip. Dialogflow does not impose any validation on this value. It is specific to the client that reads it.

allow_playback_interruption

bool

Output only. Whether the playback of this message can be interrupted by the end user's speech and the client can then starts the next Dialogflow request.

Text

The text response message.

Fields
text[]

string

Required. A collection of text responses.

allow_playback_interruption

bool

Output only. Whether the playback of this message can be interrupted by the end user's speech and the client can then starts the next Dialogflow request.

SessionInfo

Represents session information communicated to and from the webhook.

Fields
session

string

Always present for WebhookRequest. Ignored for WebhookResponse. The unique identifier of the session. This field can be used by the webhook to identify a user. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/sessions/<Session ID>.

parameters

map<string, Value>

Optional for WebhookRequest. Optional for WebhookResponse. All parameters collected from forms and intents during the session. Parameters can be created, updated, or removed by the webhook. To remove a parameter from the session, the webhook should explicitly set the parameter value to null in WebhookResponse. The map is keyed by parameters' display names.

WebhookRequest

The request message for a webhook call.

Fields
detect_intent_response_id

string

Always present. The unique identifier of the DetectIntentResponse that will be returned to the API caller.

fulfillment_info

FulfillmentInfo

Always present. Information about the fulfillment that triggered this webhook call.

intent_info

IntentInfo

Information about the last matched intent.

page_info

PageInfo

Information about page status.

session_info

SessionInfo

Information about session status.

messages[]

ResponseMessage

The list of rich message responses to present to the user. Webhook can choose to append or replace this list in WebhookResponse.fulfillment_response;

payload

Struct

Custom data set in QueryParameters.payload.

FulfillmentInfo

Represents fulfillment information communicated to the webhook.

Fields
tag

string

Always present. The tag used to identify which fulfillment is being called.

IntentInfo

Represents intent information communicated to the webhook.

Fields
last_matched_intent

string

Always present. The unique identifier of the last matched intent. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>.

parameters

map<string, IntentParameterValue>

Parameters identified as a result of intent matching. This is a map of the name of the identified parameter to the value of the parameter identified from the user's utterance. All parameters defined in the matched intent that are identified will be surfaced here.

IntentParameterValue

Represents a value for an intent parameter.

Fields
original_value

string

Always present. Original text value extracted from user utterance.

resolved_value

Value

Always present. Structured value for the parameter extracted from user utterance.

WebhookResponse

The response message for a webhook call.

Fields
fulfillment_response

FulfillmentResponse

The fulfillment response to send to the user. This field can be omitted by the webhook if it does not intend to send any response to the user.

page_info

PageInfo

Information about page status. This field can be omitted by the webhook if it does not intend to modify page status.

session_info

SessionInfo

Information about session status. This field can be omitted by the webhook if it does not intend to modify session status.

payload

Struct

Value to append directly to QueryResult.webhook_payloads.

Union field transition. The target to transition to. This can be set optionally to indicate an immediate transition to a different page in the same host flow, or a different flow in the same agent. transition can be only one of the following:
target_page

string

The target page to transition to. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>.

target_flow

string

The target flow to transition to. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.

FulfillmentResponse

Represents a fulfillment response to the user.

Fields
messages[]

ResponseMessage

The list of rich message responses to present to the user.

merge_behavior

MergeBehavior

Merge behavior for messages.

MergeBehavior

Defines merge behavior for messages.

Enums
MERGE_BEHAVIOR_UNSPECIFIED Not specified. APPEND will be used.
APPEND messages will be appended to the list of messages waiting to be sent to the user.
REPLACE messages will replace the list of messages waiting to be sent to the user.