You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am a LangChain maintainer, or was asked directly by a LangChain maintainer to create an issue here.
Issue Content
MRE
frompydanticimportBaseModel, Fieldfromlanggraph.graphimportStateGraphclassFoo(BaseModel):
foo: str=Field(alias='bar')
# Define a new graphgraph_builder=StateGraph(
Foo
)
defnode(foo: Foo):
print(foo)
returnNone# Add the node to the graphgraph_builder.add_node("node", node)
# Set the entrypoint as `call_model`graph_builder.add_edge("__start__", "node")
# Compile the workflow into an executable graphgraph=graph_builder.compile()
graph.invoke({'bar': 'hello'})
Expected behavior
The alias should be respected and the field foo should be only updateable by alias.
Observed behavior
Validation error.
Context
Mostly a problem for IO boundaries (since that's where I actually use pydantic models)
alias is needed in some cases to avoid name collisions (e.g., schema field is already taken by pydantic)
The text was updated successfully, but these errors were encountered:
I've looked into the issue and I'm interested in working on fixing it right away. Please let me know if there's anything further I should know about it.
Privileged issue
Issue Content
MRE
Expected behavior
The alias should be respected and the field
foo
should be only updateable by alias.Observed behavior
Validation error.
Context
schema
field is already taken by pydantic)The text was updated successfully, but these errors were encountered: