Expand description
The assistant’s conversation: one thread per user that survives page navigation and reloads.
What is stored: the text of each question and of each answer, the quick
action, and where the question was asked (the label of the resolved page
context, for example PRT-000009/A · bom). Not stored: tool results,
the model’s reasoning, the page context itself. A follow-up replays the
stored text to the model and calls the tools again with the user’s
current rights, so nothing they lost access to comes back through a
tool. Only the owner reads a thread: every query here is keyed by the
user id of the actor, there is no function that takes a thread id from a
client. Threads expire after TEAMCRAFT_ASSISTANT_RETENTION_DAYS of
inactivity and go with the user.
Structs§
- Exchange
- A question and its answer to append.
- Stored
Message - One stored message, as the thread view shows it.
- Thread
- The thread of a user.
Constants§
- DEFAULT_
RETENTION_ DAYS - Default retention of an idle thread (days).
- MAX_
HISTORY_ CHARS - Most characters replayed per message.
- MAX_
HISTORY_ MESSAGES - Most messages replayed to the model on a follow-up (the newest ones).
- MAX_
STORED_ MESSAGES - Most messages kept in a thread; the oldest go first.
Functions§
- append
- Appends a question and its answer in one transaction (the thread is created on the first exchange). Questions that were cancelled or failed are never stored.
- history_
of - What a follow-up replays to the model: the newest messages, each cut.
- load
- The user’s thread, newest message last. An expired thread is deleted and reads as empty.
- purge_
expired - Deletes the idle threads of everybody (the periodic clean-up) and returns how many went.
- reset
- “New conversation”: deletes the user’s thread.
- was_
tainted - Whether an earlier answer of the thread came from a tainted run.