diff --git a/docs/docs/stylesheets/version_admonitions.css b/docs/docs/stylesheets/version_admonitions.css new file mode 100644 index 000000000..a8fcb6429 --- /dev/null +++ b/docs/docs/stylesheets/version_admonitions.css @@ -0,0 +1,38 @@ +:root { + --md-admonition-icon--version-added: url('data:image/svg+xml;charset=utf-8,'); + --md-admonition-icon--version-changed: url('data:image/svg+xml;charset=utf-8,'); +} + +.md-typeset .admonition.version-added, +.md-typeset details.version-added { + border-color: rgb(0, 191, 165); +} + +.md-typeset .version-added > .admonition-title, +.md-typeset .version-added > summary { + background-color: rgba(0, 191, 165, 0.1); +} + +.md-typeset .version-added > .admonition-title::before, +.md-typeset .version-added > summary::before { + background-color: rgb(0, 191, 165); + -webkit-mask-image: var(--md-admonition-icon--version-added); + mask-image: var(--md-admonition-icon--version-added); +} + +.md-typeset .admonition.version-changed, +.md-typeset details.version-changed { + border-color: rgb(100, 221, 23); +} + +.md-typeset .version-changed > .admonition-title, +.md-typeset .version-changed > summary { + background-color: rgba(100, 221, 23, 0.1); +} + +.md-typeset .version-changed > .admonition-title::before, +.md-typeset .version-changed > summary::before { + background-color: rgb(100, 221, 23); + -webkit-mask-image: var(--md-admonition-icon--version-changed); + mask-image: var(--md-admonition-icon--version-changed); +} \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 697d6bdc4..049a6a4ab 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -503,3 +503,5 @@ validation: not_found: info copyright: > Copyright © 2025 LangChain, Inc | Consent Preferences +extra_css: + - stylesheets/version_admonitions.css diff --git a/libs/langgraph/langgraph/types.py b/libs/langgraph/langgraph/types.py index 0a3e9f205..6fb0b9b4a 100644 --- a/libs/langgraph/langgraph/types.py +++ b/libs/langgraph/langgraph/types.py @@ -101,7 +101,10 @@ def default_retry_on(exc: Exception) -> bool: class RetryPolicy(NamedTuple): - """Configuration for retrying nodes.""" + """Configuration for retrying nodes. + + !!! version-added "Added in version 0.2.24." + """ initial_interval: float = 0.5 """Amount of time that must elapse before the first retry occurs. In seconds.""" @@ -120,13 +123,20 @@ class RetryPolicy(NamedTuple): class CachePolicy(NamedTuple): - """Configuration for caching nodes.""" + """Configuration for caching nodes. + + !!! version-added "Added in version 0.2.24." + """ pass @dataclasses.dataclass(**_DC_KWARGS) class Interrupt: + """ + !!! version-added "Added in version 0.2.24." + """ + value: Any resumable: bool = False ns: Optional[Sequence[str]] = None @@ -268,6 +278,8 @@ N = TypeVar("N", bound=Hashable) class Command(Generic[N], ToolOutputMixin): """One or more commands to update the graph's state and send messages to nodes. + !!! version-added "Added in version 0.2.24." + Args: graph: graph to send the command to. Supported values are: