followupEventInput 매개변수가 WebhookResponse에 설정되면 Dialogflow는 fulfillmentText, fulfillmentMessages, payload 필드를 무시합니다.
또한 followupEventInput.languageCode 필드는 필수 필드이지만 언어가 이미 시작 감지 인텐트 인식 요청에 정의되었으므로 Dialogflow는 이 필드를 무시합니다.
Dialogflow는 이벤트가 포함된 웹훅 응답을 받으면 정의된 해당 인텐트를 즉시 트리거합니다.
다음에서는 단계 흐름을 설명합니다.
최종 사용자가 표현을 입력하거나 말합니다.
Dialogflow는 최종 사용자 표현을 fulfillment에 대해 구성된 Intent-1과 일치시킵니다.
Dialogflow가 서버에 웹훅 요청을 보냅니다.
서버가 후속 조치 이벤트가 포함된 웹훅 응답으로 응답합니다.
Dialogflow는 사용자에게 Intent-1 일치에 대한 응답을 보내는 대신, 이벤트에 구성된 Intent-2를 트리거합니다.
Dialogflow는 최종 사용자가 Intent-2 일치를 시작한 것처럼 일치를 진행하고, Intent-2 구성에 지정된 대로 필요한 매개변수와 fulfillment를 처리합니다.
웹훅 응답 이벤트를 사용하여 인텐트 일치항목 연결
웹훅 응답 이벤트를 사용하여 인텐트 일치 작업을 연결할 수 있습니다.
위에 설명된 흐름에서 Intent-2를 fulfillment에 구성할 수도 있습니다.
서버의 웹훅 응답이 또 다른 이벤트를 제공할 경우 Dialogflow는 최종 사용자에게 Intent-3에 대한 응답을 보내지 않고 이벤트에 구성된 Intent-3 일치를 계속 진행합니다.
Dialogflow는 체인이 끝날 때까지 최종 사용자에게 응답하지 않습니다.
이런 식으로 인텐트를 연결하는 경우 각 웹훅 응답이 제한 시간 이내에 전송되어야 합니다.
[[["이해하기 쉬움","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\u003eCustom events are user-defined actions that occur outside of direct end-user conversation, such as button clicks or time-based triggers.\u003c/p\u003e\n"],["\u003cp\u003eThese custom events can be invoked either through fulfillment or via the API's \u003ccode\u003edetectIntent\u003c/code\u003e call, using the \u003ccode\u003equeryInput.event\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eWhen invoking events with fulfillment, the \u003ccode\u003efollowupEventInput\u003c/code\u003e field of the \u003ccode\u003eWebhookResponse\u003c/code\u003e is used, allowing for the specification of event names, optional parameters, and the language code.\u003c/p\u003e\n"],["\u003cp\u003eUpon receiving a webhook response with a custom event, Dialogflow triggers the corresponding intent, essentially redirecting the conversation flow to a new intent, ignoring any other fields in the response.\u003c/p\u003e\n"],["\u003cp\u003eChaining multiple intents is possible, as a triggered intent can also invoke another event via fulfillment, but this chaining is limited to a maximum of three intent matches, where each webhook response must adhere to timeout restrictions.\u003c/p\u003e\n"]]],[],null,["# Custom events are events that you define.\nThey are used to handle things that happen\noutside the conversation with the end-user.\nFor example,\nthe end-user clicked a button,\na certain amount of time has passed,\navailable inventory has changed during the conversation,\nand so on.\n\nYou can invoke these events using either\n[fulfillment](/dialogflow/docs/fulfillment-overview)\nor\n[the API](/dialogflow/docs/api-overview).\n\nInvoke events with the API\n--------------------------\n\nThe request for a\n[`Sessions`](/dialogflow/docs/reference/common-types#sessions)\ntype `detectIntent` call contains a `queryInput.event` field,\nwhich is used to invoke events.\nThe type of this field is a `EventInput`,\nand it contains fields for the event name,\n[optional parameters](/dialogflow/docs/events-overview#param),\nand the language code.\n\nWhen you provide an event to a detect intent call,\nyou do not provide other data, like an end-user expression.\nThe call's sole purpose is to invoke an event and trigger an intent.\n\nInvoke events with fulfillment\n------------------------------\n\nYou can invoke events via\n[fulfillment](/dialogflow/docs/fulfillment-overview)\nby setting the `followupEventInput` field of the\n[`WebhookResponse`](/dialogflow/docs/reference/common-types#webhookresponse).\nYou can optionally set the `followupEventInput.parameters` field to provide\n[parameters](/dialogflow/docs/events-overview#param)\nto the intent.\n\nFor example: \n\n {\n \"followupEventInput\": {\n \"name\": \"event-name\",\n \"parameters\": {\n \"parameter-name-1\": \"parameter-value-1\",\n \"parameter-name-2\": \"parameter-value-2\"\n },\n \"languageCode\": \"en-US\"\n }\n }\n\nWhen the `followupEventInput` parameter is set for a `WebhookResponse`,\nDialogflow ignores the `fulfillmentText`, `fulfillmentMessages`,\nand `payload` fields.\nIn addition, the `followupEventInput.languageCode` field is a required field,\nbut Dialogflow ignores this field,\nbecause the language was already defined\nin the originating detect intent request.\n\nWhen Dialogflow receives a webhook response that includes an event,\nit immediately triggers the corresponding intent in which it was\n[defined](/dialogflow/docs/events-overview#config).\n\nThe following flow describes the steps:\n\n1. The end-user types or speaks an expression.\n2. Dialogflow matches the end-user expression to **Intent-1**, which is configured for fulfillment.\n3. Dialogflow sends a webhook request to your server.\n4. Your server responds with a webhook response that includes a followup event.\n5. Instead of responding to the user for the **Intent-1** match, Dialogflow triggers **Intent-2**, which is configured for the event.\n6. Dialogflow proceeds as though the end-user initiated the match for **Intent-2** and handles required parameters and fulfillment as dictated by the configuration of **Intent-2**.\n\nChaining intent matches with webhook response events\n----------------------------------------------------\n\nIt is possible to chain intent matches with webhook response events.\nIn the flow described above,\n**Intent-2** could also be configured for fulfillment.\nIf your server's webhook response supplies another event,\nDialogflow proceeds to match **Intent-3** (configured for the event)\nwithout responding to the end-user for **Intent-2**.\n\nDialogflow does not respond to the end-user until the chain has ended.\nWhen chaining intents in such a way,\neach webhook response must be sent within\n[timeout restrictions](/dialogflow/docs/fulfillment-how#webhook_response).\n| **Note:** You can chain *at most* 3 intent matches in this way."]]