A conversation is called like its program, and each call is a turn
that sees the earlier ones. Memory belongs to the conversation; the program
is unchanged, and still callable on its own. Turns are kept in a store,
and nothing in it is ever deleted: continuing from an earlier turn makes a
branch (continue_from()).
Arguments
- program
An AI function or a program.
- id
The conversation's id (letters, digits,
.,_,-): the same id in the same store opens the same conversation. Default: a new one.- store
NULL(this R session's memory), a folder,TRUE(the default folder), or a store (folder_store(),memory_conversations(), or your own).- context
all_turns()(default) orlast_turns().- earlier_without
Outputs the program now writes that its earlier turns lack (reasoning turned on, a first tool): earlier turns are shown without them.
- remembers
A program's helpers' memory:
list(answer = "conversation"),"turn", orremember(); a conversation used inside its turns,"own". Helpers remember nothing otherwise.- sends
Two sends at once (from two processes):
"queue"(the default: the second waits, then continues from the first),"refuse"(conversation-busy), or"branch".- ...
Settings for every turn (
approve,lm,plugins, ...).
Details
chat <- ai_conversation(tutor, "alex", store = "tutoring/") # the same line tomorrow opens it again
chat("Hi, I'm Alex.")
chat("What is 1/2 + 1/3?") # sees the first turn
ai_turns(chat) # a tibble: each turn, its inputs and answerEach turn's id is its call's id in the call log (rate() it), recorded
before the model is asked. A turn whose tool needs a person's answer
(approve = "changes") waits, saved: the call raises a functai_waiting
condition holding $turn, and anyone who opens the conversation answers
it with approve() or deny(), and it goes on, paying for nothing twice.