일반적인 Actions on Google 상호작용 시나리오에서 사용자는 작업을 호출하는 문구를 말합니다. 응답을 제공하기 위해 Actions on Google은 사용자가 호출한 작업과 일치하는 처리를 찾아 요청을 전송합니다.
Actions on Google은 처리가 사용자의 호출에 적합하다고 판단하면 사용자의 요청 정보와 함께 JSON 페이로드가 포함된 HTTP 요청을 처리 엔드포인트로 전송하여 대화 세션을 시작합니다. 처리는 요청을 파싱하고 JSON 페이로드가 포함된 응답을 반환합니다. 그러면 Actions on Google이 사용자를 위해 페이로드를 렌더링된 음성 및 멀티미디어 출력으로 변환합니다.
그림 1. Actions SDK를 통해 처리를 호출하는 Actions on Google
Actions on Google에서 Actions SDK를 통해 처리를 호출할 때 JSON 페이로드 형식에 대한 자세한 내용은 대화 웹훅 형식을 참조하세요.
Dialogflow 요청 및 응답
작업을 만들 때 선택적으로 Dialogflow를 사용하여 대화 인터페이스 빌드 작업을 간소화할 수 있습니다. 이 시나리오에서 Dialogflow는 Actions on Google과 처리 간의 프록시 역할을 합니다. Actions on Google은 HTTP/JSON 요청을 처리 엔드포인트로 직접 전송하는 대신 Dialogflow로 전송합니다.
Dialogflow는 원래 요청에 포함된 JSON 페이로드를 Dialogflow 웹훅 형식으로 래핑하고 결과 요청을 Dialogflow 처리로 전달합니다.
반대로, fulfillment가 Dialogflow에 응답을 전송할 때 응답의 JSON 페이로드는 Dialogflow 웹훅 형식을 준수해야 합니다. 처리는 Dialogflow JSON 요청에서 매개변수를 파싱하고 Dialogflow 웹훅 형식으로 응답을 생성합니다. 그러면 Dialogflow는 처리의 응답을 어시스턴트가 이해할 수 있는 응답 메시지로 변환합니다.
그림 2. Dialogflow를 통해 처리를 호출하는 Actions on Google
Actions on Google에서 Dialogflow를 통해 처리를 호출할 때 JSON 페이로드 형식에 대한 자세한 내용은 Dialogflow 웹훅 형식을 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2023-12-02(UTC)"],[[["Actions on Google communicates with your fulfillment service through webhooks, sending JSON payloads that describe user requests."],["Your fulfillment service needs to process these requests, generate appropriate JSON responses, and send them back to the Assistant."],["There are two main webhook formats: Dialogflow webhook format and Conversation webhook format, depending on whether you use Dialogflow or Actions SDK."],["Webhooks can handle different request types like invocation requests, conversation requests, and helper results, each with specific JSON structures."],["Dialogflow can act as a proxy between Actions on Google and your fulfillment, handling the communication and format conversions."]]],["Actions on Google uses webhooks to communicate with fulfillment services, sending HTTP POST requests with JSON payloads. Fulfillment services must parse these requests and respond with appropriately formatted JSON. There are two main webhook formats: Dialogflow and Conversation, corresponding to whether Dialogflow acts as a proxy. Webhook requests can be invocations, conversation turns, or helper results. The fulfillment reads parameters from the request payload and sends a reply back to the Assistant.\n"]]