mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-28 10:49:56 +02:00
Exclude shared
This commit is contained in:
@@ -781,6 +781,6 @@ def _get_schema(
|
||||
),
|
||||
)
|
||||
for k in schemas[typ]
|
||||
if isinstance(channels[k], BaseChannel)
|
||||
if k in channels and isinstance(channels[k], BaseChannel)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -10,6 +10,7 @@ from pydantic.v1 import BaseModel
|
||||
from typing_extensions import Annotated, NotRequired, Required, TypedDict
|
||||
|
||||
from langgraph.graph.state import StateGraph, _warn_invalid_state_schema
|
||||
from langgraph.managed.shared_value import SharedValue
|
||||
|
||||
|
||||
class State(BaseModel):
|
||||
@@ -116,6 +117,9 @@ def test_state_schema_optional_values(total_: bool):
|
||||
|
||||
class State(InputState): # this would be ignored
|
||||
val4: dict
|
||||
some_shared_channel: Annotated[str, SharedValue.on("assistant_id")] = field(
|
||||
default="foo"
|
||||
)
|
||||
|
||||
builder = StateGraph(State, input=InputState, output=OutputState)
|
||||
builder.add_node("n", lambda x: x)
|
||||
@@ -180,6 +184,9 @@ def test_state_schema_default_values(kw_only_: bool):
|
||||
val11: Annotated[list[str], "annotated list"] = field(
|
||||
default_factory=lambda: ["a", "b"]
|
||||
)
|
||||
some_shared_channel: Annotated[str, SharedValue.on("assistant_id")] = field(
|
||||
default="foo"
|
||||
)
|
||||
|
||||
builder = StateGraph(InputState)
|
||||
builder.add_node("n", lambda x: x)
|
||||
|
||||
Reference in New Issue
Block a user