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.
JSON representation |
---|
{ "messages": [ { object ( |
Fields | |
---|---|
messages[] |
The list of rich message responses to present to the user. |
webhook |
The webhook to call. Format: |
returnPartialResponses |
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. |
tag |
The value of this field will be populated in the |
setParameterActions[] |
Set parameter values before executing the webhook. |
conditionalCases[] |
Conditional cases for this fulfillment. |
advancedSettings |
Hierarchical advanced settings for this fulfillment. The settings exposed at the lower level overrides the settings exposed at the higher level. |
enableGenerativeFallback |
If the flag is true, the agent will utilize LLM to generate a text response. If LLM generation fails, the defined |
SetParameterAction
Setting a parameter value.
JSON representation |
---|
{ "parameter": string, "value": value } |
Fields | |
---|---|
parameter |
Display name of the parameter. |
value |
The new value of the parameter. A null value clears the parameter. |
ConditionalCases
A list of cascading if-else conditions. Cases are mutually exclusive. The first one with a matching condition is selected, all the rest ignored.
JSON representation |
---|
{
"cases": [
{
object ( |
Fields | |
---|---|
cases[] |
A list of cascading if-else conditions. |
Case
Each case has a Boolean condition. When it is evaluated to be True, the corresponding messages will be selected and evaluated recursively.
JSON representation |
---|
{
"condition": string,
"caseContent": [
{
object ( |
Fields | |
---|---|
condition |
The condition to activate and select this case. Empty means the condition is always true. The condition is evaluated against [form parameters][Form.parameters] or [session parameters][SessionInfo.parameters]. See the conditions reference. |
caseContent[] |
A list of case content. |
CaseContent
The list of messages or conditional cases to activate for this case.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field cases_or_message . Either a message is returned or additional cases to be evaluated. cases_or_message can be only one of the following: |
|
message |
Returned message. |
additionalCases |
Additional cases to be evaluated. |