Types
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Türler, Asistan NLU'yu (doğal dil anlama) yapılandırmanıza olanak tanır
yapılandırılmış veri ayıklamak için kullanır. Siz
türleri aşağıdaki durumlarda kullanabilir:
Nintenlerde, eğitim ifadelerine çeşitli türlerle ek açıklama
zaman aralığı oluşturabilirsiniz. Kullanıcılar bir yuvayla eşleşen bir şey söylediklerinde NLU motoru
değeri, yazılan bir parametre olarak ayıklar. Böylece, bir sahnede işleyebilirsiniz.
Bir sahnenin alan doldurma aşamasında, belirli bir sayfada
kullanıcıya eklemeden önce sağlamasını istediğiniz birden çok alan
sahneden ayrılabilir.
Bir sahnenin koşulları aşamasında,
bir parametrenin bir türde tanımlanmış belirli bir değere sahip olup olmadığıyla ilgili mantık.
Özel türler
Özel türler, NLU'nun şunları yapması için kendi tür belirtinizi oluşturmanıza olanak tanır:
tek bir anahtara bir dizi değer atayın. Çeşitli türler arasından
yöntemler:
- Kelimeler ve eş anlamlılar, tek bir anahtara birden çok değer eşlemenize olanak tanır.
Bunlara giriş adı verilir. Türünüz bir veya daha fazla giriş içerebilir. Şu durumda:
aşağıdaki NLU ayarlarını da etkinleştirebilirsiniz:
- Kesintili eşlemeyi etkinleştir: Bu özellik, birden fazla öğe içeren girişlere izin verir.
farklı bir sırayla söylense bile eşleştirilmesi için gereken bazı
- Bilinmeyen değerleri kabul et: Olası tüm değerleri belirtemediğinizde
dil işlemcisi, çevresine dayalı olarak bilinmeyen kelimeleri veya kelime öbeklerini kabul edebilir
markete eklenebilecek öğeler gibi giriş ve amaç eğitimi verileri
liste'ye dokunun.
- Normal ifadeler, türün normal ifadeler kullanarak değerleri eşleştirmesine olanak tanır.
ifade kalıplarının
Google'ın RE2 standardı.
- Serbest biçimli metin, türün eşleşmesini sağlar
bir ifadedir. Not/çizim ekleniyor
bu tür bir intent, girdiğiniz tüm girişleri bir parametre olarak
kendi NLU'nuza bağlantı oluşturabilirsiniz.
Sistem türleri
Sistem türleri, kullanıcı girişinden iyi bilinen verilere not eklemenize ve bunları ayıklamanıza olanak tanır.
verileri ve değerleri kullanır. Aşağıdaki sistem türleri şunlardır:
desteklenir:
Tür |
Açıklama |
actions.type.DateTime |
Kullanıcının cihaz ayarlarına dayalı olarak tarih, saat ve saat dilimi içerir.
Boşluk doldurma ve eğitim ifadesi ek açıklaması için kullanılabilir.
|
actions.type.Date |
Yalnızca tarih içerir. Yalnızca boşluk doldurmak için kullanılabilir. |
actions.type.Time |
Yalnızca zaman içerir. Yalnızca boşluk doldurmak için kullanılabilir. |
actions.type.Number |
Number türü, sıra ve kardinal ile eşleşir
numaraları'na dokunun. |
DateTime
, Date
ve Time
kullanımı
Bu türler, türü kullandığınız yere ve
Türle eşleşen kullanıcı girişi.
Amaçlarla kullanma
Amaçlardaki eğitim ifadelerine ek açıklama eklemek yalnızca DateTime
türünü destekler. Kullanıcı
girişin tam DateTime
değeriyle eşleşmesi gerekmez. Örneğin, bir kullanıcı
yalnızca yıl sağlarsa, oturum parametresi şöyle görünebilir:
"date_time": {
"year": 2019
}
Boşluk doldurmayla kullanma
Slot doldurma DateTime
, Date
ve Time
özelliklerini destekler.
- Zaman aralığı türü
DateTime
ise Asistan, dolana kadar kullanıcıdan seçim yapmasını ister.
değeri sağlanır.
- Zaman aralığı türü
Date
ise Asistan, bir tarihe kadar kullanıcıdan seçim yapmasını ister.
değeri sağlanır. Toplandığında, aldığınız parametre tam bir parametredir
Saat 00:00 olarak ayarlanmış DateTime
.
- Zaman aralığı türü
Time
ise Asistan, belirli bir zamana kadar kullanıcıdan seçim yapmasını ister.
değeri sağlanır. Toplandığında, alma ayarınız tam bir parametredir
Tarihi geçerli tarihe ayarlanmış DateTime
nesnesi.
Örneğin, Los Angeles'taki bir kullanıcının "Ok Google, hatırlatıcı oluştur" dediğini varsayalım
15 Ocak 2024 saat 20:00'de başlatılacak." DateTime
, bir alanın parçası olarak çıkarıldığında
tam parametre aşağıdaki gibi görünebilir:
"date_time": {
"day": 15,
"hours": 20,
"minutes": 0,
"month": 1,
"nanos": 0,
"seconds": 0,
"time_zone": {
"id": "America/Los_Angeles"
},
"year": 2024
}
Koşullarla birlikte kullanma
Koşullar yalnızca sayıların ve dizelerin kullanılmasına izin verir, bu nedenle üst düzey
DateTime
parametresi, koşul için False sonucunu verir. Örneğin:
$session.params.my_dateTime.day > 5
geçerli bir koşuldur çünkü
day
değeri bir sayıdır ve desteklenir.
$session.params.my_dateTime > "01-01-2010"
geçersiz bir koşuldur çünkü
üst düzey 'DateTime' nesne bir sayı veya dize değil.
Çalışma zamanı türü geçersiz kılmaları
Çalışma zamanı türü geçersiz kılmaları,
istek karşılamayı da kapsar. Bu özellik, bir türün spesifikasyonunu eklemenize veya değiştirmenize olanak tanır.
belirler. Örneğin, günlük menüyü yüklemek için bir arka uç veri kaynağını kontrol edebilirsiniz.
bir türe dönüştürmenize yardımcı olabilir.
Daha fazla bilgi için webhook kılavuzuna bakın.
konulu videomuzu izleyin.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 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------------\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."]]