initial commit

This commit is contained in:
2026-05-11 12:36:20 +05:30
commit 384cbe8019
15377 changed files with 2360544 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
from abc import ABC, abstractmethod
from inspect import isclass
from typing import (
Any,
Generic,
TypeGuard,
TypeVar,
)
from langgraph._internal._scratchpad import PregelScratchpad
V = TypeVar("V")
U = TypeVar("U")
__all__ = ("ManagedValueSpec", "ManagedValueMapping")
class ManagedValue(ABC, Generic[V]):
@staticmethod
@abstractmethod
def get(scratchpad: PregelScratchpad) -> V: ...
ManagedValueSpec = type[ManagedValue]
def is_managed_value(value: Any) -> TypeGuard[ManagedValueSpec]:
return isclass(value) and issubclass(value, ManagedValue)
ManagedValueMapping = dict[str, ManagedValueSpec]