Storage
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เพื่อปรับแต่งประสบการณ์ของผู้ใช้ด้วยการดำเนินการของคุณให้ดียิ่งขึ้น คุณสามารถบันทึกข้อมูลระหว่างการสนทนาระหว่าง 1 ครั้งหรือระหว่างการสนทนาหลายรายการกับผู้ใช้รายนั้นได้
ข้อมูลที่บันทึกไว้สามารถแสดงข้อความแจ้งผู้ใช้ซ้ำที่เป็นประโยชน์ในการสนทนาเดียว เก็บคะแนนของเกมในเซสชันต่างๆ หรือจดจำข้อมูลส่วนเล็กๆ ของผู้ใช้
คุณสามารถจัดเก็บข้อมูลได้หลายวิธีในระหว่างการสนทนา ในการสนทนาเดียว คุณอาจใช้ประเภทเพื่อใส่คำอธิบายประกอบวลีการฝึกใน Intent หรือเพื่อจัดเก็บข้อมูลจากผู้ใช้ในระหว่างการเติมช่อง
นอกจากนี้ คุณยังดูค่า Action Store ได้โดยใช้เว็บฮุคด้วยวิธีเก็บข้อมูลต่อไปนี้
- พื้นที่เก็บข้อมูลเซสชัน
- พื้นที่เก็บข้อมูลของผู้ใช้
- พื้นที่เก็บข้อมูลในบ้าน
ใช้วิธีการจัดเก็บข้อมูลเหล่านี้ร่วมกันเพื่อจับคู่วิธีที่คุณต้องการเก็บข้อมูลไว้ภายในหรือระหว่างการเรียกใช้การดำเนินการของคุณ
พื้นที่เก็บข้อมูลเซสชัน
ใช้พื้นที่เก็บข้อมูลเซสชันเมื่อต้องการคงค่าสำหรับการสนทนาหนึ่งไว้ แต่ไม่ใช่จากการสนทนาหนึ่งไปยังอีกการสนทนาหนึ่ง ในระหว่างการสนทนา ระบบจะเก็บข้อมูลที่รวบรวมโดยใช้ประเภทไว้ในพื้นที่เก็บข้อมูลเซสชัน
พื้นที่เก็บข้อมูลของผู้ใช้
ใช้พื้นที่เก็บข้อมูลผู้ใช้เมื่อต้องการเก็บค่าไว้ในการสนทนาของผู้ใช้รายเดียวที่ได้รับการยืนยัน เช่น เกมสามารถบันทึกคะแนนสูงสุดของผู้ใช้ในพื้นที่เก็บข้อมูลของผู้ใช้และแสดงคะแนนสูงสุดในข้อความต้อนรับทุกครั้งที่ผู้ใช้เริ่มการสนทนาใหม่
พื้นที่เก็บข้อมูลในบ้าน
ใช้พื้นที่เก็บข้อมูลภายในบ้านเมื่อต้องการคงค่าไว้ในการสนทนาในอุปกรณ์ต่างๆ ในครอบครัวเดียว (อิงตาม Home Graph) พื้นที่เก็บข้อมูลในหน้าแรกไม่ได้ใช้กับผู้ใช้รายใดรายหนึ่งโดยเฉพาะ ดังนั้นผู้ใช้ทุกคนในครอบครัวสามารถร่วมให้ข้อมูลได้ เมื่อใช้พื้นที่เก็บข้อมูลในหน้าแรก Google จะแสดงการแจ้งเตือนเพิ่มเติมแก่ผู้ใช้ที่ได้รับการยืนยัน 1 ครั้ง และในการเรียกใช้แต่ละครั้งโดยผู้ใช้ที่เป็นผู้มาเยือน (ไม่เกิน 1 ครั้งต่อ 10 นาที)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eActions on Google can save data to customize user experiences, enabling features like reprompts and storing information across conversations.\u003c/p\u003e\n"],["\u003cp\u003eData can be saved within a single conversation using types or across conversations with session, user, or home storage, depending on the desired persistence.\u003c/p\u003e\n"],["\u003cp\u003eSession storage retains data for a single conversation, user storage saves data for a specific user across conversations, and home storage persists data for all users on devices in a household.\u003c/p\u003e\n"]]],["Data in user interactions can be saved within single or multiple conversations to enhance user experience. Data can be stored through types in intents or via webhook storage methods: session storage for single conversation data, user storage for data across conversations of a specific user, and home storage for data across conversations for all users in a household. These methods can be used in conjunction to manage how information persists.\n"],null,["# Storage\n\nTo better customize a user's experience with your Action, you can save data\nbetween turns of a conversation or across multiple conversations with that user.\nSaved data can provide helpful reprompts in a single conversation, store game\nscores across sessions, or remember small pieces of information for a user.\n\nData can be stored in multiple ways during a conversation. In a single\nconversation, you can use [types](/assistant/conversational/types) to annotate training phrases in intents or\nto store information from the user during slot filling.\n\nYou can also have your Action store values using your webhook with the following\nstorage methods:\n\n- Session storage\n- User storage\n- Home storage\n\nUse these storage methods in combination with each other to best match how you\nwant to persist information within or between invocations of your Action.\n\nSession storage\n---------------\n\nUse [session storage](/assistant/conversational/storage-session) when you want to persist a value for a single\nconversation, but not from one conversation to another. During a conversation,\nany data collected using [types](/assistant/conversational/types) is stored in session storage.\n\nUser storage\n------------\n\nUse [user storage](/assistant/conversational/storage-user) when you want to persist a value across conversations for a\nsingle verified user. For example, a game can save a user's high score in user\nstorage and present the high score in the welcome message each time the user\nstarts a new conversation.\n\nHome storage\n------------\n\nUse [home storage](/assistant/conversational/storage-home) when you want to persist a value across conversations for\ndevices in a single household (based on [Home Graph](/assistant/smarthome/concepts/homegraph)). Home storage isn't\nspecific to any particular user, so any user in the household can contribute\ntowards it. When using home storage, Google additionally presents a notification\nonce to verified users, and on each invocation by guest users (up to once per 10\nminutes)."]]