התכונה 'פעולות שיחה' הוצאה משימוש ב-13 ביוני 2023.
כאן תוכלו לקרוא מידע נוסף על ההוצאה משימוש של 'פעולות שיחה'.
סוגים
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
סוגים מאפשרים להגדיר את Assistant NLU (הבנת שפה טבעית)
לחילוץ נתונים מובְנים מפרטים של משתמשים. שלך
יכולים להשתמש בסוגים במצבים הבאים:
בכוונת רכישה, אפשר להוסיף הערות לביטויי אימון עם סוגים כדי
ליצור משבצות. כשמשתמשים אומרים משהו שתואם למיקום מסוים, המנוע של NLU
מחלצת אותו כפרמטר מוקלד כדי לעבד אותו בסצנה.
בשלב מילוי המשבצת של סצנה, אפשר לציין
כמה משבצות שאתם רוצים שהמשתמש יספק לפני שהוא
לעבור או לצאת מהסצנה.
בתוך שלב התנאים של סצנה, אפשר לבסס
הלוגיקה שקובעת אם לפרמטר יש ערך ספציפי שמוגדר בסוג.
סוגים בהתאמה אישית
סוגים מותאמים אישית מאפשרים לכם ליצור מפרט סוגים משלכם כדי להודיע ל-NLU
להקצות קבוצת ערכים למפתח יחיד. אפשר לציין סוגים שונים
דרכים:
- מילים ומילים נרדפות מאפשרות למפות כמה ערכים למפתח אחד,
שנקראים רשומה. הסוג יכול להכיל רשומה אחת או יותר. אם
לבחור באפשרות הזו, ניתן גם להפעיל את הגדרות NLU הבאות:
- הפעלת התאמה חלקית – התכונה הזו מאפשרת ערכים עם יותר מפריט אחד
להתאמה של המילים בהתאמה, גם כשהמילים נאמרות בסדר שונה.
- אישור ערכים לא ידועים – אם לא ניתן לציין את כל הערכים האפשריים, הפונקציה
שמעבד השפה יכול לקבל מילים או ביטויים לא ידועים על סמך הסביבה
נתונים של אימון קלט וכוונת רכישה, כמו פריטים שאפשר להוסיף לחנות מכולת
חדשה.
- ביטויים רגולריים מאפשרים לסוג להתאים ערכים באמצעות ביטוי רגולרי
ודפוסי ביטוי שמבוססים על
תקן RE2 של Google.
- טקסט חופשי מאפשר לסוג להתאים
כל מה שמשתמש אומר. הוספת הערות
Intent עם הסוג הזה מאפשר לכם לצרוך את כל הקלט כפרמטר
תוכלו לנתב את הנתונים ל-NLU שלכם.
סוגי מערכות
סוגי מערכות מאפשרים להוסיף הערות לנתונים ידועים ולחלץ אותם מקלט של משתמשים
באמצעות נתונים וערכים שסופקו על ידי המערכת. סוגי המערכות הבאים
נתמך:
סוג |
תיאור |
actions.type.DateTime |
כולל תאריך, שעה ואזור זמן על סמך הגדרות המכשיר של המשתמש.
זמין למילוי משבצות ולהערה על ביטוי לאימון.
|
actions.type.Date |
מכיל תאריך בלבד. זמין למילוי משבצות בלבד. |
actions.type.Time |
כולל זמן בלבד. זמין למילוי משבצות בלבד. |
actions.type.Number |
הסוג Number תואם לסדר ולקרדינל
. |
שימוש ב-DateTime
, ב-Date
וב-Time
הסוגים האלה מתנהגים באופן שונה בהתאם למקום שבו אתם משתמשים בסוג
קלט של משתמשים שתואם לסוג.
שימוש עם כוונות
הוספת הערות לביטויי אימון בכוונות תומכת רק בסוג DateTime
. משתמשים
הקלט לא צריך להתאים לערך שלם של DateTime
. לדוגמה, אם משתמש
מספק רק את השנה, פרמטר הסשן עשוי להיראות כך:
"date_time": {
"year": 2019
}
שימוש עם מילוי של יחידות קיבולת (Slot)
המילוי של יחידת הקיבולת (Slot) תומך ב-DateTime
, ב-Date
וב-Time
.
- אם סוג יחידת הקיבולת הוא
DateTime
, Assistant תבקש מהמשתמש
מצוין.
- אם סוג יחידת הקיבולת הוא
Date
, Assistant תשלח למשתמש בקשה עד לתאריך
מצוין. כשהפרמטר שמתקבל נאסף,
DateTime
כשהשעה מוגדרת ל-00:00.
- אם סוג יחידת הקיבולת הוא
Time
, Assistant תשלח למשתמש בקשה עד לזמן מסוים
מצוין. לאחר האיסוף, הפרמטר שאתם מקבלים הוא
אובייקט DateTime
עם התאריך המוגדר לתאריך הנוכחי.
לדוגמה, נניח שמשתמש בתל אביב אמר, "Hey Google, create a תזכורות"
ל-15 בינואר 2024 בשעה 20:00." כשמתבצעת חילוץ של 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 האובייקט אינו מספר או מחרוזת.
שינויים בסוגי זמן הריצה
שינויים בסוגי זמן הריצה מאפשרים ליצור או לשנות באופן דינמי סוגים של
תכונה זו מאפשרת לך להוסיף למפרט של סוג או להחליף אותו ב
בסביבת זמן ריצה. לדוגמה, אפשר לבדוק מקור נתונים של קצה עורפי כדי לטעון את התפריט היומי
לסוג של מילוי ההזמנות.
מידע נוסף זמין במדריך בנושא תגובה לפעולה מאתר אחר (webhook)
שמסבירה איך ליצור שינויים מברירת המחדל של סוגים.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[[["התוכן קל להבנה","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-26 (שעון UTC)."],[[["\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\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\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\nUsing 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\nUsing 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\nUsing 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\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."]]