initial cut at using kvstores for agent persistence

This commit is contained in:
Ashwin Bharambe 2024-09-21 21:16:26 -07:00
parent 61974e337f
commit 4eb0f30891
10 changed files with 153 additions and 120 deletions

View file

@ -5,20 +5,20 @@
# the root directory of this source tree.
from datetime import datetime
from typing import Any, List, Optional, Protocol
from typing import List, Optional, Protocol
from pydantic import BaseModel
class KVStoreValue(BaseModel):
key: str
value: Any
value: str
expiration: Optional[datetime] = None
class KVStore(Protocol):
async def set(
self, key: str, value: Any, expiration: Optional[datetime] = None
self, key: str, value: str, expiration: Optional[datetime] = None
) -> None: ...
async def get(self, key: str) -> Optional[KVStoreValue]: ...