Storage
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
برای سفارشی کردن بهتر تجربه کاربر با Action خود، میتوانید دادهها را بین نوبتهای یک مکالمه یا در چندین مکالمه با آن کاربر ذخیره کنید. دادههای ذخیرهشده میتوانند پیامهای مفیدی را در یک مکالمه ارائه دهند، نمرات بازی را در طول جلسات ذخیره کنند، یا اطلاعات کوچکی را برای کاربر به خاطر بسپارند.
داده ها را می توان به روش های مختلف در طول یک مکالمه ذخیره کرد. در یک مکالمه، میتوانید از انواع برای حاشیهنویسی عبارات آموزشی در intent یا ذخیره اطلاعات کاربر در حین پر کردن شکاف استفاده کنید.
همچنین می توانید مقادیر Action store خود را با استفاده از وب هوک خود با روش های ذخیره سازی زیر داشته باشید:
- ذخیره سازی جلسه
- ذخیره سازی کاربر
- ذخیره سازی خانه
از این روشهای ذخیرهسازی در ترکیب با یکدیگر استفاده کنید تا بهترین تطابق را با نحوه ماندگاری اطلاعات در داخل یا بین فراخوانهای Action خود داشته باشید.
ذخیره سازی جلسه
زمانی که میخواهید مقداری را برای یک مکالمه، اما نه از یک مکالمه به مکالمه دیگر، حفظ کنید، از فضای ذخیرهسازی جلسه استفاده کنید. در طول مکالمه، هر داده ای که با استفاده از انواع جمع آوری می شود در ذخیره سازی جلسه ذخیره می شود.
ذخیره سازی کاربر
زمانی که میخواهید یک مقدار را در بین مکالمات برای یک کاربر تأیید شده حفظ کنید، از فضای ذخیرهسازی کاربر استفاده کنید. به عنوان مثال، یک بازی می تواند امتیاز بالای کاربر را در فضای ذخیره سازی کاربر ذخیره کند و هر بار که کاربر مکالمه جدیدی را شروع می کند، امتیاز بالا را در پیام خوشامدگویی ارائه کند.
ذخیره سازی خانه
زمانی که میخواهید برای دستگاههای موجود در یک خانواده، مقداری را در بین مکالمهها حفظ کنید (بر اساس نمودار صفحه اصلی ) از فضای ذخیرهسازی خانگی استفاده کنید. فضای ذخیرهسازی خانه مختص هیچ کاربر خاصی نیست، بنابراین هر کاربر در خانواده میتواند به آن کمک کند. هنگام استفاده از فضای ذخیرهسازی خانگی، Google علاوه بر این، یک اعلان به کاربران تأیید شده و در هر فراخوانی توسط کاربران مهمان (حداکثر یک بار در 10 دقیقه) ارائه میکند.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[[["\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)."]]