Beberapa produk dan fitur sedang dalam proses penggantian nama. Fitur playbook dan alur generatif juga dimigrasikan ke satu konsol gabungan. Lihat detailnya.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Sesi mewakili percakapan antara agen Agen Percakapan (Dialogflow CX) dan pengguna akhir.
Anda membuat sesi di awal percakapan
dan menggunakannya untuk setiap giliran percakapan.
Setelah percakapan berakhir,
Anda tidak akan lagi menggunakan sesi.
Anda tidak boleh menggunakan sesi yang sama untuk percakapan serentak
dengan pengguna akhir yang berbeda.
Sesi tetap aktif dan datanya disimpan selama 30 menit
setelah permintaan terakhir dikirim untuk sesi tersebut.
Setiap sesi ditentukan secara unik oleh ID sesi yang dihasilkan oleh sistem Anda.
Anda membuat sesi baru dengan memberikan ID sesi baru
dalam permintaan intent deteksi dan metode sesi lainnya.
ID sesi adalah string dengan ukuran maksimal 36 byte.
Sistem Anda bertanggung jawab untuk membuat ID sesi unik.
ID ini dapat berupa angka acak, ID pengguna akhir yang di-hash,
atau nilai lain yang mudah Anda buat.
Periksa dokumentasi Regionalisasi
untuk mengetahui informasi tentang nilai ID Lokasi dalam nama sesi.
Sesi yang tahan lama
Secara default, Agen Percakapan (Dialogflow CX) mempertahankan data sesi selama 30 menit. Ada dua cara untuk memperpanjang masa aktif sesi:
(Direkomendasikan) Tetapkan TTL sesi menggunakan QueryParameters.session_ttl. Nilai maksimum yang diizinkan adalah 24 jam.
Anda dapat menghidupkan kembali status sesi sebelumnya dengan menetapkan
QueryParameters.current_page dan QueryParameters.parameters di DetectIntentRequest.
Contoh alur kerja terlihat seperti:
Pengguna akhir berbicara dengan agen dalam sesi A.
Kode Anda mencatat status yang terkait dengan sesi A yang ditampilkan dalam respons API, yaitu QueryResult.current_page dan QueryResult.parameters.
Pengguna akhir berhenti berinteraksi dengan agen setelah 50 menit.
Pengguna akhir berbicara lagi dengan agen.
Kode Anda mengirimkan input pengguna akhir, bersama dengan QueryParameters.current_page dan QueryParameters.parameters
yang direkam sebelumnya dalam permintaan,
untuk mendeteksi intent dengan status sesi sebelumnya. Anda tidak perlu menggunakan
ID sesi yang sama dengan yang digunakan oleh sesi A.
Referensi
Untuk mengetahui informasi tentang harga sesi, lihat
halaman harga.
[[["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\u003eA session in Conversational Agents (Dialogflow CX) represents a single conversation between an agent and an end-user, beginning at the start of the conversation and ending when the conversation is done.\u003c/p\u003e\n"],["\u003cp\u003eEach session is assigned a unique session ID, which is a string of up to 36 bytes, and it is generated by the user's system.\u003c/p\u003e\n"],["\u003cp\u003eSessions should not be shared between multiple end-users concurrently, as it may produce unpredictable behaviors and data corruption.\u003c/p\u003e\n"],["\u003cp\u003eBy default, session data is stored for 30 minutes after the last request; however, this can be extended up to 24 hours by setting the \u003ccode\u003eQueryParameters.session_ttl\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can also revive a previous session state by setting \u003ccode\u003eQueryParameters.current_page\u003c/code\u003e and \u003ccode\u003eQueryParameters.parameters\u003c/code\u003e in a \u003ccode\u003eDetectIntentRequest\u003c/code\u003e for long-lasting sessions, allowing users to resume from a previous state even after the default 30-minute window has passed.\u003c/p\u003e\n"]]],[],null,["# Sessions\n\nA session represents a conversation between a Conversational Agents (Dialogflow CX) agent and an end-user.\nYou create a session at the beginning of a conversation\nand use it for each turn of the conversation.\nOnce the conversation has ended,\nyou discontinue using the session.\n\nYou should not use the same session for concurrent conversations\nwith different end-users.\nA session remains active and its data is stored for 30 minutes\nafter the last request is sent for the session.\n\nEach session is determined unique by a session ID generated by your system.\nYou create a new session by providing a new session ID\nin a detect intent request and other session methods.\nA session ID is a string of at most 36 bytes in size.\nYour system is responsible for generating unique session IDs.\nThey can be random numbers, hashed end-user identifiers,\nor any other values that are convenient for you to generate.\n\nCheck the [Regionalization](/dialogflow/cx/docs/how/region)\ndocumentation for information about the Location ID value in the session name.\n\nLong-lasting sessions\n---------------------\n\nBy default, Conversational Agents (Dialogflow CX) maintains the session data for 30 minutes. There are two ways to extend the lifetime of the sessions:\n\n- **(Preferred)** Set session TTL using `QueryParameters.session_ttl`. The maximum allowed value is 24 hours.\n- You can revive the previous session state by setting\n `QueryParameters.current_page` and `QueryParameters.parameters` in `DetectIntentRequest`.\n\n An example workflow looks like:\n 1. End-user talks with the agent under session A.\n 2. Your code records the state associated with session A returned in the API response, namely `QueryResult.current_page` and `QueryResult.parameters`.\n 3. End-user stops interacting with the agent after 50 minutes.\n 4. End-user talks with the agent again.\n 5. Your code sends the end-user input, together with the previously recorded `QueryParameters.current_page` and `QueryParameters.parameters` in the request, to detect intent with the previous session state. You do not need to use the same session ID as used by session A.\n\n | **Note:** [Handler call stack](/dialogflow/cx/docs/concept/handler#call-stack) will **not** be revived with this approach.\n\nReferences\n----------\n\nFor information on session pricing, see the\n[pricing page](/dialogflow/pricing).\n\nFor more information on sessions:\n\n\nGo to the Session API reference \n**Select a protocol and version for the Session reference:**\n\nClose\n\n\u003cbr /\u003e"]]