Skip to contents

memory_conversations() keeps them in this R session's memory (lost when it ends): the store a conversation uses when none is named. folder_store() keeps them in a folder, shared by every process that opens it (Python's, Julia's and R's on the same folder): <folder>/conversations/<id>.jsonl (the records, one a line, each append locked across processes) and <folder>/trees/<turn>.jsonl (each turn's events, so another process can watch it). Files are readable by their owner only. A store of your own is a list of append(conversation, records, expect = NULL) and read(conversation, after = 0) functions (contract/conversations.md, Stores).

Usage

folder_store(folder)

memory_conversations()

Arguments

folder

The folder.

Value

A store.

Details

R cannot ask the system to flush a file to the disk: the folder store writes and closes each append (the operating system keeps it; a power cut can lose the last records), where Python's flushes each to the disk.