19 lines
607 B
Python
19 lines
607 B
Python
"""Abstract persistence API for iframe embed session → thread mappings."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from abc import ABC, abstractmethod
|
|
from typing import Any
|
|
|
|
|
|
class EmbedSessionStore(ABC):
|
|
@abstractmethod
|
|
async def upsert(self, session_id: str, thread_id: str) -> dict[str, Any]:
|
|
"""Create or update the mapping for an embed session."""
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
async def get(self, session_id: str) -> dict[str, Any] | None:
|
|
"""Return ``{session_id, thread_id, created_at, updated_at}`` or None."""
|
|
raise NotImplementedError
|