با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
کنشهای مکالمه به شما امکان میدهد دستیار Google را با رابطهای مکالمه خود گسترش دهید که به کاربران امکان دسترسی به محصولات و خدمات شما را میدهد. اقدامات از موتور قدرتمند درک زبان طبیعی (NLU) Assistant برای پردازش و درک ورودی زبان طبیعی و انجام وظایف بر اساس آن ورودی استفاده می کند.
بررسی اجمالی
یک کنش مکالمه یک شی ساده است که یک نقطه ورود (به عنوان فراخوان) در یک مکالمه تعریف می کند:
یک فراخوان مشخص میکند که کاربران چگونه به «دستیار» میگویند که میخواهند یک مکالمه را با یکی از «کنشهای» شما شروع کنند. فراخوانی یک Action با یک هدف واحد تعریف میشود که وقتی کاربران درخواست Action را میکنند مطابقت مییابد.
یک مکالمه نحوه تعامل کاربران با یک Action را پس از فراخوانی تعریف میکند. شما مکالمات را با هدف ها ، انواع ، صحنه ها و درخواست ها می سازید.
علاوه بر این، Actions شما میتواند کار اضافی را به انجام محول کند، که سرویسهای وب هستند که از طریق webhooks با Actions شما ارتباط برقرار میکنند. این به شما امکان می دهد اعتبار سنجی داده ها را انجام دهید، با سایر خدمات وب تماس بگیرید، منطق تجاری را انجام دهید و موارد دیگر.
شما یک یا چند اکشن را بر اساس موارد استفاده که برای کاربرانتان مهم است، در یک ظرف منطقی به نام پروژه اکشن با هم ترکیب میکنید. پروژه Actions شما شامل کل مدل فراخوانی شما (مجموعه همه فراخوانهای شما) است که به کاربران اجازه میدهد از مکانهای منطقی در مدل مکالمه شما شروع کنند (همه چیزهایی که کاربران میتوانند بگویند و همه راههای ممکن که شما به کاربران پاسخ میدهید).
شکل 1 . مجموعه ای از کنش ها که به عنوان نقاط ورود به مدل مکالمه عمل می کنند. اهدافی که برای فراخوانی واجد شرایط هستند، جهانی در نظر گرفته می شوند.
فراخوانی
Invocation با نام نمایشی مرتبط است که نشاندهنده یک نام تجاری، نام یا شخصیت است که به کاربران اجازه میدهد از Assistant بخواهند تا Actions شما را فراخوانی کند. کاربران می توانند از این نام نمایشی به تنهایی (به نام فراخوان اصلی) یا در ترکیب با عبارات پیوندی اختیاری و عمیق برای فراخوانی اقدامات شما استفاده کنند.
به عنوان مثال، کاربران می توانند عبارات زیر را برای فراخوانی سه اقدام جداگانه در یک پروژه با نام نمایشی "Facts about Google" بیان کنند:
"Ok Google، با حقایق در مورد Google صحبت کنید"
"Ok Google, با Facts about Google صحبت کنید تا حقایق شرکت را دریافت کنید"
"Ok Google, با Facts about Google صحبت کنید تا حقایق تاریخ را دریافت کنید"
اولین فراخوانی در مثال فراخوان اصلی است. این فراخوانی با هدف سیستم خاصی به نام actions.intent.MAIN مرتبط است. فراخوان دوم و سوم، فراخوانی های پیوند عمیق هستند که به شما امکان می دهند عبارات دیگری را مشخص کنید که به کاربران امکان می دهد عملکرد خاصی را درخواست کنند. این فراخوان ها با اهداف کاربر مطابقت دارد که شما به عنوان جهانی تعیین کرده اید. هر فراخوانی در این مثال یک نقطه ورود به یک مکالمه را ارائه میکند و با یک Action مطابقت دارد.
شکل 2 . نمونه ای از فراخوان اصلی
شکل 2 یک جریان فراخوانی اصلی معمولی را توصیف می کند:
هنگامی که کاربران یک اقدام را درخواست می کنند، معمولاً آن را با نام نمایشی شما از Assistant درخواست می کنند.
دستیار درخواست کاربر را با هدف مربوطه مطابق با درخواست مطابقت می دهد. در این مورد، actions.intent.MAIN خواهد بود.
Action از مطابقت قصد مطلع می شود و با درخواست مربوطه برای شروع مکالمه با کاربر پاسخ می دهد.
گفتگو
مکالمه نحوه تعامل کاربران با یک Action را پس از فراخوانی تعریف میکند. شما این تعاملات را با تعریف ورودی معتبر کاربر برای مکالمه خود، منطق پردازش آن ورودی، و درخواست های مربوطه برای پاسخ دادن به کاربر ایجاد می کنید. شکل و توضیح زیر به شما نشان میدهد که چگونه یک نوبت مکالمه معمولی با اجزای سطح پایین یک مکالمه کار میکند: مقاصد ، انواع ، صحنهها و درخواستها .
شکل 3 . نمونه ای از گفتگو
شکل 3 یک چرخش مکالمه معمولی را شرح می دهد:
وقتی کاربران چیزی می گویند، Assistant NLU ورودی را با یک هدف مناسب مطابقت می دهد. یک intent در صورتی مطابقت داده می شود که مدل زبان برای آن intent بتواند دقیقاً یا دقیقاً با ورودی کاربر مطابقت داشته باشد. شما مدل زبان را با مشخص کردن عبارات آموزشی ، یا نمونه هایی از چیزهایی که کاربران ممکن است بخواهند بگویند، تعریف می کنید. Assistant این عبارات آموزشی را می گیرد و آنها را برای ایجاد مدل زبان قصد توسعه می دهد.
هنگامی که Assistant NLU با یک intent مطابقت دارد، می تواند پارامترهای مورد نیاز شما را از ورودی استخراج کند. این پارامترها دارای انواع مرتبط با آنها هستند، مانند تاریخ یا شماره. شما قسمت های خاصی از عبارات آموزشی یک intent را حاشیه نویسی می کنید تا مشخص کنید چه پارامترهایی را می خواهید استخراج کنید.
سپس یک صحنه ، هدف منطبق را پردازش می کند. میتوانید صحنهها را بهعنوان مجریان منطق یک Action، انجام کارهای سنگین و اجرای منطق لازم برای پیشبرد مکالمه در نظر بگیرید. صحنهها در یک حلقه اجرا میشوند و یک چرخه اجرایی انعطافپذیر ارائه میدهند که به شما امکان میدهد کارهایی مانند اعتبارسنجی پارامترهای هدف، انجام پر کردن اسلات، ارسال درخواستها به کاربر و موارد دیگر را انجام دهید.
هنگامی که اجرای یک صحنه تمام می شود، معمولاً یک درخواست برای ادامه گفتگو به کاربران ارسال می کند یا در صورت لزوم می تواند مکالمه را پایان دهد.
تحقق
در حین فراخوانی یا مکالمه، Action شما میتواند وب هوکی را راهاندازی کند که به یک سرویس تکمیل برای انجام برخی کارها اطلاع میدهد.
شکل 4 . نمونه ای از گفتگو
شکل 4 توضیح می دهد که چگونه می توانید از تکمیل برای ایجاد اعلان ها استفاده کنید، یک روش معمول برای استفاده از انجام:
در نقاط خاصی از اجرای Action شما، میتواند وب هوکی را راهاندازی کند که درخواستی را با یک بار JSON به یک کنترلکننده وبهوک ثبتشده (سرویس انجام شما) ارسال میکند.
انجام شما درخواست را پردازش می کند، مانند فراخوانی یک REST API برای انجام برخی جستجوی داده ها یا اعتبارسنجی برخی از داده ها از بار JSON. یک روش بسیار متداول برای استفاده از تکمیل، ایجاد یک درخواست پویا در زمان اجرا است تا مکالمات شما بیشتر برای کاربر فعلی تنظیم شود.
انجام شما پاسخی را به Action شما برمیگرداند که حاوی بار JSON است. می تواند از داده های بارگیری برای ادامه اجرای خود استفاده کند و به کاربر پاسخ دهد.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eConversational Actions extend Google Assistant, letting you create conversational interfaces for your services using natural language understanding.\u003c/p\u003e\n"],["\u003cp\u003eActions are invoked by users through specific phrases, triggering a conversation flow defined by intents, types, scenes, and prompts.\u003c/p\u003e\n"],["\u003cp\u003eFulfillment webhooks can be used to enhance Actions by validating data, calling external services, and generating dynamic prompts during conversations.\u003c/p\u003e\n"],["\u003cp\u003eActions are grouped within an Actions project which manages the invocation model and overall conversation flow.\u003c/p\u003e\n"]]],["Conversational Actions enable interactions with Google Assistant via natural language. Users initiate these interactions through **invocations**, using a display name or deep links. **Conversations** follow, where Assistant's NLU matches user input to **intents**, extracting **parameters**. **Scenes** then process these intents, executing logic and sending **prompts**. **Fulfillment** services handle tasks like data validation or dynamic prompt generation through webhooks, allowing actions to interact with web services and tailor responses. An **Actions project** bundles actions together.\n"],null,["# Conversational Actions let you extend Google Assistant with your own\nconversational interfaces that give users access to your products and\nservices. Actions leverage Assistant's powerful natural language\nunderstanding (NLU) engine to process and understand natural language input\nand carry out tasks based on that input.\n\nOverview\n--------\n\nA Conversational Action is a simple object that defines an\nentry point (referred to as invocation) into a conversation:\n\n- An **invocation** defines how users tell Assistant they want to start a conversation with one of your Actions. An Action's invocation is defined by a single [intent](/assistant/conversational/intents) that gets matched when users request the Action.\n- A **conversation** defines how users interact with an Action after it's invoked. You build conversations with [intents](/assistant/conversational/intents), [types](/assistant/conversational/types), [scenes](/assistant/conversational/scenes), and [prompts](/assistant/conversational/prompts).\n- In addition, your Actions can delegate extra work to **fulfillment**, which are web services that communicate with your Actions via webhooks. This lets you do data validation, call other web services, carry out business logic, and more.\n\nYou bundle one or many Actions together, based on the use cases that are\nimportant for your users, into a logical container called an Actions project.\nYour Actions project contains your entire invocation model (the collection of\nall your invocations), which lets users start at logical places in your\nconversation model (all the possible things users can say and all the possible\nways you respond back to users).\n**Figure 1** . A collection of Actions that serve as entry points into a conversation model. Intents that are eligible for invocation are considered to be *global*.\n\nInvocation\n----------\n\nInvocation is associated with a **display name** that represents a brand,\nname, or persona that lets users ask Assistant to invoke your Actions.\nUsers can use this display name on its own (called the main invocation) or in\ncombination with optional, **deep link** phrases to invoke your Actions.\n\nFor example, users can say the following phrases to invoke three separate\nActions in an project with a display name of \"Facts about Google\":\n\n- *\"Ok Google, talk to Facts about Google\"*\n- *\"Ok Google, talk to Facts about Google to get company facts\"*\n- *\"Ok Google, talk to Facts about Google to get history facts\"*\n\nThe first invocation in the example is the **main invocation** . This\ninvocation is associated with a special system intent named\n`actions.intent.MAIN`. The second and third invocations are deep link\ninvocations that let you specify additional phrases that let users ask for\nspecific functionality. These invocations correspond to user intents that you\ndesignated as global. Each invocation in this example provides an entry point\ninto a conversation and corresponds to a single Action.\n**Figure 2**. Example of main invocation\n\nFigure 2 describes a typical main invocation flow:\n\n1. When users request an Action, they typically ask Assistant for it by your display name.\n2. Assistant matches the user's request with the corresponding intent that matches the request. In this case, it would be `actions.intent.MAIN`.\n3. The Action is notified of the intent match and responds with the corresponding prompt to start a conversation with the user.\n\nConversation\n------------\n\nConversation defines how users interact with an Action after it's invoked. You\nbuild these interactions by defining the valid user input for your\nconversation, the logic to process that input, and the corresponding prompts\nto respond back to the user with. The following figure and explanation shows\nyou how a typical conversation turn works with a conversation's low level\ncomponents: [intents](/assistant/conversational/intents), [types](/assistant/conversational/types), [scenes](/assistant/conversational/scenes), and\n[prompts](/assistant/conversational/prompts).\n**Figure 3**. Example of a conversation\n\nFigure 3 describes a typical conversation turn:\n\n1. When users say something, the Assistant NLU matches the input to an appropriate intent. An intent is matched if the *language model* for that intent can closely or exactly match the user input. You define the language model by specifying *training phrases*, or examples of things users might want to say. Assistant takes these training phrases and expands upon them to create the intent's language model.\n2. When the Assistant NLU matches an intent, it can extract *parameters* that you need from the input. These parameters have *types* associated with them, such as a date or number. You annotate specific parts of an intent's training phrases to specify what parameters you want to extract.\n3. A *scene* then processes the matched intent. You can think of scenes as the logic executors of an Action, doing the heavy lifting and carrying out logic necessary to drive a conversation forward. Scenes run in a loop, providing a flexible execution lifecycle that lets you do things like validate intent parameters, do slot filling, send prompts back to the user, and more.\n4. When a scene is done executing, it typically sends a prompt back to users to continue the conversation or can end the conversation if appropriate.\n\nFulfillment\n-----------\n\nDuring invocation or a conversation, your Action can trigger a webhook that\nnotifies a fulfillment service to carry out some tasks.\n**Figure 4**. Example of a conversation\n\nFigure 4 describes how you can use fulfillment to generate prompts, a common\nway to use fulfillment:\n\n1. At specific points of your Action's execution, it can trigger a webhook that sends a request to a registered webhook handler (your fulfillment service) with a JSON payload.\n2. Your fulfillment processes the request, such as calling a REST API to do some data lookup or validating some data from the JSON payload. A very common way to use fulfillment is to generate a dynamic prompt at runtime so your conversations are more tailored to the current user.\n3. Your fulfillment returns a response back to your Action containing a JSON payload. It can use the data from the payload to continue it's execution and respond back to the user."]]