تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
في هذه المرحلة، تكون جاهزًا لتشغيل العينة وإجراء استعلام.
في الأمر التالي:
استبدال my-dev-project بـ
رقم تعريف مشروع Google Cloud Platform لمشروع وحدة تحكّم المهام الذي
إنشاء. للعثور على رقم تعريف المشروع في وحدة تحكّم المهام،
حدد المشروع، وانقر على رمز الترس، ثم حدد إعدادات المشروع.
استبدل my-model باسم النموذج الذي تستخدمه
الذي تم إنشاؤه في الخطوة السابقة.
(اختياري) استبدِل device-nickname بلقب.
للجهاز. استبدِل text-query بطلب البحث الذي تريده.
أن يجيب "مساعد Google" تلقائيًا بمجرد بدئه.
لتغيير لغة "مساعد Google" أو لتفعيل النتائج الشخصية،
استخدام تطبيق "مساعد Google"
إذا كان لديك جهاز يعمل بتكنولوجيا Google Cast ومتصل بالشبكة نفسها وتم ضبط إعداداته
باستخدام حساب المستخدم نفسه، يمكنك التحكم في ذلك عن بُعد:
Ok Google، أريد تشغيل Spotify على مكبّر صوت المطبخ.
لبث رسالة صوتية، تأكَّد أولاً من ضبط الموقع الجغرافي للجهاز في
تطبيق "مساعد Google"
بعد ذلك، جرِّب ما يلي:
Ok Google، أريد بثّ تسجيلات "تعال لتناول العشاء".
العثور على رقم تعريف مثيل الجهاز
عند تشغيل العيّنة للمرة الأولى، سيتم إنشاء مثيل جهاز
جهازك المحدد. سيتم ربط مثيل الجهاز هذا بالجهاز.
الذي حددته لتشغيل العينة. يمكنك أيضًا إنشاء المثيل
بنفسك باستخدام أداة التسجيل.
يحفظ النموذج رقم تعريف مثيل الجهاز. إذا شغّلت العينة بنفس
طراز الجهاز، يتم ضبطه تلقائيًا على استخدام رقم تعريف مثيل الجهاز المحفوظ.
ابحث عن رقم تعريف مثيل الجهاز في وحدة التحكّم للعيّنة.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThe Google Assistant Library for Python is deprecated; use the Google Assistant Service instead.\u003c/p\u003e\n"],["\u003cp\u003eTo run the sample, replace placeholders with your project ID, model name, and optional nickname/query.\u003c/p\u003e\n"],["\u003cp\u003eYou can interact with the Assistant using voice commands for tasks like playing music, broadcasting messages, and getting information.\u003c/p\u003e\n"],["\u003cp\u003eThe sample generates a device instance ID, which can be found in the console output.\u003c/p\u003e\n"],["\u003cp\u003eAfter setup, you can explore next steps like extending functionality and creating Device Actions.\u003c/p\u003e\n"]]],["The Google Assistant sample can be run using the command `googlesamples-assistant-hotword` with specified project ID and device model. The Assistant can be activated by saying \"Ok Google\" or \"Hey Google\" and posing a query. The sample generates a unique device instance ID, saved for future use with the same model ID. The Assistant can interact with Cast-enabled devices and broadcast messages, after setup in the Google Assistant app. Further customization, and Device Actions, can be implemented.\n"],null,["# Run the Sample Code\n\n| **Warning:** The Google Assistant Library for Python is deprecated as of June 28th, 2019. Use the [Google Assistant Service](/assistant/sdk/guides/service/python) instead.\n\n\u003cbr /\u003e\n\nAt this point, you are ready to run the sample and make a query.\n\nIn the following command:\n\n- Replace \u003cvar translate=\"no\"\u003emy-dev-project\u003c/var\u003e with\n the Google Cloud Platform project ID for the Actions Console project you\n created. To find the project ID in the [Actions Console](https://console.actions.google.com/),\n select the project, click the gear icon, and select **Project settings**.\n\n- Replace \u003cvar translate=\"no\"\u003emy-model\u003c/var\u003e with the name of the model you\n created in the previous [step](/assistant/sdk/guides/library/python/embed/register-device).\n\n- (Optional) Replace \u003cvar translate=\"no\"\u003edevice-nickname\u003c/var\u003e with a nickname\n for the device. Replace \u003cvar translate=\"no\"\u003etext-query\u003c/var\u003e with a query you want\n the Assistant to automatically answer once it has started.\n\n```\ngooglesamples-assistant-hotword --project-id my-dev-project --device-model-id my-model [--nickname device-nickname] [--query text-query]\n```\n\nSay *Ok Google* or *Hey Google*, followed by your query. You can try some of the\nfollowing:\n\n- *Who am I?*\n- *Listen to This American Life podcast.*\n- *What is the weather in San Francisco?*\n\nIf the Assistant does not respond, follow the [troubleshooting instructions](/assistant/sdk/guides/library/troubleshooting#hotword).\n\nTo change the language for the Google Assistant or to enable personal results,\nuse the Google Assistant [app](/assistant/sdk/reference/assistant-app/assistant-settings).\n\nIf you have a [Cast-enabled](/cast) device on the same network and configured\nwith the same user account, you can control it remotely:\n\n- *Ok Google, play Spotify on the Kitchen Speaker*.\n\nTo broadcast a voice message, make sure to first set the device location in the\nGoogle Assistant [app](/assistant/sdk/reference/assistant-app/assistant-settings).\nThen try the following:\n\n- *Ok Google, broadcast Come to dinner*.\n\nFind the device instance ID\n---------------------------\n\nWhen you run the sample the first time, it will generate a device instance for\nyour particular device. This device instance will be associated with the device\nmodel that you specified to run the sample. You can also create the instance\nyourself using the [registration tool](/assistant/sdk/reference/device-registration/device-tool#register-device).\n\nThe sample saves the device instance ID. If you run the sample with the same\nmodel ID, it defaults to using the saved device instance ID.\n\nFind the device instance ID in the console for the sample. \n\n device_model_id: my-model\n device_id: 1C3E1558B0023E49F71CA0D241DA03CF # Device instance ID\n\n Registering...Done.\n\n ON_MUTED_CHANGED:\n {'is_muted': False}\n ON_START_FINISHED\n ...\n\nNext step\n---------\n\nNow that you have the Google Assistant working on your device, it is time to\nextend it. You can take a look at some possible next steps [here](/assistant/sdk/guides/library/python/embed/next-steps)\nor continue on to creating [Device Actions](/assistant/sdk/guides/library/python/extend/install-hardware)."]]