Update libs/langgraph/langgraph/managed/context.py

Co-authored-by: William FH <13333726+hinthornw@users.noreply.github.com>
This commit is contained in:
Nuno Campos
2024-08-23 13:08:56 -07:00
committed by GitHub
co-authored by William FH
parent e0898409b9
commit 1e6da19257
+1 -1
View File
@@ -36,7 +36,7 @@ class Context(ManagedValue):
def enter(cls, config: RunnableConfig, **kwargs: Any) -> Iterator[Self]:
with super().enter(config, **kwargs) as self:
if self.ctx is None:
raise ValueError("Cannot enter sync context manager.")
raise ValueError("Synchronous context manager not found. Please initialize Context value with a sync context manager, or invoke your graph asynchronously.")
ctx = (
self.ctx(config)
if signature(self.ctx).parameters.get("config")