생성형 대체 기능은 Google의 최신 생성형 대규모 언어 모델(LLM)을 사용하여 최종 사용자 입력이 양식 채우기를 위한 인텐트 또는 매개변수와 일치하지 않을 때 가상 에이전트 응답을 생성합니다.
이 기능은 LLM에 응답 방법을 알려주는 텍스트 프롬프트로 구성할 수 있습니다. 사전 정의된 텍스트 프롬프트를 사용하거나 자체 프롬프트를 추가할 수 있습니다. 사전 정의된 프롬프트를 통해 가상 에이전트는 기본적인 대화 상황을 처리할 수 있습니다. 예를 들면 다음과 같습니다.
사용자에게 인사하고 작별 인사를 건넵니다.
사용자가 이해하지 못하는 경우 에이전트가 말한 내용을 반복합니다.
사용자가 요청하면 기다립니다.
대화를 요약합니다.
흐름, 페이지 또는 매개변수 채우기 중에 사용되는 no-match 이벤트 핸들러에서 생성적 대체를 사용 설정할 수 있습니다. 일치 항목 없음 이벤트에 생성형 대체가 사용 설정된 경우 해당 이벤트가 트리거될 때마다 D대화형 에이전트(Dialogflow CX)에서 생성된 응답을 만들어 사용자에게 다시 알립니다. 응답 생성이 실패하면 일반 사전 정의된 에이전트 응답이 대신 발급됩니다.
대상 No-match 이벤트 핸들러(No-match default, No-match 1 등과 같이 No-match로 시작하는 모든 이벤트)로 이동합니다.
에이전트 응답에서 생성적 대체 사용 설정을 선택합니다.
저장을 클릭합니다.
생성적 대체 구성
위에서 언급한 것처럼 생성적 대체 기능은 생성된 응답을 만들기 위해 대규모 언어 모델로 요청을 전달합니다. 요청은 자연어와 에이전트의 현재 상태 및 대화 정보가 혼합된 텍스트 프롬프트의 형태를 취합니다. 프롬프트 및 생성된 응답은 차단된 문구 목록에서 확인됩니다. 차단된 문구가 포함되어 있거나 안전하지 않은 것으로 간주되는 경우 생성에 실패하고 일반 사전 정의된 응답(동일한 fulfilment에서 에이전트가 말한 대로)이 대신 발급됩니다.
이 기능은 여러 방법으로 구성할 수 있습니다.
사전 정의된 프롬프트를 선택합니다.
커스텀 프롬프트를 정의합니다.
차단된 문구 목록에서 문구를 추가하거나 삭제합니다.
프롬프트를 만들 때 생성해야 할 컨텍스트에 대한 자연어 설명 외에 다음 자리표시자를 사용할 수도 있습니다.
$conversation 자리표시자의 매개변수화된 버전입니다. 최종 사용자 프리픽스(USER), 에이전트 프리픽스(AI), 포함할 이전 차례 횟수(TURNS)를 맞춤설정할 수 있습니다. 모든 자리표시자 매개변수 값을 지정해야 합니다. 예를 들면 다음과 같습니다. ${conversation USER:"Human says:" AI:"Agent says:" TURNS:4}
$last-user-utterance
마지막 사용자 발화입니다.
$flow-description
활성 흐름의 흐름 설명입니다.
$route-descriptions
활성 인텐트의 인텐트 설명입니다.
흐름과 인텐트 설명이 올바른지 확인합니다.
사전 정의된 프롬프트 선택
에이전트 설정에서 생성형 AI 탭으로 이동한 후 생성적 대체 하위 탭으로 이동합니다.
템플릿 드롭다운에서 옵션 중 하나를 선택합니다.
저장을 클릭합니다.
이 기능은 기본 템플릿(표시되지 않음)과 자신만의 프롬프트를 작성하기 위한 가이드 역할을 할 수 있는 예시 템플릿이라는 두 가지 템플릿 프롬프트를 제공합니다.
자체 프롬프트 정의
에이전트 설정에서 생성형 AI 탭으로 이동한 후 생성적 대체 하위 탭으로 이동합니다.
템플릿 드롭다운에서 + 새 템플릿을 선택합니다.
템플릿 이름을 추가합니다.
텍스트 프롬프트를 추가합니다.
저장을 클릭합니다.
예시 템플릿을 수정하고 새 템플릿으로 저장하는 것으로 시작할 수도 있습니다.
템플릿 드롭다운에서 예시를 선택합니다.
수정을 클릭합니다.
템플릿 이름을 수정합니다.
텍스트 프롬프트를 수정합니다.
저장을 클릭합니다.
차단된 문구 목록 수정
에이전트 설정에서 생성형 AI 탭으로 이동한 후 일반 하위 탭으로 이동합니다.
차단된 문구 섹션에서 목록을 검사, 추가 또는 목록에서 문구를 삭제합니다.
저장을 클릭합니다.
생성적 대체 테스트
시뮬레이터에서 생성적 대체 기능을 테스트할 수 있습니다. no-match 이벤트가 생성형 응답을 만들도록 구성된 흐름/페이지에서 사용자 발화가 일치하지 않음으로 이어질 때마다(그리고 생성이 성공한 경우) 에이전트는 생성된 응답을 출력합니다.
기능을 디버깅하려면 Dialogflow 콘솔 시뮬레이터에서 확인된 대규모 언어 모델(LLM) 입력 프롬프트를 검사하면 됩니다.
원본 응답 버튼을 클릭합니다.
'생성적 대체 프롬프트' 필드를 찾습니다. 이러한 필드를 일반 텍스트로 읽고 LLM 입력이 적절한지 확인합니다. 구문에 $가 포함된 경우 시뮬레이터 입력을 검사하고 프롬프트의 $가 의도적인지 확인합니다. 예를 들어 price is $10의 $는 의도적인 반면 visit $city에서는 그렇지 않을 가능성이 높으며 오용이나 버그를 암시할 수 있습니다. 확실하지 않은 경우 지원팀에 문의하세요.
기본이 아닌 프롬프트 템플릿을 사용하지만 '생성적 대체 프롬프트' 필드가 표시되지 않으면 지원팀에 문의하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-03-04(UTC)"],[[["\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)."]]