Jika Anda lebih suka bekerja sama dengan agen yang sudah ada, tidak masalah. Pastikan Anda
mengaktifkan adaptasi ucapan otomatis
di setelan agen. Fitur ini diaktifkan secara default untuk agen baru.
Membuat entity pengenal urutan
Fungsi inti agen ini adalah memahami urutan alfanumerik melalui
suara. Secara khusus, Anda akan menyiapkan agen untuk memproses beberapa karakter
sekaligus, yang pada akhirnya menggabungkan semua sub-urutan sebelum memvalidasi
urutan akhir terhadap penyimpanan data. Mari kita mulai dengan menentukan entity untuk
mengenali urutan parsial.
Membuat entity urutan ekspresi reguler
Kita perlu menggunakan entity regexp untuk merekam urutan sehingga adaptasi ucapan otomatis
akan tahu untuk memproses "ABC", bukan "a bee sea".
Kita akan menyiapkan entity untuk menerima urutan alfanumerik minimal 3
karakter. Kemudian, Anda akan menambahkan webhook sehingga dapat memvalidasi urutan akhir terhadap API atau penyimpanan data.
Buat entity baru. Kita akan menamainya "alphanumeric" karena akan menerima
input alfanumerik apa pun.
Centang kotak Entity Regexp
Menambahkan satu entri, ^[a-zA-Z0-9]{3}[a-zA-Z0-9]*$
Klik SIMPAN.
Perhatikan bahwa regexp yang Anda tambahkan sangat ketat karena hanya mencari
string alfanumerik, tanpa spasi atau tanda hubung. Hal ini penting karena
dua alasan:
Regexp ini mengikuti persyaratan
adaptasi ucapan otomatis
untuk mengaktifkan mode pengenal "urutan yang dieja".
Dengan tidak mencari spasi dan hanya mencari seluruh frasa (^...$),
Anda memungkinkan pengguna akhir keluar dari pengenalan urutan dengan mudah. Misalnya,
saat Anda meminta "berapa nomor pesanan Anda" dan pengguna akhir membalas
"tidak, saya ingin melakukan pemesanan", regexp akan menolak dan Dialogflow akan
mengetahui untuk mencari intent lain yang mungkin cocok dengan frasa tersebut.
Jika hanya tertarik dengan nilai numerik, Anda dapat membuat entity yang lebih disesuaikan
seperti [0-9]{3}[0-9]*, atau bahkan hanya menggunakan entity @sys.number-sequence
bawaan.
Bagian tutorial lainnya mengasumsikan bahwa Anda mengumpulkan urutan alfanumerik. Buka
bagian berikutnya untuk melihat cara menyiapkan intent guna mengumpulkan urutan ini.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[[["\u003cp\u003eThis tutorial guides users through setting up a Dialogflow agent to recognize alphanumeric sequences over voice input.\u003c/p\u003e\n"],["\u003cp\u003eUsers should first create a new Dialogflow agent, or use an existing one that has auto speech adaptation enabled in the agent settings.\u003c/p\u003e\n"],["\u003cp\u003eA regexp entity, named "alphanumeric," is created to recognize partial alphanumeric sequences, adhering to auto speech adaptation guidelines with the format \u003ccode\u003e^[a-zA-Z0-9]{3}[a-zA-Z0-9]*$\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe defined regexp entity strictly looks for strings of alphanumerics without spaces or dashes, allowing for recognition of spelled-out sequences and easy exit from sequence recognition.\u003c/p\u003e\n"],["\u003cp\u003eFor numeric-only values, the user could opt to make a more tailored entity like \u003ccode\u003e[0-9]{3}[0-9]*\u003c/code\u003e, or use the built-in \u003ccode\u003e@sys.number-sequence\u003c/code\u003e entity.\u003c/p\u003e\n"]]],[],null,["# Before you begin\n\nBefore trying this tutorial,\nyou should be familiar with Dialogflow basics covered in\n[Quickstarts](/dialogflow/docs/quick).\n\nCreate an agent\n---------------\n\nUse the [Dialogflow ES console](https://dialogflow.cloud.google.com) to create an agent named \"PackageTracker\".\nIf you are unsure how to do this,\nrevisit the [Quickstarts](/dialogflow/docs/quick).\n\nIf you prefer to work with an existing agent, that is okay too. Just be sure that you\n[enable auto speech adaptation](/dialogflow/es/docs/speech-adaptation#enable_or_disable_auto_speech_adaptation)\nin the agent settings. This is enabled by default for new agents.\n\nCreate a sequence recognizer entity\n===================================\n\nThe core function of this agent is understanding alphanumeric sequences over\nvoice. Specifically, you'll set up the agent to listen for a handful of characters\nat a time, eventually putting all sub-sequences together before validating the\nfinal sequence against a data store. Let's start by defining an entity to\nrecognize the partial sequences.\n\nCreate the regexp sequence entities\n-----------------------------------\n\nWe need to use a regexp entity to capture sequences so that auto speech\nadaptation will know to listen for \"ABC\" instead of \"a bee sea\".\n\nThese entities must conform to the\n[auto speech adaptation regexp enitity guidelines](/dialogflow/es/docs/speech-adaptation#regexp_entities)\nto ensure the speech recognition is tuned to recognize spelled-out sequences.\n\n### Partial sequence entity\n\nWe'll set up the entity to accept any alphanumeric sequence of at least 3\ncharacters. Later, you'll add a webhook so that you can validate the final\nsequence against a data store or API.\n\n1. Create a new entity. We'll name it \"alphanumeric\" because it will accept any alphanumeric input.\n2. Check the box for **Regexp entity**\n3. Add a single entry, `^[a-zA-Z0-9]{3}[a-zA-Z0-9]*$`\n4. Click **SAVE**.\n\nNotice that the regexp you added is very strict in that it is looking only for\na string of alphanumerics, without any spaces or dashes. This is important for\ntwo reasons:\n\n1. This regexp follows the auto speech adaptation [requirements](/dialogflow/es/docs/speech-adaptation#regexp_entities) for enabling the \"spelled-out sequence\" recognizer mode.\n2. By not looking for spaces and only looking for entire phrases (`^`...`$`), you allow end-users to easily exit the sequence recognition. For example, when you prompt \"what's your order number\" and an end-user replies \"no I want to place an order\", the regexp will reject and Dialogflow will know to look for another intent that might match that phrase.\n\nIf you are only interested in numeric values, you could create a more tailored\nentity like `[0-9]{3}[0-9]*`, or even just use the built-in `@sys.number-sequence`\nentity.\n\nThe rest of the tutorial assumes you are collecting alphanumeric sequences. Jump\nto the next section to see how to set up intents to collect these sequences."]]