Package com.axelor.ai.chat
Class ChatReads
java.lang.Object
com.axelor.ai.chat.ChatReads
What entered a chat, and whether a model may receive it.
A value the assistant was handed stays in the chat: the next turn sends the history again, perhaps to a model the user switched to, and so do the utility calls — a title, a summary. A chat therefore keeps the fields whose values entered it, and a model it goes to must be allowed to receive every one of them. Kept as fields, so the question is asked afresh each time, of the permissions and restrictions as they are then.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA model call refused for what the chat holds; the client offers a new chat for it.static final recordWhat a check of the chat's data against a request's model depends on: the fields that entered it, which are only ever added, so their count moves with them; the agents' permissions and the restrictions in force; and the model, with its provider. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanWhether the access's destination may receive everything that entered the chat.static StringA refused consultation's output, for the calling model: the turn goes on without the consulted agent, so it says what happened and what to do, not what the user should.static StringWhy a consultation was refused, for the usage log: in the reader's language, as a turn's is.static longHow many fields entered the chat.static List<Access.Read> The fields whose values entered the chat.static voidKeeps the fields the access handed over in the chat.static Stringrefusal()The refusal for a turn whose model may not receive what the chat holds.static voidrequire(ChatRequest request) Refuses a model call whose model may not receive what the chat holds, logging it: checked before every call of a turn, not only its first, since a consulted agent on another model may have read data during the turn that the caller's model may not receive.static ChatReads.Stampstamp(ChatRequest request) The request's stamp: one count, the rules' own stamp, and the model's destination.
-
Method Details
-
record
Keeps the fields the access handed over in the chat. Rows of their own, inserted only: the chat row is never written, whose concurrent writers already race. It is locked, though: two recorders of one chat would each find a field missing and both insert it, and the unique constraint would fail the second — a tool call whose writes had already committed among them.- Parameters:
chatId- the chat's id, or null for a call outside any chat, which keeps nothing
-
stamp
The request's stamp: one count, the rules' own stamp, and the model's destination. -
count
How many fields entered the chat. -
of
The fields whose values entered the chat. -
clears
Whether the access's destination may receive everything that entered the chat. A model that no longer exists holds nothing back. -
require
Refuses a model call whose model may not receive what the chat holds, logging it: checked before every call of a turn, not only its first, since a consulted agent on another model may have read data during the turn that the caller's model may not receive. -
consultRefusal
A refused consultation's output, for the calling model: the turn goes on without the consulted agent, so it says what happened and what to do, not what the user should. In the language the instructions are written in, as it stays in a transcript every member reads. -
consultRefused
Why a consultation was refused, for the usage log: in the reader's language, as a turn's is. -
refusal
The refusal for a turn whose model may not receive what the chat holds.
-