This commit is contained in:
Quanzheng Long
2026-03-12 13:31:54 -07:00
parent 4b2167dd25
commit b2dca399e8
4 changed files with 5 additions and 5 deletions
@@ -1,4 +1,4 @@
from langgraph.graph_engine.state import (
from langgraph.advanced_graph.state import (
AdvancedStateGraph,
CompiledGraphEngine,
publish_to_channel,
@@ -12,7 +12,7 @@ from langgraph.types import Command, Send
StateT = TypeVar("StateT")
_CURRENT_RUN: contextvars.ContextVar[_GraphEngineRun | None] = contextvars.ContextVar(
"langgraph_graph_engine_run", default=None
"langgraph_advanced_graph_run", default=None
)
@@ -324,7 +324,7 @@ def _normalize_goto(goto: Any, *, default_arg: Any) -> list[Send]:
async def wait_for(channel: str, n: int = 1) -> Any:
run = _CURRENT_RUN.get()
if run is None:
raise RuntimeError("wait_for() can only be used inside graph_engine nodes")
raise RuntimeError("wait_for() can only be used inside advanced_graph nodes")
return await run.wait_for(channel, n=n)
@@ -332,7 +332,7 @@ def publish_to_channel(channel: str, value: Any) -> None:
run = _CURRENT_RUN.get()
if run is None:
raise RuntimeError(
"publish_to_channel() can only be used inside graph_engine nodes"
"publish_to_channel() can only be used inside advanced_graph nodes"
)
run.publish_nowait(channel, value)
@@ -5,9 +5,9 @@ from typing import Any, Literal
import pytest
from typing_extensions import TypedDict
from langgraph.advanced_graph import AdvancedStateGraph, publish_to_channel, wait_for
from langgraph.constants import END, START
from langgraph.graph import StateGraph
from langgraph.graph_engine import AdvancedStateGraph, publish_to_channel, wait_for
from langgraph.types import Command, Send
pytestmark = pytest.mark.anyio