mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-23 16:12:25 +02:00
1
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
from langgraph.graph_engine.state import (
|
||||
from langgraph.advanced_graph.state import (
|
||||
AdvancedStateGraph,
|
||||
CompiledGraphEngine,
|
||||
publish_to_channel,
|
||||
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user