Kể từ ngày 13 tháng 6 năm 2023, Hành động trò chuyện không còn được dùng nữa. Để biết thêm thông tin, hãy xem phần Hành động trò chuyện ngừng hoạt động.
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.
Mẫu truy vấn xác định cụm từ mẫu mà người dùng có thể nói. Trợ lý có thể
khớp các cụm từ nói của người dùng tương tự về mặt ngữ nghĩa bằng cách sử dụng ngôn ngữ tự nhiên
đang xử lý.
Mẫu truy vấn có thể chứa một chuỗi cố định, các điều kiện và đối số bằng cách sử dụng
Các loại schema.org.
Chuỗi ký tự
Mẫu truy vấn có thể chứa một chuỗi ký tự.
Ví dụ: "Start the guess the number game."
Điều kiện
Các phần của mẫu truy vấn có thể được coi là không bắt buộc. Để chỉ ra điều kiện
mẫu truy vấn, hãy đặt phần cụm từ trong ngoặc đơn và kết thúc cụm từ đó bằng
một dấu chấm hỏi. Ví dụ sau đây định nghĩa Start the là không bắt buộc:
Ví dụ: "(Start the)? Guess the number game"
Đối số
Mẫu truy vấn có thể thu thập một phần thông tin đầu vào của người dùng thông qua việc sử dụng
đối số được đặt tên (đây cũng có thể được coi là các biến). Đối số là
được chỉ định bằng cú pháp: $Type:argument_name.
Ví dụ: "$org.schema.type.Number:number" mô tả mẫu truy vấn
mong đợi dữ liệu đầu vào là số Schema.org và số thực mà người dùng
cho biết sẽ được nắm bắt trong một đối số có tên là "number".
Các loại schema.org
Sau đây là danh sách các loại Schema.org được hỗ trợ được dùng cho mẫu truy vấn:
thêm $org.schema.type.MusicRecord:bài hát vào danh sách yêu thích của tôi.
thêm có hoặc không có bạn vào danh sách yêu thích của tôi.
$org.schema.type.YesNo
$org.schema.type.YesNo
Có
$org.schema.type.URL
Thêm $org.schema.type.URL
Thêm google.com
$org.schema.type.Email
Thêm $org.schema.type.Email
Thêm john@google.com
$org.schema.type.PhoneNumber
Thêm $org.schema.type.PhoneNumber
Thêm (777) 777-7777
$org.schema.type.Text
Người ta nói $org.schema.type.Text là bài hát đó gì
Người ta nói bạn là ánh nắng của tôi là bài gì?
Loại tuỳ chỉnh
Đối tượng customTypes cho phép bạn chỉ định các kiểu của riêng mình. Bạn có thể xác định
name thuộc một loại tuỳ chỉnh và đưa các trường sau vào items:
key: Giá trị của kiểu tuỳ chỉnh tương ứng với các chuỗi trong
synonyms
synonyms: Những cách mà người dùng có thể tham khảo key
Ví dụ sau đây xác định một loại tuỳ chỉnh theo các cách khác nhau mà một
người nào đó có thể nói "6 giờ sáng".
"customTypes": [
{
"name": "$MorningOptions",
"items": [
{
"key": "6am",
"synonyms": [
"6 am",
"6 o clock",
"oh six hundred",
"6 in the morning"
]
}
]
}
]
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eQuery patterns use natural language processing to match user phrases with expected inputs for Actions.\u003c/p\u003e\n"],["\u003cp\u003ePatterns can include literal strings, optional phrases (using parentheses and a question mark), and arguments to capture user input.\u003c/p\u003e\n"],["\u003cp\u003eArguments utilize Schema.org types (e.g., \u003ccode\u003e$org.schema.type.Number\u003c/code\u003e) to specify the expected data type and capture values.\u003c/p\u003e\n"],["\u003cp\u003eCustom types can be defined for specific vocabulary using keys and synonyms to handle variations in user expressions.\u003c/p\u003e\n"]]],[],null,["# Query patterns (Dialogflow)\n\nA query pattern defines an example phrase a user might say. The Assistant can\nmatch user spoken phrases that are semantically similar using natural language\nprocessing.\n\nQuery patterns can contain a literal string, conditionals, and arguments using\n[Schema.org types](https://developers.google.com/voice-actions/custom/reference#argument_types).\n| **Note:** Query patterns are specified [in the trigger object of an Intent](/assistant/df-asdk/reference/action-package/rest/Shared.Types/Action#Intent).\n\nLiteral string\n--------------\n\nA query pattern can contain a literal string.\n\nExample: `\"Start the guess the number game.\"`\n\nConditionals\n------------\n\nPortions of a query pattern can be considered optional. To indicate conditional\nquery patterns, wrap the portion of the phrase in parenthesis and end it with\na question mark. The following example defines `Start the` as optional:\n\nExample: `\"(Start the)? Guess the number game\"`\n\nArguments\n---------\n\nA query pattern can collect a portion of the user's input through the use of\nnamed arguments (this can also be considered variables). Arguments are\nspecified using the syntax: `$Type:argument_name`.\n\nExample: `\"$org.schema.type.Number:number\"` describes a query pattern that\nexpects an input of a Schema.org number, and that the actual number the user\nsays will be captured in an argument named \"number\".\n\n#### Schema.org types\n\nFollowing is the list of supported Schema.org types used for query patterns:\n| **Note:** Schema.org types correspond conceptually to the [schema.org vocabulary](http://www.schema.org), but the argument values retrieved have a different JSON schema than that defined by the official schema.org reference.\n\n| Type | Example Query Pattern | Example User Query |\n|---------------------------------------------------------------------|-----------------------------------------------------------------------------------------|--------------------------------------------------------|\n| [$org.schema.type.Date](http://schema.org/Date) | read my sms from $org.schema.type.Date:my_date on sms pro | *read my sms from april 1st on sms pro* |\n| [$org.schema.type.Number](http://schema.org/Number) | blink the flashlight $org.schema.type.Number:number times | *blink the flashlight five times* |\n| [$org.schema.type.Time](http://schema.org/Time) | read my sms from $org.schema.type.Time:my_time on sms pro | *read my sms from 5 pm on sms pro* |\n| [$org.schema.type.DayOfWeek](http://schema.org/DayOfWeek) | show me my meetings on$org.schema.type.DayOfWeek:day_of_week | *show me my meetings on Tuesday* |\n| [$org.schema.type.Color](http://schema.org/color) | turn on the $org.schema.type.Color:my_color strobe light | *turn on the red strobe light* |\n| [$org.schema.type.priceCurrency](http://schema.org/priceCurrency) | show conversion rate for $org.schema.type.priceCurrency:cur on currency app | *show conversion rate for yen on currency app* |\n| [$org.schema.type.Distance](http://schema.org/Distance) | show conversion chart for $org.schema.type.Distance:dist | *show conversion chart for kilometer* |\n| [$org.schema.type.Temperature](http://schema.org/QuantitativeValue) | set temperature to $org.schema.type.Number:num degrees$org.schema.type.Temperature:temp | *set temperature to 70 degrees fahrenheit* |\n| [$org.schema.type.Organization](http://schema.org/Organization) | watch $org.schema.type.Organization:organization highlights | *watch lakers highlights* |\n| | show me stock price for$org.schema.type.Organization:organization | *show me stock price for Google* |\n| [$org.schema.type.Person](http://schema.org/Person) | show top 10 $org.schema.type.Person:musician songs | *show top 10 bruno mars songs* |\n| | show me news about $org.schema.type.Person:person | *show me news about bill gates* |\n| [$org.schema.type.Place](http://schema.org/Place) | write review for $org.schema.type.Place:place | *write review for new york* |\n| | show traffic on $org.schema.type.Place:location | *show traffic on mountain view* |\n| [$org.schema.type.Product](http://schema.org/Product) | write review for $org.schema.type.Product:product | *write review for google glass* |\n| [$org.schema.type.Book](http://schema.org/Book) | read $org.schema.type.Book:my_book | *read great expectations* |\n| [$org.schema.type.Movie](http://schema.org/Movie) | play the $org.schema.type.Movie:my_movie movie | *review the casablanca movie* |\n| [$org.schema.type.TVSeries](http://schema.org/TVSeries) | play next episode of $org.schema.type.TVSeries:tv_series | *play next episode of friends* |\n| [$org.schema.type.servesCuisine](http://schema.org/servesCuisine) | show $org.schema.type.servesCuisine:my_cuisine restaurants | *show italian restaurants* |\n| [$org.schema.type.MusicAlbum](http://schema.org/MusicAlbum) | add $org.schema.type.MusicAlbum:album to my queue. | *add abbey road to my queue* |\n| [$org.schema.type.MusicRecording](http://schema.org/MusicRecording) | add $org.schema.type.MusicRecording:song to my favorites. | *add with or without you to my favorites.* |\n| $org.schema.type.YesNo | $org.schema.type.YesNo | *Yes* |\n| $org.schema.type.URL | Add $org.schema.type.URL | *Add google.com* |\n| $org.schema.type.Email | Add $org.schema.type.Email | *Add john@google.com* |\n| $org.schema.type.PhoneNumber | Add $org.schema.type.PhoneNumber | *Add (777) 777-7777* |\n| $org.schema.type.Text | What's that song where they say $org.schema.type.Text | *What's that song where they say you are my sunshine?* |\n\n#### Custom types\n\nThe `customTypes` object allows you to specify your own types. You can define\nthe `name` of a custom type and include the following fields in `items`:\n\n- `key`: The value of the custom type that corresponds to the strings in `synonyms`\n- `synonyms`: The possible ways that users may refer to `key`\n\nThe following example defines a custom type for the different ways a\nperson might say \"6am\". \n\n```text\n\"customTypes\": [\n {\n \"name\": \"$MorningOptions\",\n \"items\": [\n {\n \"key\": \"6am\",\n \"synonyms\": [\n \"6 am\",\n \"6 o clock\",\n \"oh six hundred\",\n \"6 in the morning\"\n ]\n }\n ]\n }\n ]\n```"]]