The model could not answer. resting is the one reason that is not a fault: the time the
grown-ups allow for thinking is used up for now, which the child is told differently.
16impl ModelError { 17 pub fn new(reason: impl Into<String>) -> Self { 18 Self { reason: reason.into(), resting: false } 19 } 20 21 pub fn resting(reason: impl Into<String>) -> Self { 22 Self { reason: reason.into(), resting: true } 23 } 24} 25#[derive(Debug)] 26pub struct GuardError(pub String); 27#[derive(Debug)] 28pub struct LogError(pub String); 29#[derive(Debug)] 30pub struct PictureError(pub String); 31#[derive(Debug)] 32pub struct MemoryError(pub String); 33#[derive(Debug)] 34pub struct EmbedError(pub String); 35#[derive(Debug)] 36pub struct RankError(pub String); 37#[derive(Debug)] 38pub struct ChatError(pub String); 39#[derive(Debug)] 40pub struct IconError(pub String);
Where a turn failed, for the log.
The language model, reached through the gateway. The last turn in
history is the one to answer and may carry pictures.
Decides whether a message may pass, judged for a child of age. An Err is not an
Allow: the pipeline treats a guard it cannot reach as a refusal. The guard is given the
age and nothing else about the child: the name cannot reach it.
The parents' record. Append-only.
Keeps what she shows Whiskers, so the parents can see it too.
What Whiskers remembers between conversations.
Gives a fact its picture if it has none yet (the first choice is kept).
82 fn give_icon(&mut self, id: u64, icon: IconId) -> Result<Fact, MemoryError>;
She puts a fact away: it stays, the parents still see it, Whiskers stops using it. Not forget.
84 fn hide(&mut self, id: u64, at_ms: u64) -> Result<Fact, MemoryError>;
A parent restores a fact she put away.
86 fn restore(&mut self, id: u64, at_ms: u64) -> Result<Fact, MemoryError>;
What this device knows, for another to merge.
88 fn snapshot(&self) -> MemorySnapshot;
Takes in what another device knows. Returns how many facts changed here.
Chooses the picture for a fact from the admitted set. Ok(None) is an answer ("none fits"); an Err is
"could not decide" and is worth trying again later. Never an error shown to the child: a fact with no picture
simply shows a generic star.
Chooses nothing; for a device with no service to ask.
101pub struct NoIcons;
Turns text into vectors that are close when the meanings are.
Says how well each candidate memory fits a message: a probability each, same order.
Keeps the running chat between launches.