작업은 호출 및 검색을 정의하는 앱의 진입점입니다.
모델을 빌드해야 합니다 작업 패키지라고 하는 JSON 파일에서 작업을 선언합니다.
나중에 테스트하거나 실행하려고 할 때
승인을 위해 작업 프로젝트를 제출하세요. 작업 패키지는
작업 프로젝트의 작업을 정의합니다.
작업 패키지에서 작업을 정의하려면
작업이 호출되고, 그에 상응하는 처리 엔드포인트가
인텐트가 트리거됩니다 다음과 같은 유형의 작업을 만들 수 있습니다.
기본 작업: 모든 작업 프로젝트에는 작동하는 시작 인텐트가 있어야 합니다.
를 사용자가 대화를 시작할 수 있는 진입점으로 사용할 수 있습니다. 시작 인텐트는
사용자가 작업 이름을 말하여 명시적으로 작업을 호출하면
예: "Hey Google, ExampleAction에 연결해 줘"). 이 시작 인텐트는
actions.intent.MAIN 인텐트 이름
딥 링크를 위한 추가 작업:
개발자가 직접 정의한 인텐트가 포함된 작업 패키지를 생성합니다. 이를 통해 사용자는
인텐트와 함께 작업 이름을 말하여 특정 기능을 호출할 수 있습니다.
(예: "Hey Google, ExampleAction에 신발 찾아 줘")
방법에 관한 자세한 내용은 인텐트 및 호출을 참고하세요.
이 호출 모델이 작동하는 방식을 알아봅시다.
기본 작업 정의
모든 작업 패키지에는
actions.intent.MAIN 인텐트를 처리하세요. 이 인텐트는 사용자가
이름별 작업 (예: "Hey Google, ExampleAction에 연결해 줘")
action.json라는 상용구 Action 패키지 파일을 생성하려면 다음을 실행합니다.
다음 단계를 따르세요.
진입점 역할을 하는 추가 작업을 제공할 수 있습니다. 이를 통해 사용자는
사용자가 자신이 원하는 것을 더욱 상세하게 구체적으로 설명하도록 하여
하고 싶은 일 (예: "Hey Google, ExampleAction에게 말해 줘"라고 하면
신발"처럼 말이죠.
추가 작업을 정의하려면 다음 단계를 따르세요.
actions 배열에서 모든 진입점의 작업을 지정합니다.
예를 들어 다음 코드는 다음을 정의하는 작업:
<ph type="x-smartling-placeholder">
</ph>
com.example.ExampleAction.BUY의 인텐트 이름
이 인텐트가 트리거될 때 사용자 입력에서 파싱할 parameters입니다.
이 방법은 작업구문에서 특정 데이터가 필요한 경우
사용자가 액션을 호출합니다.
queryPatterns: 사용자가 인텐트를 트리거하기 위해 해야 하는 말을 정의합니다.
쿼리 패턴에는 Schema.org 유형이 포함될 수 있습니다.
정의할 수 있습니다
{"description":"Direct access","name":"BUY","fulfillment":{"conversationName":"ExampleAction"},"intent":{"name":"com.example.ExampleAction.BUY","parameters":[{"name":"color","type":"org.schema.type.Color"}],"trigger":{"queryPatterns":["find some $org.schema.type.Color:color sneakers","buy some blue suede shoes","get running shoes"]}}}
conversationName를 지정하여 이 인텐트의 처리를 지정합니다.
conversations 객체의 항목에 해당합니다.
{"actions":[{"description":"Default welcome intent","name":"MAIN","fulfillment":{"conversationName":"ExampleAction"},"intent":{"name":"actions.intent.MAIN","trigger":{"queryPatterns":["talk to ExampleAction"]}}},{"description":"Direct access","name":"BUY","fulfillment":{"conversationName":"ExampleAction"},"intent":{"name":"com.example.ExampleAction.BUY","parameters":[{"name":"color","type":"org.schema.type.Color"}],"trigger":{"queryPatterns":["find some $org.schema.type.Color:color sneakers","buy some blue suede shoes","get running shoes"]}}}],"conversations":{"ExampleAction":{"name":"ExampleAction","url":"https://www.example.com/ExampleAction"}},"locale":"en"}
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eActions define how users invoke your app and are declared in a JSON file called the Action package.\u003c/p\u003e\n"],["\u003cp\u003eEvery Action package requires a default Action triggered by the \u003ccode\u003eactions.intent.MAIN\u003c/code\u003e intent, serving as the primary entry point.\u003c/p\u003e\n"],["\u003cp\u003eYou can define additional Actions for deep linking, enabling users to access specific app functionalities directly.\u003c/p\u003e\n"],["\u003cp\u003eActions utilize intents, query patterns, and fulfillment endpoints to process user requests and deliver responses.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egactions\u003c/code\u003e CLI helps generate and manage the Action package file for your Actions project.\u003c/p\u003e\n"]]],[],null,["# Define Actions (Dialogflow)\n\nActions are entry points into your app that define the [invocation and discovery](/assistant/df-asdk/discovery)\nmodel for your app. You declare Actions in a JSON file known as the [Action package](/assistant/df-asdk/reference/action-package/rest/Shared.Types/ActionPackage),\nwhich you later upload to your developer project when you want to test or\nsubmit your Actions project for approval. An Action package is a JSON file that\ndefines the Actions in your Actions project.\n\nTo define Actions in your Action package, you create an intent that defines how\nthe Action is invoked and the corresponding fulfillment endpoint for when the\nintent is triggered. You can create the following types of Actions:\n\n- **Default Action:** Every Actions project must have a welcome intent that acts as an entry point for users to start conversations. The welcome intent is triggered when users explicitly invoke an Action by uttering its name (for example, *\"Hey Google, talk to ExampleAction\"* ). This welcome intent is identified with the `actions.intent.MAIN` intent name.\n- **Additional Actions for deep-linking:** You can create additional Actions in your Action package with intents that you define yourself. This allows users to invoke specific functionality by saying an Action name along with an intent (for example: *\"Hey Google, talk to ExampleAction to find some shoes\"*).\n\nSee [Intents and invocation](/assistant/df-asdk/discovery) for more information on how\nthese invocation models work.\n\nDefine a default Action\n-----------------------\n\nEvery Action package must have one and only one intent that handles the\n`actions.intent.MAIN` intent. This intent is triggered when users invoke your\nAction by name (for example, *\"Hey Google, talk to ExampleAction\"*).\n| **Note:** You specify your Action name in the project, when you submit your Action package for approval. During testing, you invoke your Action by saying *\"talk\n| to my test app\"*.\n\nTo generate a boilerplate Action package file named `action.json`, take the\nfollowing steps:\n\n1. Download the [`gactions` CLI](/assistant/df-asdk/actions-sdk/gactions-cli).\n2. Create a local directory for your Action project's source files.\n3. Run the following commands in the terminal:\n\n ```bash\n $ cd PROJECT_DIRECTORY\n $ gactions init\n ```\n\nOnce the Action package file is generated, replace placeholder content with your\nvalues. Here's an example of `action.json` with changes for `ExampleAction`: \n\n```text\n{\n \"actions\": [\n {\n \"description\": \"Default welcome intent\",\n \"name\": \"MAIN\",\n \"fulfillment\": {\n \"conversationName\": \"ExampleAction\"\n },\n \"intent\": {\n \"name\": \"actions.intent.MAIN\",\n \"trigger\": {\n \"queryPatterns\": [\n \"talk to ExampleAction\"\n ]\n }\n }\n }\n ],\n \"conversations\": {\n \"ExampleAction\": {\n \"name\": \"ExampleAction\",\n \"url\": \"https://www.example.com/ExampleAction\"\n }\n },\n \"locale\": \"en\"\n}\n```\n\nDefine additional Actions\n-------------------------\n\nYou can provide additional Actions that act as entry points. This lets users\ndisambiguate their intent by letting them specify more details about what they\nwant to do (for example, *\"Hey Google, talk to ExampleAction to find me some\nshoes.\"*).\n\nTo define additional Actions:\n\n1. In the `actions` array, specify an Action for every entry point.\n\n For example, the following code shows an additional \"buy\" Action that defines:\n - An intent name of `com.example.ExampleAction.BUY`\n - `parameters` to parse from the user input when this intent is triggered. This is useful if you need specific data from the Action phrase when users invoke the Action.\n - `queryPatterns` that define what users need to say to trigger the intent. [Query patterns](/assistant/df-asdk/reference/action-package/QueryPatterns) can include Schema.org types that define parameters to parse.\n\n ```carbon\n {\n \"description\": \"Direct access\",\n \"name\": \"BUY\",\n \"fulfillment\": {\n \"conversationName\": \"ExampleAction\"\n },\n \"intent\": {\n \"name\": \"com.example.ExampleAction.BUY\",\n \"parameters\": [\n {\n \"name\": \"color\",\n \"type\": \"org.schema.type.Color\"\n }\n ],\n \"trigger\": {\n \"queryPatterns\": [\n \"find some $org.schema.type.Color:color sneakers\",\n \"buy some blue suede shoes\",\n \"get running shoes\"\n ]\n }\n }\n }\n \n ```\n| Note: We recommend around 10 `queryPatterns` phrases for each intent. These query patterns are used by Google for Action ranking and discovery. They should be representative of your Action's capabilities and indicate how users might want to invoke your Actions.\n2. Specify the fulfillment for this intent by specifying a `conversationName`\n that corresponds to an item in the `conversations` object.\n\n ```text\n {\n \"conversations\": {\n \"ExampleAction\": {\n \"name\": \"ExampleAction\",\n \"url\": \"https://www.example.com/ExampleAction\"\n }\n }\n }\n \n ```\n| Note: You typically will only need one fulfillment endpoint, but Action packages support many.\n\nHere's an example of a full Action package: \n\n```carbon\n{\n \"actions\": [\n {\n \"description\": \"Default welcome intent\",\n \"name\": \"MAIN\",\n \"fulfillment\": {\n \"conversationName\": \"ExampleAction\"\n },\n \"intent\": {\n \"name\": \"actions.intent.MAIN\",\n \"trigger\": {\n \"queryPatterns\": [\n \"talk to ExampleAction\"\n ]\n }\n }\n },\n {\n \"description\": \"Direct access\",\n \"name\": \"BUY\",\n \"fulfillment\": {\n \"conversationName\": \"ExampleAction\"\n },\n \"intent\": {\n \"name\": \"com.example.ExampleAction.BUY\",\n \"parameters\": [\n {\n \"name\": \"color\",\n \"type\": \"org.schema.type.Color\"\n }\n ],\n \"trigger\": {\n \"queryPatterns\": [\n \"find some $org.schema.type.Color:color sneakers\",\n \"buy some blue suede shoes\",\n \"get running shoes\"\n ]\n }\n }\n }\n ],\n \"conversations\": {\n \"ExampleAction\": {\n \"name\": \"ExampleAction\",\n \"url\": \"https://www.example.com/ExampleAction\"\n }\n },\n \"locale\": \"en\"\n}\n```"]]