Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.
Python aiburrchatbot-frameworkdagsgenerative-aigraphshacktoberfestllmopsllmsmlopspersistent-data-structurestate-machinestate-managementvisibility
Adds cache to the .data property for state
elijahbenizzycc3b323b9fff
diff --git a/burr/core/state.py b/burr/core/state.pyindex 5b073af6..addad13e 100644--- a/burr/core/state.py+++ b/burr/core/state.py@@ -4,6 +4,7 @@ import dataclassesimport importlibimport inspectimport logging+from functools import cached_propertyfrom typing import Any, Callable, Dict, Generic, Iterator, Mapping, Optional, TypeVar, Unionfrom burr.core import serde@@ -277,7 +278,7 @@ class State(Mapping, Generic[StateType]):"""Copies state with a specific typing system"""return State(self._state, typing_system=typing_system)- @property+ @cached_propertydef data(self) -> StateType:return self._typing_system.construct_data(self) # type: ignore