Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Konteks Dialogflow mirip dengan konteks bahasa alami.
Jika seseorang mengatakan kepada Anda "warnanya oranye",
Anda memerlukan konteks untuk memahami apa yang dimaksud dengan "warnanya".
Demikian pula, agar Dialogflow dapat menangani ekspresi pengguna akhir seperti itu,
Dialogflow harus diberi konteks agar dapat mencocokkan intent dengan benar.
Dengan menggunakan konteks,
Anda dapat mengontrol alur percakapan.
Anda dapat mengonfigurasi konteks untuk intent dengan menetapkan
konteks input dan output,
yang diidentifikasi dengan nama string.
Saat intent dicocokkan,
konteks output yang dikonfigurasi untuk intent tersebut akan aktif.
Meskipun konteks apa pun aktif, Dialogflow lebih cenderung mencocokkan intent yang dikonfigurasi dengan konteks input yang sesuai dengan konteks yang saat ini aktif.
Diagram berikut menunjukkan contoh yang menggunakan konteks untuk agen perbankan.
Pengguna akhir meminta informasi tentang rekening giro mereka.
Dialogflow mencocokkan ekspresi pengguna akhir ini dengan intent CheckingInfo.
Intent ini memiliki konteks output checking, sehingga konteks menjadi aktif.
Agen menanyakan jenis informasi yang diinginkan pengguna akhir
tentang rekening giro mereka.
Pengguna akhir merespons dengan "saldo saya".
Dialogflow mencocokkan ekspresi pengguna akhir ini dengan intent CheckingBalance.
Intent ini memiliki konteks input checking,
yang harus aktif untuk mencocokkan intent ini.
Intent SavingsBalance serupa mungkin juga ada untuk mencocokkan ekspresi pengguna akhir yang sama
saat konteks savings aktif.
Setelah sistem Anda melakukan kueri database yang diperlukan,
agen akan merespons dengan saldo rekening giro.
[[["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-08-18 UTC."],[[["\u003cp\u003eDialogflow's contexts are used to understand user expressions by providing necessary conversational context, similar to how humans understand natural language.\u003c/p\u003e\n"],["\u003cp\u003eContexts control conversation flow by setting input and output contexts for intents, identified by string names.\u003c/p\u003e\n"],["\u003cp\u003eWhen an intent is matched, its output contexts become active, influencing which intents are more likely to be matched next.\u003c/p\u003e\n"],["\u003cp\u003eDialogflow matches intents with specific input contexts only when those contexts are currently active, allowing for tailored responses.\u003c/p\u003e\n"],["\u003cp\u003eThe banking agent example shows how the "checking" output context from the \u003ccode\u003eCheckingInfo\u003c/code\u003e intent enables the \u003ccode\u003eCheckingBalance\u003c/code\u003e intent to be matched later when a user asks for their balance.\u003c/p\u003e\n"]]],[],null,["# Contexts\n\nDialogflow\n\n*contexts*\n\nare similar to natural language context.\nIf a person says to you \"they are orange\",\nyou need context in order to understand what \"they\" is referring to.\nSimilarly, for Dialogflow to handle an end-user expression like that,\nit needs to be provided with context in order to correctly match an intent.\n\n\nUsing contexts,\nyou can control the flow of a conversation.\nYou can configure contexts for an intent by setting\n[input and output contexts](/dialogflow/docs/contexts-input-output),\nwhich are identified by string names.\nWhen an intent is matched,\nany configured *output contexts* for that intent become active.\nWhile any contexts are active,\nDialogflow is more likely to match intents\nthat are configured with *input contexts* that correspond to\nthe currently active contexts.\n\n\nThe following diagram shows an example that uses context for a banking agent.\n\n1. The end-user asks for information about their checking account.\n2. Dialogflow matches this end-user expression to the `CheckingInfo` intent. This intent has a `checking` output context, so that context becomes active.\n3. The agent asks the end-user for the type of information they want about their checking account.\n4. The end-user responds with \"my balance\".\n5. Dialogflow matches this end-user expression to the `CheckingBalance` intent. This intent has a `checking` input context, which needs to be active to match this intent. A similar `SavingsBalance` intent may also exist for matching the same end-user expression when a `savings` context is active.\n6. After your system performs the necessary database queries, the agent responds with the checking account balance."]]