Class: Google::Apis::DialogflowV3::GoogleCloudDialogflowCxV3beta1Fulfillment

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/dialogflow_v3/classes.rb,
lib/google/apis/dialogflow_v3/representations.rb,
lib/google/apis/dialogflow_v3/representations.rb

Overview

A fulfillment can do one or more of the following actions at the same time: * Generate rich message responses. * Set parameter values. * Call the webhook. Fulfillments can be called at various stages in the Page or Form lifecycle. For example, when a DetectIntentRequest drives a session to enter a new page, the page's entry fulfillment can add a static response to the QueryResult in the returning DetectIntentResponse, call the webhook (for example, to load user data from a database), or both.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDialogflowCxV3beta1Fulfillment

Returns a new instance of GoogleCloudDialogflowCxV3beta1Fulfillment.



9510
9511
9512
# File 'lib/google/apis/dialogflow_v3/classes.rb', line 9510

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#advanced_settingsGoogle::Apis::DialogflowV3::GoogleCloudDialogflowCxV3beta1AdvancedSettings

Hierarchical advanced settings for agent/flow/page/fulfillment/parameter. Settings exposed at lower level overrides the settings exposed at higher level. Overriding occurs at the sub-setting level. For example, the playback_interruption_settings at fulfillment level only overrides the playback_interruption_settings at the agent level, leaving other settings at the agent level unchanged. DTMF settings does not override each other. DTMF settings set at different levels define DTMF detections running in parallel. Hierarchy: Agent->Flow->Page->Fulfillment/Parameter. Corresponds to the JSON property advancedSettings



9458
9459
9460
# File 'lib/google/apis/dialogflow_v3/classes.rb', line 9458

def advanced_settings
  @advanced_settings
end

#conditional_casesArray<Google::Apis::DialogflowV3::GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases>

Conditional cases for this fulfillment. Corresponds to the JSON property conditionalCases



9463
9464
9465
# File 'lib/google/apis/dialogflow_v3/classes.rb', line 9463

def conditional_cases
  @conditional_cases
end

#enable_generative_fallbackBoolean Also known as: enable_generative_fallback?

If the flag is true, the agent will utilize LLM to generate a text response. If LLM generation fails, the defined responses in the fulfillment will be respected. This flag is only useful for fulfillments associated with no-match event handlers. Corresponds to the JSON property enableGenerativeFallback

Returns:

  • (Boolean)


9471
9472
9473
# File 'lib/google/apis/dialogflow_v3/classes.rb', line 9471

def enable_generative_fallback
  @enable_generative_fallback
end

#messagesArray<Google::Apis::DialogflowV3::GoogleCloudDialogflowCxV3beta1ResponseMessage>

The list of rich message responses to present to the user. Corresponds to the JSON property messages



9477
9478
9479
# File 'lib/google/apis/dialogflow_v3/classes.rb', line 9477

def messages
  @messages
end

#return_partial_responsesBoolean Also known as: return_partial_responses?

Whether Dialogflow should return currently queued fulfillment response messages in streaming APIs. If a webhook is specified, it happens before Dialogflow invokes webhook. Warning: 1) This flag only affects streaming API. Responses are still queued and returned once in non-streaming API. 2) The flag can be enabled in any fulfillment but only the first 3 partial responses will be returned. You may only want to apply it to fulfillments that have slow webhooks. Corresponds to the JSON property returnPartialResponses

Returns:

  • (Boolean)


9488
9489
9490
# File 'lib/google/apis/dialogflow_v3/classes.rb', line 9488

def return_partial_responses
  @return_partial_responses
end

#set_parameter_actionsArray<Google::Apis::DialogflowV3::GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction>

Set parameter values before executing the webhook. Corresponds to the JSON property setParameterActions



9494
9495
9496
# File 'lib/google/apis/dialogflow_v3/classes.rb', line 9494

def set_parameter_actions
  @set_parameter_actions
end

#tagString

The value of this field will be populated in the WebhookRequest fulfillmentInfo.tag field by Dialogflow when the associated webhook is called. The tag is typically used by the webhook service to identify which fulfillment is being called, but it could be used for other purposes. This field is required if webhook is specified. Corresponds to the JSON property tag

Returns:

  • (String)


9503
9504
9505
# File 'lib/google/apis/dialogflow_v3/classes.rb', line 9503

def tag
  @tag
end

#webhookString

The webhook to call. Format: projects//locations//agents//webhooks/. Corresponds to the JSON property webhook

Returns:

  • (String)


9508
9509
9510
# File 'lib/google/apis/dialogflow_v3/classes.rb', line 9508

def webhook
  @webhook
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
# File 'lib/google/apis/dialogflow_v3/classes.rb', line 9515

def update!(**args)
  @advanced_settings = args[:advanced_settings] if args.key?(:advanced_settings)
  @conditional_cases = args[:conditional_cases] if args.key?(:conditional_cases)
  @enable_generative_fallback = args[:enable_generative_fallback] if args.key?(:enable_generative_fallback)
  @messages = args[:messages] if args.key?(:messages)
  @return_partial_responses = args[:return_partial_responses] if args.key?(:return_partial_responses)
  @set_parameter_actions = args[:set_parameter_actions] if args.key?(:set_parameter_actions)
  @tag = args[:tag] if args.key?(:tag)
  @webhook = args[:webhook] if args.key?(:webhook)
end