diff --git a/src/provider_state.py b/src/provider_state.py index c1302b22..d988f3de 100644 --- a/src/provider_state.py +++ b/src/provider_state.py @@ -22,11 +22,10 @@ from dataclasses import dataclass, field from src.type_aliases import HistoryMessage, Metadata -@dataclass @dataclass class ProviderHistory: messages: list[HistoryMessage] = field(default_factory=list) - lock: threading.Lock = field(default_factory=threading.Lock) + lock: threading.RLock = field(default_factory=threading.RLock) def __bool__(self) -> bool: with self.lock: @@ -71,16 +70,6 @@ _PROVIDER_HISTORIES: dict[str, ProviderHistory] = { } -_PROVIDER_HISTORIES: dict[str, ProviderHistory] = { - "anthropic": ProviderHistory(), - "deepseek": ProviderHistory(), - "minimax": ProviderHistory(), - "qwen": ProviderHistory(), - "grok": ProviderHistory(), - "llama": ProviderHistory(), -} - - def get_history(provider: str) -> ProviderHistory: if provider not in _PROVIDER_HISTORIES: raise KeyError(f"Unknown provider: {provider!r}")