Intent
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Intent ها ورودی کاربر با پایان باز را به اشیاء ساخت یافته ترسیم می کنند. عبارات گفتاری با اهداف با درک زبان طبیعی Google (NLU) مطابقت دارند. تطبیقهای هدف میتوانند رویدادهایی را در طراحی مکالمه شما برای پیشرفت مکالمه کاربر ایجاد کنند. نام intent در نام فایل مشخص شده است.
نمایندگی YAML |
---|
parameters:
- object (IntentParameter )
trainingPhrases:
- string |
فیلدها |
---|
parameters[] | object ( IntentParameter ) لیست پارامترهای درون عبارات آموزشی. تمام پارامترها باید در اینجا تعریف شوند تا در عبارت آموزشی استفاده شوند. |
trainingPhrases[] | string عبارات آموزشی به NLU Google اجازه می دهد تا به طور خودکار مقاصد را با ورودی کاربر مطابقت دهد. هرچه عبارات منحصر به فرد بیشتری ارائه شود، شانس بیشتری برای تطبیق این هدف وجود دارد. در زیر فرمت قسمت عبارت آموزشی است که حاشیه نویسی شده است. توجه داشته باشید که فیلد auto اختیاری است و رفتار پیشفرض زمانی که auto مشخص نشده است معادل auto=false است. ($<paramName> '<sample text>' auto=<true or false>) auto = true به این معنی است که قسمت به طور خودکار توسط NLU حاشیه نویسی شده است. auto = false یعنی قسمت توسط کاربر حاشیه نویسی شده است. این حالت پیش فرض زمانی است که خودکار مشخص نشده باشد. مثال: "رزرو پرواز از ($source 'سان فرانسیسکو' auto=false) به ($dest 'ونکوور')" |
IntentParameter
تعریف پارامتری که می تواند در عبارات آموزشی استفاده شود.
نمایندگی YAML |
---|
name: string
# Union field parameter_type can be only one of the following:
type:
object (ClassReference )
entitySetReferences:
object (EntitySetReferences )
# End of list of possible types for union field parameter_type . |
فیلدها |
---|
name | string مورد نیاز. نام منحصر به فرد پارامتر intent. می تواند در شرایط و پاسخ به پارامترهای هدف مرجع استخراج شده توسط NLU با $intent.params.[name].resolved استفاده شود. |
parameter_type فیلد اتحادیه. نوع پارامتر intent. parameter_type تنها می تواند یکی از موارد زیر باشد: |
type | object ( ClassReference ) اختیاری. نوع داده این پارامتر را اعلام می کند. این نباید برای مقاصد داخلی تنظیم شود. |
entitySetReferences | object ( EntitySetReferences ) اختیاری. ارجاع به مجموعههای موجودیتهای مجاز برای این پارامتر intent. فقط برای پارامترهای یک intent داخلی معتبر است. این ارجاعات به مجموعههای موجود در فهرست «custom/entitySets» اشاره میکنند. |
EntitySetReferences
ارجاعات مجموعه نهاد برای پارامتر intent.
فیلدها |
---|
entitySetReferences[] | object ( EntitySetReference ) مورد نیاز. ارجاعات مجموعه نهاد برای پارامتر intent. |
EntitySetReference
ارجاع به مجموعه موجودیت های مجاز برای این پارامتر intent.
نمایندگی YAML |
---|
entitySet: string |
فیلدها |
---|
entitySet | string مورد نیاز. مجموعه خاصی از موجودیت ها را که باید برای یک پارامتر معین در نظر گرفته شوند، شناسایی می کند. تعریف مجموعه موجودیت مربوطه باید در پوشه custom/entitySets/ وجود داشته باشد. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eIntents utilize Google's Natural Language Understanding (NLU) to match spoken phrases with user input, triggering events within a conversation design.\u003c/p\u003e\n"],["\u003cp\u003eIntent parameters are defined within training phrases, specifying data types and referencing allowed entities for built-in intents.\u003c/p\u003e\n"],["\u003cp\u003eEntity set references identify specific collections of entities for a given parameter, linking to definitions in the custom/entitySets/ directory.\u003c/p\u003e\n"],["\u003cp\u003eTraining phrases, incorporating parameters and entity references, enable Google's NLU to accurately match intents with user input, improving the conversational experience.\u003c/p\u003e\n"]]],[],null,["# Intent\n\n- [YAML representation](#SCHEMA_REPRESENTATION)\n- [IntentParameter](#IntentParameter)\n - [YAML representation](#IntentParameter.SCHEMA_REPRESENTATION)\n- [EntitySetReferences](#EntitySetReferences)\n - [YAML representation](#EntitySetReferences.SCHEMA_REPRESENTATION)\n- [EntitySetReference](#EntitySetReference)\n - [YAML representation](#EntitySetReference.SCHEMA_REPRESENTATION)\n\nIntents map open-ended user input to structured objects. Spoken phrases are matched to intents with Google's Natural Language Understanding (NLU). Intent matches can trigger events in your conversation design to progress the user's conversation. The intent name is specified in the name of the file.\n\n| YAML representation ||\n|-----------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` parameters: - object (/assistant/actionssdk/reference/rest/Shared.Types/Intent#IntentParameter) trainingPhrases: - string ``` |\n\n| Fields ||\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parameters[]` | `object (`[IntentParameter](/assistant/actionssdk/reference/rest/Shared.Types/Intent#IntentParameter)`)` The list of parameters within the training phrases. All parameters must be defined here to be used in the training phrase. |\n| `trainingPhrases[]` | `string` Training phrases allow Google's NLU to automatically match intents with user input. The more unique phrases that are provided, the better chance this intent will be matched. The following is the format of training phrase part which are annotated. Note that `auto` field is optional and the default behavior when `auto` is not specified is equivalent to `auto=false`. `($\u003cparamName\u003e '\u003csample text\u003e' auto=\u003ctrue or false\u003e)` `auto = true` means the part was auto annotated by NLU. `auto = false` means the part was annotated by the user. This is the default when auto is not specified. Example: \"Book a flight from ($source 'San Francisco' auto=false) to ($dest 'Vancouver')\" |\n\nIntentParameter\n---------------\n\nDefinition of a parameter which can be used inside training phrases.\n\n| YAML representation ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` name: string # Union field `parameter_type` can be only one of the following: type: object (/assistant/actionssdk/reference/rest/Shared.Types/ClassReference) entitySetReferences: object (/assistant/actionssdk/reference/rest/Shared.Types/Intent#EntitySetReferences) # End of list of possible types for union field `parameter_type`. ``` |\n\n| Fields ||\n|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| `name` | `string` Required. Unique name of the intent parameter. Can be used in conditions and responses to reference intent parameters extracted by NLU with $intent.params.\\[name\\].resolved |\n| Union field `parameter_type`. The type of the intent parameter. `parameter_type` can be only one of the following: |||\n| `type` | `object (`[ClassReference](/assistant/actionssdk/reference/rest/Shared.Types/ClassReference)`)` Optional. Declares the data type of this parameter. This should not be set for built-in intents. |\n| `entitySetReferences` | `object (`[EntitySetReferences](/assistant/actionssdk/reference/rest/Shared.Types/Intent#EntitySetReferences)`)` Optional. References to the sets of allowed entities for this intent parameter. Only valid for parameters of a built-in intent. These references point to entity sets in the 'custom/entitySets' directory. |\n\nEntitySetReferences\n-------------------\n\nEntity set references for an intent parameter.\n\n| YAML representation ||\n|---------------------------------------------------------------------------------------------------------------------|---|\n| ``` entitySetReferences: - object (/assistant/actionssdk/reference/rest/Shared.Types/Intent#EntitySetReference) ``` |\n\n| Fields ||\n|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `entitySetReferences[]` | `object (`[EntitySetReference](/assistant/actionssdk/reference/rest/Shared.Types/Intent#EntitySetReference)`)` Required. Entity set references for an intent parameter. |\n\nEntitySetReference\n------------------\n\nA reference to the set of allowed entities for this intent parameter.\n\n| YAML representation ||\n|---------------------------|---|\n| ``` entitySet: string ``` |\n\n| Fields ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `entitySet` | `string` Required. Identifies the specific collection of entities to be considered for a given parameter. The corresponding entity set definition should be present in the custom/entitySets/ directory. |"]]