diff options
| author | batsumaru <> | 2026-09-17 11:07:06 +0900 |
|---|---|---|
| committer | batsumaru <> | 2026-09-17 11:07:06 +0900 |
| commit | c22cdbffa50ac634f7fecf080f3c3b5662e67131 (patch) | |
| tree | 9d3aba8d47c5dfc5bd4c5972edc7a3a579afbe18 /personal_agent/memory/models.py | |
| parent | 71879695b951dd30bbd6cbd25261e22ac7f8e5d1 (diff) | |
Added importance
Diffstat (limited to 'personal_agent/memory/models.py')
| -rw-r--r-- | personal_agent/memory/models.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/personal_agent/memory/models.py b/personal_agent/memory/models.py index aab2064..957f16e 100644 --- a/personal_agent/memory/models.py +++ b/personal_agent/memory/models.py @@ -15,11 +15,20 @@ class LongTermMemory: content: str category: MemoryCategory created_at: datetime + importance: int @classmethod - def create(cls, content: str, category: MemoryCategory) -> LongTermMemory: + def create( + cls, content: str, category: MemoryCategory, importance: int = 2 + ) -> LongTermMemory: + if importance not in (1, 2, 3): + raise ValueError("importance must be between 1 and 3") return cls( - id=uuid7(), content=content, category=category, created_at=datetime.now(UTC) + id=uuid7(), + content=content, + category=category, + created_at=datetime.now(UTC), + importance=importance, ) |
