Intent
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Intent จะแมปอินพุตของผู้ใช้แบบปลายเปิดกับออบเจ็กต์ที่มีโครงสร้าง วลีที่พูดจะจับคู่กับ Intent ด้วย Natural Language Understanding (NLU) ของ Google การจับคู่ Intent จะทริกเกอร์เหตุการณ์ในการออกแบบการสนทนาให้คืบหน้าการสนทนาของผู้ใช้ ชื่อ 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 'San Francisco' auto=false) ไป ($dest 'Vancouver')"
|
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 ใช้ได้ในเงื่อนไขและการตอบกลับเพื่ออ้างอิงพารามิเตอร์ Intent ที่ดึงโดย NLU ด้วย $intent.params.[name].resolved
|
ช่องการรวม parameter_type ประเภทของพารามิเตอร์ Intent parameter_type ต้องเป็นค่าใดค่าหนึ่งต่อไปนี้ |
type |
object (ClassReference )
ไม่บังคับ ประกาศประเภทข้อมูลของพารามิเตอร์นี้ ไม่ควรตั้งค่านี้สำหรับ Intent ในตัว
|
entitySetReferences |
object (EntitySetReferences )
ไม่บังคับ การอ้างอิงไปยังชุดของเอนทิตีที่อนุญาตสำหรับพารามิเตอร์ Intent นี้ ใช้ได้กับพารามิเตอร์ของ Intent ในตัวเท่านั้น การอ้างอิงเหล่านี้ชี้ไปที่ชุดเอนทิตีใน "custom/entitySets" ไดเรกทอรี
|
EntitySetReferences
การอ้างอิงชุดเอนทิตีสำหรับพารามิเตอร์ Intent
ช่อง |
entitySetReferences[] |
object (EntitySetReference )
ต้องระบุ การอ้างอิงชุดเอนทิตีสำหรับพารามิเตอร์ Intent
|
EntitySetReference
การอ้างอิงชุดของเอนทิตีที่อนุญาตสำหรับพารามิเตอร์ Intent นี้
การแสดง YAML |
entitySet: string |
ช่อง |
entitySet |
string
ต้องระบุ ระบุคอลเล็กชันเอนทิตีเฉพาะที่จะพิจารณาสำหรับพารามิเตอร์ที่ระบุ การกำหนดชุดเอนทิตีที่เกี่ยวข้องควรแสดงอยู่ในไดเรกทอรี custom/entitySets/
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 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. |"]]