نظرة عامة على حزمة تطوير البرامج (SDK) للإجراءات (Dialogflow)
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تتيح لك "المهام مع مساعد Google" توسيع نطاق وظائف "مساعد Google" من خلال
الإجراءات: تتيح الإجراءات للمستخدمين إنجاز المهام من خلال واجهة محادثة
يمكن أن تتراوح بين طلب سريع لتشغيل بعض المصابيح أو
المحادثات، مثل لعب لعبة معلومات عامة.
وحزمة تطوير البرامج (SDK) الخاصة بالإجراءات هي طريقة لتطوير تنفيذ المحادثات بدون
باستخدام Dialogflow. عند استخدام حزمة "SDK للإجراءات"، يمكنك استخدام "حزمة إجراءات" من أجل
الأهداف على تحقيقها. يجب أيضًا تقديم أنماط طلبات البحث في
حزمة الإجراءات من أجل تحديد أمثلة عبارات قد يقولها المستخدمون.
واجهة سطر الأوامر
عند تطوير البرامج باستخدام حزمة تطوير برامج المهام، يمكنك استخدام سطر الأوامر gactions.
(CLI) لاختبار مشروع "المهام" وتحديثه. واجهة سطر الأوامر gactions
يساعدك أيضًا في إنشاء وإدارة حزمة الإجراءات الخاصة بـ "المهام القائمة على المحادثة".
إنشاء إجراءات في حزمة الإجراءات
يمكنك إنشاء "المهام" في حزمة "الإجراء" من خلال ربط الأهداف بالتنفيذ.
يحدد الإجراء نقطة دخول لبدء محادثات مع
معرّفًا يسمى نية. ترتبط النوايا بالإنجازات، والتي تعالج
والنية.
على سبيل المثال، لنفترض أنك أردت إنشاء مشروع يحتوي على إجراءات
شراء بعض السلع، والتحقّق من حالة الطلبات، وإظهار بعض الصفقات اليومية.
يمكنك تحديد الأهداف التي تنشأ عن طريق قول:
"Ok Google، أريد التحدّث إلى ExampleAction".
"Ok Google، يُرجى التحدّث إلى ExampleAction لشراء بعض الأحذية".
"Ok Google، يُرجى التحدّث إلى ExampleAction للتحقّق من طلبي".
"Ok Google، أريد التحدّث إلى ExampleAction للاطّلاع على عروض اليوم".
قد يبدو ملف JSON لحزمة الإجراءات على النحو التالي:
{"actions":[{"name":"MAIN","intent":{"name":"actions.intent.MAIN"},"fulfillment":{"conversationName":"ExampleAction"}},{"name":"BUY","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"]}},"fulfillment":{"conversationName":"ExampleAction"}},{"name":"ORDER_STATUS","intent":{"name":"com.example.ExampleAction.ORDER_STATUS","trigger":{"queryPatterns":["check on my order","see order updates","check where my order is"]}},"fulfillment":{"conversationName":"ExampleAction"}},{"name":"DAILY_DEALS","intent":{"name":"com.example.ExampleAction.DAILY_DEALS","trigger":{"queryPatterns":["hear about daily deals","buying some daily deals","get today's deals"]}},"fulfillment":{"conversationName":"ExampleAction"}}],"conversations":{"ExampleAction":{"name":"ExampleAction","url":"https://www.example.com/ExampleAction"}}}
إنشاء ردّ تلقائي على الويب لتنفيذ الطلبات ونشره
عند استدعاء إجراء في مشروعك، تستدعي "المهام على Google"
التنفيذ لبدء محادثة مع المستخدمين لتنفيذ الإجراء.
في كل طلب للردّ التلقائي على الويب الخاص بالتنفيذ، ستتلقّى البيانات التي أدخلها المستخدم على أنّها
سلسلة نصية. لمعالجة الهدف، يتم عادةً تحليل إدخال النص
وإرجاع رد. ويحدث هذا التبادل المتبادل حتى يتم
تنتهي المحادثة.
تحميل حزمة الإجراءات
بعد إنشاء حزمة الإجراءات ونشر تنفيذها،
يمكنك تحميل حزمة الإجراءات إلى وحدة تحكّم المهام. وحدة تحكم الإجراءات
تستخدم مشاريع الإجراءات لتجميع "المهام القائمة على المحادثة" مع بيانات وصفية مثل مراجعتها.
الحالة والاسم المعروض في دليل مساعد Google. يتيح لك المشروع أيضًا
تحديد البيانات الوصفية حول الإجراء الخاص بك وإدارة وتتبع الإجراء من خلال
عملية الموافقة.
بعد الانتهاء من إنشاء المشروع، يمكنك تحميل حزمة الإجراءات التي تحدّد جميع
إجراءاتك باستخدام واجهة سطر الأوامر gactions.
إرسال مشروعك للموافقة عليه وجعله متاحًا للمستخدمين
تاريخ التعديل الأخير: 2025-07-24 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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"]],["تاريخ التعديل الأخير: 2025-07-24 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eActions on Google allows you to build custom Actions, extending Google Assistant's functionality through conversational interfaces for various tasks.\u003c/p\u003e\n"],["\u003cp\u003eThe Actions SDK offers a way to develop these Actions, requiring you to define intents, fulfillment logic, and query patterns within an Action package.\u003c/p\u003e\n"],["\u003cp\u003eWhile the Actions SDK is available, using Dialogflow is strongly recommended for a more streamlined development experience, especially for handling natural language understanding (NLU).\u003c/p\u003e\n"],["\u003cp\u003eOnce your Action package and fulfillment are set up, they can be uploaded and managed through the Actions console before submitting for review and release to users.\u003c/p\u003e\n"]]],["Actions on Google utilizes *Actions* to extend Google Assistant's functionality. Developers use the Actions SDK and the `gactions` CLI to create *Action packages*, which map user *intents* to *fulfillments*. Intents, triggered by user phrases, define conversation entry points. Fulfillment then processes the intent. Developers build and deploy fulfillment webhooks to process user input and respond accordingly. The *Action package* is uploaded to the Actions console, which helps manage and approve the Action.\n"],null,["# Actions SDK overview (Dialogflow)\n\nActions on Google lets you extend the functionality of Google Assistant with\n***Actions***. Actions let users get things done through a conversational interface\nthat can range from a quick command to turn on some lights or a longer\nconversation, such as playing a trivia game.\n\nThe Actions SDK is a method of developing conversation fulfillment without\nusing Dialogflow. When using the Actions SDK, you use an Action package to\nmap intents to their fulfillment. You must also provide query patterns in the\nAction package in order to define example phrases your users might say.\n| **Caution:** Using the Actions SDK requires you to build or provide your own NLU solution. Although both Dialogflow and the Actions SDK are covered in the custom Actions documentation, we **highly** recommend using Dialogflow. The development experience changes significantly for Conversational Actions depending on what you use for conversation fulfillment.\n\ngactions CLI\n------------\n\nWhen developing with the Actions SDK, you use the `gactions` command line\ninterface (CLI) to test and update your Actions project. The [`gactions` CLI](/assistant/df-asdk/actions-sdk/gactions-cli)\nalso helps you create and manage the Action package for your Conversational Action.\n\nCreate Actions in your Action package\n-------------------------------------\n\nYou create Actions in your Action package by mapping intents to fulfillment.\nAn Action defines an entry point to start conversations with a unique\nidentifier called an *intent*. Intents map to fulfillments, which process the\nintent.\n\nFor example, say you wanted to build a project that contained Actions to\npurchase some goods, check the status of orders, and to show some daily deals.\nYou can define intents that are triggered by saying:\n\n- *\"Hey Google, talk to ExampleAction.\"*\n- *\"Hey Google, talk to ExampleAction to buy some shoes.\"*\n- *\"Hey Google, talk to ExampleAction to check on my order.\"*\n- *\"Hey Google, talk to ExampleAction to show me today's deals.\"*\n\nThe Action package JSON file might look something like this: \n\n {\n \"actions\": [\n {\n \"name\": \"MAIN\",\n \"intent\": {\n \"name\": \"actions.intent.MAIN\"\n },\n \"fulfillment\": {\n \"conversationName\": \"ExampleAction\"\n }\n },\n {\n \"name\": \"BUY\",\n \"intent\": {\n \"name\": \"com.example.ExampleAction.BUY\",\n \"parameters\": [{\n \"name\": \"color\",\n \"type\": \"org.schema.type.Color\"\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 \"fulfillment\": {\n \"conversationName\": \"ExampleAction\"\n }\n },\n {\n \"name\": \"ORDER_STATUS\",\n \"intent\": {\n \"name\": \"com.example.ExampleAction.ORDER_STATUS\",\n \"trigger\": {\n \"queryPatterns\": [\n \"check on my order\",\n \"see order updates\",\n \"check where my order is\"\n ]\n }\n },\n \"fulfillment\": {\n \"conversationName\": \"ExampleAction\"\n }\n },\n {\n \"name\": \"DAILY_DEALS\",\n \"intent\": {\n \"name\": \"com.example.ExampleAction.DAILY_DEALS\",\n \"trigger\": {\n \"queryPatterns\": [\n \"hear about daily deals\",\n \"buying some daily deals\",\n \"get today's deals\"\n ]\n }\n },\n \"fulfillment\": {\n \"conversationName\": \"ExampleAction\"\n }\n }\n ],\n \"conversations\": {\n \"ExampleAction\": {\n \"name\": \"ExampleAction\",\n \"url\": \"https://www.example.com/ExampleAction\"\n }\n }\n }\n\nBuild and deploy a fulfillment webhook\n--------------------------------------\n\nWhen an Action in your project is invoked, Actions on Google calls your\nfulfillment to start a conversation with users to fulfill the Action.\n\nIn every request to your fulfillment webhook, you receive the user input as a\ntext string. To process the intent, you typically parse the text input and\nreturn a response. This back and forth exchange happens until your Action's\nconversation ends.\n\nUpload your Action package\n--------------------------\n\nOnce you [create your Action package](/assistant/df-asdk/actions-sdk/define-actions) and [deploy its fulfillment](/assistant/df-asdk/deploy-fulfillment),\nyou can upload your Action package to the Actions console. The [Actions console](//console.actions.google.com/)\nuses Action projects to group your Conversational Action with metadata like its review\nstatus and display name in the Assistant directory. The project also lets you\ndefine metadata about your Action and manage and track your Action through the\napproval process.\n\nOnce you have a project, you can upload your Action package that defines all\nyour Actions using the [`gactions` CLI](/assistant/df-asdk/actions-sdk/gactions-cli).\n\nSubmit your project for approval and make it available to users\n---------------------------------------------------------------\n\nSamples\n-------\n\nTo explore completed projects, view the Node.js and Java [Actions SDK samples](/assistant/df-asdk/samples/github#actions-sdk)."]]