Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Persistence

Keith Sterling edited this pageNov 10, 2017 ·1 revision

Y-Bot supports persistence of conversation state by saving the state of all properties between bot sessions. This functionality is based on 2 factors

  • Default Variables - Provide a way to seed all variables available to the system with default values
  • Variable Persistence - Stores on the filesystem the value of all variables as they change

When bot starts it loads the default values and keeps them cached. As each user connects ( identified by a unique client id ), the default values are used to seed their session variables. As the user then interacts with the not and these variables change then their values are saved. Each time the user returns and is identified by the same client id, their saved state is reloaded.

Default Variables

New config option properties which will load a set of default property values into each new conversation as it is initiated. New conversations are defined by a unique client id

files:aiml:properties:$BOT_ROOT/config/properties.txt

Saving Variables

Conversation state storage is configured by the conversations configuration element of the bot section of the configuration file.

The first sectionconversations defines thetype of storage, and thenconfig_name points to the type specific configuration section. A 3rd optionempty_on_start allows the bot to clear down previous conversations, useful during development and debugging.

Currently, only file system storage is supported, but it is envisaged that various other mechanisms will be added such as SQL, NoSQL, Redis etc

bot:conversations:type:fileconfig_name:file_storageempty_on_start:truefile_storage:dir:$BOT_ROOT/conversations

In the example above, we specify the storage type asfile, which then points tofile_storage, which only needs 1 config item, that of the folder to store conversations in. The system uses this folder to store a single file for each unique client containing name-value pairs of all variables.

Email:keiffster@gmail.com | Twitter:@keiffster | Facebook:keith.sterling | LinkedIn:keithsterling |My Blog

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp