mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-10 15:28:14 -05:00
26 lines
778 B
Python
26 lines
778 B
Python
from __future__ import annotations
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
from openhands.core.config.openhands_config import OpenHandsConfig
|
|
from openhands.storage.data_models.settings import Settings
|
|
|
|
|
|
class SettingsStore(ABC):
|
|
"""Storage for ConversationInitData. May or may not support multiple users depending on the environment."""
|
|
|
|
@abstractmethod
|
|
async def load(self) -> Settings | None:
|
|
"""Load session init data."""
|
|
|
|
@abstractmethod
|
|
async def store(self, settings: Settings) -> None:
|
|
"""Store session init data."""
|
|
|
|
@classmethod
|
|
@abstractmethod
|
|
async def get_instance(
|
|
cls, config: OpenHandsConfig, user_id: str | None
|
|
) -> SettingsStore:
|
|
"""Get a store for the user represented by the token given."""
|