통합 옵션 중 하나를 사용하지 않는 경우 최종 사용자와 직접 상호작용하는 코드를 작성해야 합니다.
또한 최종 사용자 표현을 보내고 인텐트 일치를 수신하려면 대화 차례마다 Dialogflow의 API와 직접 상호작용해야 합니다.
다음 다이어그램은 API와 상호작용하는 경우의 처리 흐름을 보여줍니다.
최종 사용자가 표현을 입력하거나 말합니다.
서비스가 이 최종 사용자 표현을 Dialogflow에 인텐트 탐지 요청 메시지로 보냅니다.
Dialogflow가 서비스에 인텐트 감지 응답 메시지를 보냅니다.
이 메시지에는 일치하는 인텐트, 작업, 매개변수, 인텐트에 정의된 응답에 대한 정보가 포함됩니다.
서비스가 필요에 따라 데이터베이스 쿼리 또는 외부 API 호출과 같은 작업을 수행합니다.
서비스가 최종 사용자에게 응답을 보냅니다.
최종 사용자가 응답을 보거나 듣습니다.
프로젝트 설정 및 인증
API를 호출하기 전에 GCP 프로젝트와 인증을 설정해야 합니다.
설정 빠른 시작의 단계를 따르세요.
에이전트 빌드
대부분의 경우 Dialogflow ES 콘솔 (문서 보기, 콘솔 열기)을 사용하여 에이전트를 빌드해야 합니다.
콘솔 빠른 시작 페이지의 단계에 따라 에이전트를 만들 수 있습니다.
또한 Dialogflow API를 사용하여 고급 시나리오용 에이전트를 빌드할 수도 있습니다.
많은 개념 페이지는 콘솔을 사용하여 에이전트를 빌드하는 데 중점을 두지만 관련 API 유형에 대한 링크도 제공합니다.
REST, gRPC, 클라이언트 라이브러리
REST, gRPC 또는 제공된 클라이언트 라이브러리를 통해 Dialogflow API에 액세스할 수 있습니다.
이러한 옵션에 대한 자세한 내용은 API 사용 개요를 참조하세요.
세션
세션은 Dialogflow 에이전트와 최종 사용자 간의 대화를 나타냅니다.
대화를 시작할 때 세션을 만들고 대화 차례마다 이 세션을 사용합니다.
대화가 종료되면 세션 사용을 중단합니다.
여러 최종 사용자와 동시에 진행되는 대화에서 동일한 세션을 사용하면 안 됩니다.
Dialogflow는 각 활성 세션에 현재 활성인 컨텍스트를 유지합니다.
Dialogflow는 20분 동안 세션 데이터를 저장합니다.
각 세션은 시스템에서 생성되는 세션 ID로 고유하게 구분됩니다.
인텐트 감지 요청에 새 세션 ID를 제공하여 새 세션을 만듭니다.
세션 ID는 최대 36바이트 크기의 문자열입니다.
시스템은 고유한 세션 ID를 생성합니다.
세션 ID는 랜덤 숫자, 해싱된 최종 사용자 식별자 또는 사용자가 생성하기 편리한 기타 값일 수 있습니다.
인텐트 감지
상호작용에 API를 사용하면 서비스는 최종 사용자와 직접 상호작용합니다.
각 대화 차례에서 서비스는 Sessions 유형의 detectIntent 또는 streamingDetectIntent 메서드를 호출하여 Dialogflow에 최종 사용자 표현을 전송합니다.
Dialogflow는 일치하는 인텐트, 작업, 매개변수, 인텐트에 정의된 응답에 대한 정보로 응답합니다.
서비스는 필요에 따라 작업을 수행하고(예: 데이터베이스 쿼리 또는 외부 API 호출) 최종 사용자에게 메시지를 전송합니다.
이 프로세스는 대화가 종료될 때까지 계속됩니다.
[[["이해하기 쉬움","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-09-04(UTC)"],[[["\u003cp\u003eWhen not using pre-built integrations, direct interaction with Dialogflow's API is required for each conversational turn to process end-user input and receive intent matches.\u003c/p\u003e\n"],["\u003cp\u003eInteractions with the Dialogflow API follow a process where the service sends user expressions, Dialogflow returns intent data, and the service then performs actions and replies to the user.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the API, users need to set up a GCP project and authentication, which can be done through the provided setup quickstart.\u003c/p\u003e\n"],["\u003cp\u003eA session represents a conversation with an end-user, initiated with a unique session ID, and this ID should not be used for multiple concurrent conversations.\u003c/p\u003e\n"],["\u003cp\u003eTo interact, the service calls the \u003ccode\u003edetectIntent\u003c/code\u003e method to send the user's expressions to Dialogflow, which will respond with data about matched intents.\u003c/p\u003e\n"]]],[],null,["# API interactions\n\nIf you are not using one of the\n[integration](/dialogflow/docs/integrations)\noptions,\nyou must write code that directly interacts with the end-user.\nYou must also directly\n\ninteract with Dialogflow's API\n\nfor each conversational turn\nto send end-user expressions and receive intent matches.\nThe following diagram shows the processing flow when interacting with the API.\n\n1. The end-user types or speaks an expression.\n2. Your service sends this end-user expression to Dialogflow in a detect intent request message.\n3. Dialogflow sends a detect intent response message to your service. This message contains information about the matched intent, the action, the parameters, and the response defined for the intent.\n4. Your service performs actions as needed, like database queries or external API calls.\n5. Your service sends a response to the end-user.\n6. The end-user sees or hears the response.\n\nProject setup and authentication\n--------------------------------\n\nBefore calling the API,\nyou need to set up a GCP project and authentication.\nYou can follow the steps in the\n[Setup quickstart](/dialogflow/docs/quick/setup).\n\nAgent building\n--------------\n\nIn most cases you should use the Dialogflow ES console ([visit documentation](/dialogflow/docs/console), [open console](https://dialogflow.cloud.google.com)) to build agents.\nYou can follow the steps in the\n[console quickstart page](/dialogflow/docs/quick/build-agent)\nto create an agent.\nYou can also use the Dialogflow API to build agents for advanced scenarios.\nMany\n[concept pages](/dialogflow/docs/concepts)\nfocus on using the console to build agents,\nbut they also provide links to relevant API types.\n\nREST, gRPC, and client libraries\n--------------------------------\n\nYou can access the Dialogflow API via REST, gRPC,\nor one of the provided client libraries.\nFor the details on these options,\nsee the\n[API usage overview](/dialogflow/docs/reference/api-overview).\n\nSessions\n--------\n\n\nA *session* represents a conversation between a Dialogflow agent and an end-user.\nYou create a session at the beginning of a conversation\nand use it for each turn of the conversation.\nOnce the conversation has ended, you discontinue using the session.\n\n\nYou should not use the same session for\nconcurrent conversations with different end-users.\nDialogflow maintains the currently active contexts for each active session.\nSession data is stored by Dialogflow for 20 minutes.\n\n\nEach session is determined unique by a session ID generated by your system.\nYou create a new session by providing a new session ID in a\n[detect intent request](/dialogflow/docs/api-overview#detect-intent).\nA session ID is a string of at most 36 bytes in size.\nYour system is responsible for generating unique session IDs.\nThey can be random numbers, hashed end-user identifiers,\nor any other values that are convenient for you to generate.\n\nDetect intent\n-------------\n\n\nWhen you use the API for interactions,\nyour service interacts directly with the end-user.\nFor each conversational turn,\nyour service sends end-user expressions to Dialogflow by calling the\n`detectIntent` or `streamingDetectIntent` method of the\n[`Sessions`](/dialogflow/docs/reference/common-types#sessions)\ntype.\nDialogflow responds with information about the matched intent,\nthe action, the parameters, and the response defined for the intent.\nYour service performs actions as needed\n(for example, database queries or external API calls)\nand sends a message to the end-user.\nThis process continues until the conversation has ended.\n\nYou can find examples of calling detect intent in the\n[API quickstart page](/dialogflow/docs/quick/api)\nand the\n[how-to pages](/dialogflow/docs/how)."]]