Get copy of memory chunks.
(self)
| 131 | """Set context ID for distinguishing personas.""" |
| 132 | self._context_id = context_id |
| 133 | |
| 134 | def count_tokens(self, text: str) -> int: |
| 135 | """Count tokens in text.""" |
| 136 | if not text: |
| 137 | return 0 |
| 138 | return len(self._tokenizer.encode(text)) |