تم إيقاف إجراءات المحادثات نهائيًا في 13 حزيران (يونيو) 2023. لمزيد من المعلومات، يُرجى الاطّلاع على
إنهاء إجراءات المحادثة.
الأنواع
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تتيح لك "الأنواع" ضبط "NLU" في "مساعد Google" (فهم اللغة الطبيعية).
لاستخراج البيانات المنظَّمة من البيانات التي أدخلها المستخدم إِنْتَ
استخدام الأنواع في المواقف التالية:
في الأهداف، يمكنك إضافة تعليقات توضيحية إلى عبارات التدريب مع تحديد أنواع
إنشاء الخانات. عندما يقول المستخدمون شيئًا يطابق خانة، فإن محرك NLU
على أنّها مَعلمة مكتوبة، لكي تتمكّن من معالجتها في مشهد.
ضمن مرحلة ملء الخانة في المشهد، يمكنك تحديد
خانات متعددة تريد أن يقدمها المستخدم قبل أن يتمكن من
الانتقال أو الخروج من المشهد.
ضمن مرحلة شروط المشهد، يمكنك تحديد
حول ما إذا كانت المعلمة لها قيمة معينة تم تحديدها في نوع ما.
أنواع مخصّصة
تتيح لك الأنواع المخصصة إنشاء مواصفات النوع الخاصة بك لإشعار NLU
وتعيين مجموعة من القيم لمفتاح واحد. يمكنك تحديد الأنواع في مجموعة متنوعة من
الطرق:
- تتيح لك الكلمات والمرادفات تعيين قيم متعددة لمفتاح واحد،
وهي ما تسمى الإدخال. ويمكن أن يحتوي النوع على إدخال واحد أو أكثر. إذا كنت
عبر تحديد هذا الخيار، يمكنك أيضًا تمكين إعدادات NLU التالية:
- تفعيل المطابقة غير الواضحة - تسمح هذه الميزة بإدخالات تحتوي على أكثر من عنصر.
الكلمة التي ستتم مطابقتها، حتى عندما يتم قول الكلمات بترتيب مختلف.
- قبول القيم غير المعروفة - عندما لا يمكنك تحديد جميع القيم المحتملة، يتم
يمكن لبرنامج معالجة اللغة قبول الكلمات أو العبارات غير المعروفة بناءً على البيئة المحيطة.
إدخال بيانات التدريب والنية، مثل العناصر التي يمكن إضافتها إلى متجر البقالة
الحالية.
- تسمح التعبيرات العادية للنوع بمطابقة القيم باستخدام العادي
أنماط تعبيرات بناءً على
معيار RE2 لدى Google
- يسمح نص بتصميم مرن للنوع أن يتطابق
أي شيء يقوله المستخدم. إضافة تعليقات توضيحية
حيث يتيح لك الغرض من هذا النوع استهلاك كل المدخلات كمعلمة
الممرات إلى NLU الخاص بك.
أنواع الأنظمة
تتيح لك أنواع الأنظمة إضافة تعليقات توضيحية إلى البيانات المعروفة واستخراجها من البيانات التي يُدخلها المستخدمون.
باستخدام بيانات وقيم التدريب الذي يوفره النظام. في ما يلي أنواع الأنظمة
مدعوم:
النوع |
الوصف |
actions.type.DateTime |
تحتوي على التاريخ والوقت والمنطقة الزمنية استنادًا إلى إعدادات جهاز المستخدم.
متاحة لملء التعليقات التوضيحية للعبارات التطبيقية والتدريب عليها.
|
actions.type.Date |
يحتوي على التاريخ فقط. متاحة لملء الخانات فقط. |
actions.type.Time |
يحتوي على الوقت فقط. متاحة لملء الخانات فقط. |
actions.type.Number |
يتطابق النوع Number مع الترتيبي الترتيبي والعلاقة الأساسية.
الأرقام. |
استخدام DateTime
وDate
وTime
وتعمل هذه الأنواع بشكل مختلف اعتمادًا على المكان الذي تستخدم فيه النوع
البيانات التي أدخلها المستخدِم والتي تتطابق مع النوع
الاستخدام بغرض تحقيق الغرض
يمكن إضافة تعليقات توضيحية على العبارات التدريبية في الأهداف إلى النوع DateTime
فقط. مستخدِم
لا يحتاج الإدخال إلى مطابقة قيمة DateTime
كاملة. على سبيل المثال، إذا كان لدى مستخدم
السنة فقط، فقد تبدو معلَمة الجلسة على النحو التالي:
"date_time": {
"year": 2019
}
الاستخدام مع ملء الخانات
تتوافق ميزة ملء الخانات مع DateTime
وDate
وTime
.
- إذا كان نوع الخانة هو
DateTime
، سيطلب "مساعد Google" من المستخدم حتى اكتمال
تقديم قيمة محددة.
- إذا كان نوع الخانة هو
Date
، سيطلب "مساعد Google" من المستخدم حتى موعد معيَّن.
تقديم قيمة محددة. عند جمع، تكون المعلمة التي تتلقاها كاملة
DateTime
مع ضبط الوقت على 00:00.
- إذا كان نوع الخانة هو "
Time
"، سيطلب "مساعد Google" من المستخدم الانتظار لبعض الوقت.
تقديم قيمة محددة. عند جمع، تكون المعلمة التي تتلقاها كاملة
عنصر DateTime
مع ضبط التاريخ على التاريخ الحالي.
على سبيل المثال، لنفترض أنّ مستخدمًا في شرم الشيخ قال: "Ok Google، أريد إنشاء تذكير".
بتاريخ 15 يناير 2024 الساعة 8 مساءً". عند استخراج DateTime
كجزء من خانة
، قد تبدو المعلمة الكاملة على النحو التالي:
"date_time": {
"day": 15,
"hours": 20,
"minutes": 0,
"month": 1,
"nanos": 0,
"seconds": 0,
"time_zone": {
"id": "America/Los_Angeles"
},
"year": 2024
}
الاستخدام مع الشروط
تسمح الشروط فقط باستخدام الأرقام والسلاسل، لذا فإن استخدام المستوى الأعلى
تنتج عن المعلمة DateTime
نتيجة False للشرط. بالنسبة
مثال:
$session.params.my_dateTime.day > 5
هو شرط صالح، لأن
القيمة day
هي رقم متاح.
- يُعد
$session.params.my_dateTime > "01-01-2010"
شرطًا غير صالح، لأن
المستوى الأعلى 'DateTime' الكائن ليس رقمًا أو سلسلة.
إلغاءات أنواع بيئة التشغيل
تتيح لك إلغاءات نوع بيئة التشغيل إنشاء الأنواع أو تعديلها ديناميكيًا في
التنفيذ. تتيح لك هذه الميزة إضافة مواصفات نوع أو استبدالها في
وقت التشغيل. على سبيل المثال، يمكنك التحقّق من مصدر بيانات خلفية لتحميل القائمة اليومية.
العناصر في نوع توصيلك.
يمكنك الاطّلاع على دليل الردّ التلقائي على الويب للحصول على مزيد من المعلومات.
حول كيفية إنشاء إلغاءات الأنواع.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eTypes are used to extract structured data from user input, allowing you to create slots in intents, manage slot filling within scenes, and define conditions based on parameter values.\u003c/p\u003e\n"],["\u003cp\u003eYou can create custom types using words and synonyms, regular expressions, or free-form text to define how the NLU interprets user input.\u003c/p\u003e\n"],["\u003cp\u003eSystem types such as \u003ccode\u003eDateTime\u003c/code\u003e, \u003ccode\u003eDate\u003c/code\u003e, \u003ccode\u003eTime\u003c/code\u003e, and \u003ccode\u003eNumber\u003c/code\u003e provide built-in data extraction for common data formats.\u003c/p\u003e\n"],["\u003cp\u003eRuntime type overrides enable dynamic modification of types during fulfillment, allowing you to adjust types based on real-time data.\u003c/p\u003e\n"]]],[],null,["# Types let you configure the Assistant NLU (natural language understanding)\nengine to extract structured data from user input. You\ncan use types in the following situations:\n\n- In [intents](/assistant/conversational/intents), you can annotate training phrases with types to\n create slots. When users say something that matches a slot, the NLU engine\n extracts it as a typed parameter, so you can process it in a [scene](/assistant/conversational/scenes).\n\n- Within a scene's [slot filling](/assistant/conversational/scenes#slot_filling) stage, you can specify\n multiple slots that you want the user to provide before they can\n transition or exit out of the scene.\n\n- Within a scene's [conditions](/assistant/conversational/scenes#conditions) stage, you can base\n logic on whether a parameter has a specific value that's defined in a type.\n\nCustom types\n------------\n\nCustom types let you create your own type specification to notify the NLU to\nassign a set of values to a single key. You can specify types in a variety of\nways:\n\n- **Words and synonyms** allow you to map multiple values to a single key, which are called an entry. Your type can contain one or many entries. If you choose this option, you can also enable the following NLU settings:\n - **Enable fuzzy matching** - This feature allows entries with more than one word to be matched, even when the words are spoken in a different order.\n - **Accept unknown values** - When you can't specify all possible values, the language processor can accept unknown words or phrases based on surrounding input and intent training data, such as items that might be added to a grocery list.\n- **Regular expressions** allows the type to match values using regular expression patterns based on [Google's RE2 standard](https://github.com/google/re2/wiki/Syntax).\n- **Free form text** allows the type to match anything a user says. Annotating an intent with this type lets you consume all input as a parameter that you can pipe to your own NLU.\n\nSystem types\n------------\n\nSystem types let you annotate and extract well-known data from user input\nusing system-provided training data and values. The following system types are\nsupported:\n\n| Type | Description |\n|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| **`actions.type.DateTime`** | Contains date, time, and timezone based on the user's device settings. Available for slot filling and training phrase annotation. |\n| **`actions.type.Date`** | Contains date only. Available for slot filling only. |\n| **`actions.type.Time`** | Contains time only. Available for slot filling only. |\n| **`actions.type.Number`** | The `Number` type matches ordinal and cardinal numbers. |\n\n### `DateTime`, `Date`, and `Time` usage\n\nThese types behave differently depending on where you use the type and the\nuser input that matches the type.\n\n#### Using with intents\n\nAnnotating training phrases in intents supports only the `DateTime` type. User\ninput doesn't need to match an entire `DateTime` value. For example, if a user\nprovides only the year, the session parameter might look like this: \n\n \"date_time\": {\n \"year\": 2019\n }\n\n#### Using with slot filling\n\nSlot filling supports `DateTime`, `Date`, and `Time`.\n\n- If the slot type is `DateTime`, the Assistant prompts the user until a full value is provided.\n- If the slot type is `Date`, the Assistant prompts the user until a date value is provided. When collected, the parameter you receive is a full `DateTime` with the time set to 00:00.\n- If the slot type is `Time`, the Assistant prompts the user until a time value is provided. When collected, the parameter your receive is a full `DateTime` object with the date set to the current date.\n\nFor example, suppose a user in Los Angeles said, \"Hey Google, create a reminder\nfor January 15, 2024 at 8 pm.\" When `DateTime` is extracted as part of a slot\nfilling process, the full parameter might look like this: \n\n \"date_time\": {\n \"day\": 15,\n \"hours\": 20,\n \"minutes\": 0,\n \"month\": 1,\n \"nanos\": 0,\n \"seconds\": 0,\n \"time_zone\": {\n \"id\": \"America/Los_Angeles\"\n },\n \"year\": 2024\n }\n\n#### Using with conditions\n\nConditions only allow the use of numbers and strings, so using the top level\n`DateTime` parameter results in a **False** result for the condition. For\nexample:\n\n- `$session.params.my_dateTime.day \u003e 5` is a valid condition, because the `day` value is a number and is supported.\n- `$session.params.my_dateTime \u003e \"01-01-2010\"` is an invalid condition, because the top level 'DateTime' object is not a number or string.\n\nRuntime type overrides\n----------------------\n\nRuntime type overrides let you dynamically create or modify types in\nfulfillment. This feature lets you add to or replace a type's specification at\nruntime. For example, you can check a backend data source to load daily menu\nitems into a type in your fulfillment.\n\nSee the [webhooks](/assistant/conversational/webhooks#runtime_type_overrides) guide for more information\non how to build type overrides."]]