(self, fact: str)
| 150 | self._messages.append({"role": role, "content": content}) |
| 151 | |
| 152 | def add_fact(self, fact: str) -> None: |
| 153 | fact = fact.strip() |
| 154 | if fact and fact not in self._facts: |
| 155 | self._facts.append(fact) |
| 156 | if len(self._facts) > 50: |
| 157 | self._facts = self._facts[-50:] |
| 158 | |
| 159 | def needs_condensation(self) -> bool: |
| 160 | return len(self._messages) > self.MAX_MESSAGES |
no test coverage detected