Intent
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Ý định liên kết dữ liệu đầu vào mở của người dùng với các đối tượng có cấu trúc. Cụm từ nói được khớp với ý định dựa trên công nghệ Hiểu ngôn ngữ tự nhiên (NLU) của Google. Việc so khớp ý định có thể kích hoạt các sự kiện trong thiết kế cuộc trò chuyện của bạn để tiến triển cuộc trò chuyện của người dùng. Tên ý định được chỉ định trong tên tệp.
Trình bày theo YAML |
parameters:
- object (IntentParameter )
trainingPhrases:
- string |
Trường |
parameters[] |
object (IntentParameter )
Danh sách các tham số trong các cụm từ huấn luyện. Tất cả tham số phải được xác định tại đây để sử dụng trong cụm từ huấn luyện.
|
trainingPhrases[] |
string
Cụm từ huấn luyện cho phép NLU của Google tự động so khớp ý định với hoạt động đầu vào của người dùng. Bạn cung cấp càng nhiều cụm từ độc đáo thì cơ hội so khớp ý định này càng cao. Sau đây là định dạng của phần cụm từ dùng để huấn luyện có chú thích. Lưu ý rằng trường auto là không bắt buộc và hành vi mặc định khi không chỉ định auto sẽ tương đương với auto=false . ($<paramName> '<sample text>' auto=<true or false>) auto = true có nghĩa là phần này đã được NLU tự động chú thích. auto = false có nghĩa là phần được người dùng chú thích. Đây là chế độ mặc định khi bạn không chỉ định chế độ tự động. Ví dụ: "Đặt chuyến bay từ ($source 'San Francisco' auto=false) đến ($dest 'Vancouver')"
|
IntentParameter
Định nghĩa về một tham số có thể dùng bên trong các cụm từ huấn luyện.
Trình bày theo 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 . |
Trường |
name |
string
Bắt buộc. Tên riêng biệt của tham số ý định. Có thể dùng trong các điều kiện và phản hồi đến tham số ý định tham chiếu do NLU trích xuất bằng $intent.params.[name].resolved
|
Trường kết hợp parameter_type . Loại của tham số ý định. parameter_type chỉ có thể là một trong những trạng thái sau đây: |
type |
object (ClassReference )
Không bắt buộc. Khai báo loại dữ liệu của tham số này. Bạn không nên đặt thuộc tính này cho các ý định tích hợp.
|
entitySetReferences |
object (EntitySetReferences )
Không bắt buộc. Mã tham chiếu đến tập hợp các thực thể được phép cho tham số ý định này. Chỉ hợp lệ đối với các tham số của ý định tích hợp. Các tham chiếu này trỏ đến các nhóm thực thể trong "custom/entitySets" thư mục.
|
EntitySetReferences
Tham chiếu nhóm thực thể cho một tham số ý định.
Trường |
entitySetReferences[] |
object (EntitySetReference )
Bắt buộc. Tham chiếu nhóm thực thể cho một tham số ý định.
|
EntitySetReference
Thông tin tham chiếu đến tập hợp các thực thể được phép cho tham số ý định này.
Trình bày theo YAML |
entitySet: string |
Trường |
entitySet |
string
Bắt buộc. Xác định một tập hợp các thực thể cụ thể cần được xem xét cho một thông số nhất định. Định nghĩa nhóm thực thể tương ứng phải có trong thư mục custom/entitySets/.
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\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. |"]]