نمای کلی اقدامات دستگاه
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
با Google Assistant SDK، میتوانید Google Assistant را در پروژه خود جاسازی کنید و عملکرد آن را مشابه Google Home کنید. با این حال، پروژه شما ممکن است قابلیتهای سختافزاری منحصربهفردی داشته باشد که Google Home ندارد: برای مثال، ممکن است یک صفحه نمایش LED منحصربهفرد با تنظیمات روشنایی و رنگ قابل تنظیم داشته باشد.
Device Actions مجموعهای از ابزارها و APIها هستند که به شما امکان میدهند کارهایی را که دستیار میتواند انجام دهد، در پروژههایی که توسعه میدهید، گسترش دهید تا از پتانسیل کامل تواناییهای سختافزاری آنها استفاده کنید.
اقدامات دستگاه داخلی
Google طیف گستردهای از عملکردهای داخلی معمولی دستگاه را برای چیزهای روزمره، از جمله چراغها، لوازم خانگی و دوربینها ایجاد کرده است. با این اقدامات، می توانید از قدرت پردازش زبان طبیعی Google Assistant برای کنترل پروژه خود استفاده کنید. به عنوان مثال، یک پروژه با چراغ را می توان به روش های مختلف روشن کرد:
- اوکی گوگل، چراغ را روشن کن.
- هی گوگل، چراغ من را روشن کن.
- Ok Google، چراغ اتاق نشیمن من را روشن کن.
شما می توانید پروژه خود را ایجاد کنید که به دستورات بسیاری پاسخ می دهدویژگی های خانه هوشمند مانند:
- Ok Google، روشنایی را روی 50٪ تنظیم کنید.
- سلام گوگل، دما را روی 98 درجه تنظیم کنید.
اقدامات سفارشی دستگاه
شما همچنین می توانید اقدامات سفارشی دستگاه را برای سخت افزار منحصر به فرد خود ایجاد کنید. برای این اقدامات، گرامر و دستورات را تعریف می کنید:
- اوکی گوگل، چراغ من 5 بار چشمک بزن.
- هی گوگل، به چپ حرکت کن.
درباره ترکیب این اقدامات با استفاده از سرویس دستیار Google بیشتر بیاموزید.
چگونه کار می کند
این دستگاه دارای Google Assistant SDK همراه با اعتبارنامه برای دسترسی به سرویس Google Assistant روی آن نصب شده است. دستگاه درخواست گفتاری ( روشن کردن. ) را ارسال می کند و از سرویس می خواهد که LED دستگاه را روشن کند. دستگاه همچنین شناسههای نمونه مدل و دستگاه خود را ارسال میکند تا سرویس بتواند نحوه بهترین پاسخ را در زمینه درخواست تعیین کند.
این سرویس از تشخیص خودکار گفتار (ASR) برای تعیین کلماتی که توسط کاربر گفته شده است، از پردازش زبان طبیعی (NLP) برای تجزیه و تحلیل و درک معنای درخواست از این کلمات و تطبیق دستگاه برای ارائه زمینه درخواست استفاده میکند. این زمینه مهم است زیرا اقداماتی را که دستگاه پشتیبانی می کند و چگونگی انجام این اقدامات را مشخص می کند.
سپس سرویس با متنی پاسخ میدهد که به کاربر گفته میشود ( مطمئناً. ) همراه با دستور مخصوص دستگاه. دستگاه می داند چگونه با این دستور کار کند: LED خود را روشن می کند!

شروع کنید
با تعبیه دستیار Google در پروژه خود و سپس افزودن عملکرد منحصر به فرد با Device Actions، ایده های خود را زنده کنید. می توانید پروژه خود را با استفاده از سرویس Google Assistant توسعه دهید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe Google Assistant SDK enables you to integrate the Google Assistant into your projects, similar to a Google Home, and leverage Device Actions to utilize unique hardware features.\u003c/p\u003e\n"],["\u003cp\u003eDevice Actions provide tools and APIs to extend the Assistant's capabilities, allowing your project to respond to voice commands for functionalities like lights, appliances, and cameras using built-in or custom actions.\u003c/p\u003e\n"],["\u003cp\u003eBuilt-in Device Actions cover common smart home features, while Custom Device Actions let you define unique voice commands and functionalities tailored to your specific hardware.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Assistant service utilizes Automatic Speech Recognition, Natural Language Processing, and device context to understand user requests and trigger corresponding actions on your device.\u003c/p\u003e\n"],["\u003cp\u003eYou can get started by embedding the Google Assistant into your project and adding custom functionalities with Device Actions using the provided resources and guides.\u003c/p\u003e\n"]]],[],null,["# Device Actions Overview\n\nWith the Google Assistant SDK, you can embed the Google Assistant into your\nown project, making it function similarly to a Google Home. However, your project\nmay have unique hardware capabilities that Google Home does not have: for\nexample, it may have a unique LED display with customizable brightness and\ncolor settings.\n\nDevice Actions are a set of tools and APIs that allow you to extend what\nthe Assistant can do, in the projects you develop, to take full potential of\ntheir hardware capabilities.\n\nBuilt-in Device Actions\n-----------------------\n\nGoogle has created a wide range of common built-in device actions for everyday\nthings, including lights, appliances, and cameras. With these actions, you can\nharness the power of the Google Assistant's natural language processing to\ncontrol your project. For example, a project with a light can be turned on in\ndifferent ways:\n\n- *Ok Google, turn on the light.*\n- *Hey Google, turn my light on.*\n- *Ok Google, turn on my living room light.*\n\nYou can create your own project that responds to commands for\nmany\n[smart home traits](/assistant/sdk/reference/traits)\nlike:\n\n- *Ok Google, set the brightness to 50%.*\n- *Hey Google, set the temperature to 98 degrees.*\n\nCustom Device Actions\n---------------------\n\nYou can also create custom device actions for your own unique hardware. For these\nactions, you define the grammar and commands:\n\n- *Ok Google, blink my light 5 times.*\n- *Hey Google, move left.*\n\nLearn more about incorporating these actions using the [Google Assistant service](/assistant/sdk/guides/service/python/extend/custom-actions).\n\nHow it works\n------------\n\nThe device has the Google Assistant SDK installed on it along with credentials for\naccessing the Google Assistant Service. The device sends out the spoken request\n(*Turn on.*) and asks the service to turn on the device's onboard LED.\nThe device also sends its model and device instance identifiers so the service\ncan determine how to best respond in context to the request.\n\nThe service uses Automatic Speech Recognition (ASR) to determine what words were\nspoken by the user, Natural Language Processing (NLP) to analyze and understand\nthe meaning of the request from these words, and device matching to provide context\nfor the request. This context is important because it defines the actions the\ndevice supports and how these actions should be fulfilled.\n\nThe service then responds with text that is spoken back to the user (*Sure.*)\nalong with the device-specific command. The device knows how to handle this\ncommand: it turns on its LED!\n\nGet started\n-----------\n\nBring your ideas to life by embedding the Google Assistant\ninto your project and then adding unique functionality with Device\nActions. You can develop your project [using the Google Assistant service](/assistant/sdk/guides/service/python)."]]