MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / InMemorySpendControlStorage

Class InMemorySpendControlStorage

uncommon_route/spend_control.py:114–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112
113
114class InMemorySpendControlStorage(SpendControlStorage):
115 def __init__(self) -> None:
116 self._data: dict[str, Any] | None = None
117
118 def load(self) -> dict[str, Any] | None:
119 return json.loads(json.dumps(self._data)) if self._data else None
120
121 def save(self, data: dict[str, Any]) -> None:
122 self._data = json.loads(json.dumps(data, default=str))
123
124
125class SpendControl:

Calls

no outgoing calls