[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eThe Generative fallback feature in Conversational Agents (Dialogflow CX) uses large language models (LLMs) to generate responses when user input doesn't match an intent or parameter, offering a dynamic way to handle no-match events.\u003c/p\u003e\n"],["\u003cp\u003eGenerative fallback can be enabled on no-match event handlers within flows, pages, or during parameter filling, allowing the agent to provide generated responses when these events are triggered.\u003c/p\u003e\n"],["\u003cp\u003eThe generated responses are based on text prompts, which can be predefined or customized, and they can include placeholders like \u003ccode\u003e$conversation\u003c/code\u003e and \u003ccode\u003e$last-user-utterance\u003c/code\u003e to tailor the response to the conversation context.\u003c/p\u003e\n"],["\u003cp\u003eThe system checks generated responses against a list of banned phrases; if a banned phrase is detected or the response is deemed unsafe, the standard agent response is used instead.\u003c/p\u003e\n"],["\u003cp\u003eYou can configure and test the generative fallback feature via the Dialogflow CX console, as well as modify banned phrases, create custom prompts, and test the generated responses within the simulator.\u003c/p\u003e\n"]]],[],null,["# Generative fallback\n\n| **Note:** The *Generative fallback* feature is excluded from the [Conversational Agents (Dialogflow CX)\n| SLA](/dialogflow/sla).\n\nThe *generative fallback* feature uses Google's latest generative large language\nmodels (LLMs) to generate virtual agent responses when end-user input does not\nmatch an intent or parameter for form filling.\n\nThe feature can be configured with a *text prompt* that instructs the LLM how to\nrespond. You can use a predefined text prompt or add your own prompts. With the\npredefined prompt, the virtual agent is able to handle basic conversational\nsituations. For example:\n\n- Greet and say goodbye to the user.\n- Repeat what the agent said in case the user didn't understand.\n- Hold the line when the user asks for it.\n- Summarize the conversation.\n\nYou can enable generative fallback on *no-match event handlers* used in flows,\npages, or during parameter filling. When generative fallback is enabled for a\nno-match event, whenever that event triggers, Conversational Agents (Dialogflow CX) will attempt to produce\na generated response that will be said back to the user. If the response\ngeneration is unsuccessful, the regular prescribed agent response will be issued\ninstead.\n\nLimitations\n-----------\n\nThe feature is available in the\n[languages supported by the Gemini API](/vertex-ai/generative-ai/docs/learn/models#gemini-models).\n\nEnable generative fallback\n--------------------------\n\nYou can enable generative fallback in your agent on *no-match event handlers*,\nwhich can be used in flow, page or parameter fulfillment.\n\n### Enable generative fallback for an entire flow's no-match events:\n\n1. Go to the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Select a project.\n3. Select an agent, then select a flow.\n4. Click the **Start Page** of the flow to expand it.\n5. Click **sys.no-match-default** under **Event handlers**.\n6. Check **Enable generative fallback** under **Agent responses**.\n7. Click **Save**.\n\n### Enable generative fallback on specific no-match events:\n\n1. Navigate to the target **No-match** event handler (any event starting with **No-match** , such as **No-match default** , **No-match 1**, and so on).\n2. Check **Enable generative fallback** under **Agent responses**.\n3. Click **Save**.\n\nConfigure generative fallback\n-----------------------------\n\nAs mentioned above, the *generative fallback* feature passes a request to a\nlarge language model in order to produce the generated response. The request\ntakes the form of a *text prompt* that is a mix of natural language and\ninformation about the current state of the agent and of the conversation. The\nprompt and the generated response are checked against a list of *banned\nphrases* . If they contain any banned phrase, or are otherwise deemed unsafe,\ngeneration will be unsuccessful, and the regular prescribed response (under\n*Agent says* in the same fulfilment) will be issued instead.\n\nThe feature can be configured in multiple ways:\n\n1. Select a predefined prompt.\n2. Define a custom prompt.\n3. Add or remove phrases from the list of banned phrases.\n\nWhen creating a prompt, in addition to a natural language description of what\nkind of context should be generated, the following *placeholders* can also be\nused:\n\nMake sure to have good flow and intent descriptions.\n\n### Choose a predefined prompt\n\n1. In **Agent Settings** , navigate to the **Generative AI** tab, and then the **Generative Fallback** sub-tab.\n2. Select one of the options in the **Template** dropdown.\n3. Click **Save**.\n\nThe feature provides two template prompts, the **Default** template (which is\nnot visible) and the **Example** template that can serve as a guide for writing\nyour own prompts.\n\n### Define your own prompt\n\n1. In **Agent Settings** , navigate to the **Generative AI** tab, and then the **Generative Fallback** sub-tab.\n2. Select **+ new template** in the **Template** dropdown.\n3. Add a **Template name**.\n4. Add a **Text prompt**.\n5. Click **Save**.\n\nYou can also start by editing the **Example** template and saving it as a new\ntemplate:\n\n1. Select **Example** in the **Template** dropdown.\n2. Click **Edit**.\n3. Edit the **Template name**.\n4. Edit the **Text prompt**.\n5. Click **Save**.\n\n### Modify the list of banned phrases\n\n| **Note:** Any banned phrases in this list will apply to [generators](/dialogflow/cx/docs/concept/generative/generators) as well as generative fallback responses.\n\n1. In **Agent Settings** , navigate to the **Generative AI** tab, and then the **General** sub-tab.\n2. In the **Banned phrases** section, inspect, add to, or remove phrases from the list.\n3. Click **Save**.\n\nTest generative fallback\n------------------------\n\nYou can test the *generative fallback* feature in the simulator. Whenever a user\nutterance leads to no-match on a flow/page where the no-match event was\nconfigured to produce a generative response (and the generation succeeds), the\nagent will output the generated response.\n\nCodelab\n-------\n\nAlso see the [Generative fallback\nCodelab](https://codelabs.developers.google.com/codelabs/dialogflow-generative-fallback).\n\nTroubleshooting\n---------------\n\n| **Note:** The steps outlined in this section are only available for **non-default\n| prompt templates**.\n\nIf you want to debug the feature, you can inspect the resolved large language\nmodel (LLM) input prompt in Dialogflow Console simulator:\n\n1. Click the **original response** button:\n\n2. Locate the **\"Generative Fallback Prompt\"** field. Read these fields as plain\n text and check whether the LLM input makes sense. If any phrase contains\n `$`, examine the simulator input and clarify whether the `$` in the\n prompts are intentional (for example, `$` in `price is $10` would likely\n be intentional, while `visit $city` would likely not and could imply either\n mis-usage or a bug). If you are unsure, [contact Support](/dialogflow/docs/support/getting-support#gcp-support).\n\n3. If you are using a non-default prompt template but can't see the \"Generative\n Fallback Prompt\" field,\n [contact Support](/dialogflow/docs/support/getting-support#gcp-support)."]]