Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
İşlemler, uygulamanıza çağrı ve keşfi tanımlayan giriş noktalarıdır
modeliniz olmalıdır. İşlemler'i İşlem paketi olarak bilinen bir JSON dosyasında tanımlarsınız,
veya bir öğeyi test etmek istediğinizde veya daha sonra geliştirici projenize
Actions projenizi onaya gönderin. İşlem paketi,
Actions projenizdeki İşlemler'i tanımlar.
İşlem paketinizde İşlemler tanımlamak için, aşağıdakileri içeren bir intent oluşturursunuz:
İşlem çağrılır ve
etkinleşir. Aşağıdaki İşlem türlerini oluşturabilirsiniz:
Varsayılan İşlem: Her Actions projesinin çalışan bir karşılama amacı olmalıdır
olarak ayarlayabilirsiniz. Karşılama niyeti
Kullanıcılar bir İşlemi adını söyleyerek açıkça çağırdığında tetiklenir (örneğin,
(ör. "Ok Google, Ornekİşlemi ile konuş") yazabilirsiniz. Bu karşılama amacı şununla tanımlanır:
actions.intent.MAIN intent adı.
Derin bağlantı için Ek İşlemler: Şurada ek İşlemler oluşturabilirsiniz:
kendi tanımladığınız niyetlerle İşlem paketinizi oluşturun. Bu sayede kullanıcılar
bir hedefle birlikte İşlem adını söyleyerek belirli bir işlevi çağırmak
(örneğin: "Ok Google, ayakkabı bulmak için ExampleAction ile konuşun").
Nasıl yapılacağı hakkında daha fazla bilgi için Amaçlar ve çağrı bölümüne bakın
çalışır.
Varsayılan İşlem tanımlayın
Her Action paketinde
actions.intent.MAIN intent. Bu amaç, kullanıcılar
Ada göre işlem (örneğin, "Ok Google, ExampleAction ile konuş").
action.json adlı bir ortak işlem paketi oluşturmak için
şu adımları uygulayın:
İşlem projenizin kaynak dosyaları için yerel dizin oluşturun.
Terminalde aşağıdaki komutları çalıştırın:
$cdPROJECT_DIRECTORY
$gactionsinit
İşlem paketi dosyası oluşturulduktan sonra yer tutucu içeriği
değerler. ExampleAction tarafından yapılan değişiklikleri içeren bir action.json örneği aşağıda verilmiştir:
Giriş noktası görevi gören ek işlemler sağlayabilirsiniz. Bu sayede kullanıcılar
ne istedikleri hakkında daha fazla ayrıntı vermelerine olanak tanıyarak
amaçlarını netleştirmelerini sağlar.
yapmak istiyorum (Örneğin, "Ok Google, bana birkaç örnek
ayakkabılar.") kullanılabilir.
Ek İşlemler tanımlamak için:
actions dizisinde, her giriş noktası için bir İşlem belirtin.
Örneğin, aşağıdaki kodda ek bir "satın al" ifadesi gösterilir Şunları tanımlayan işlem:
com.example.ExampleAction.BUY amaç adı
Bu amaç tetiklendiğinde kullanıcı girişinden ayrıştırmak için parameters.
Bu özellik, şu durumlarda İşlem ifadesinden belirli verilere ihtiyacınız
kullanıcılar İşlemi çağırır.
Amacı tetiklemek için kullanıcıların söylemesi gereken bilgileri tanımlayan queryPatterns.
Sorgu kalıpları Schema.org türlerini içerebilir
API'leri kullanabilirsiniz.
{"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 belirterek bu amaç için istek karşılamayı belirtin.
conversations nesnesindeki bir öğeye karşılık gelir.
{"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"}
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 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```"]]