-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect state validation when there's generic types in pydantic.BaseModel
state schema
#4060
Comments
I get the same output, but without the |
I'm not sure this is closely related to what I posted in #4058 , but it seems that something changed in States that uses Pydantic model and broke it... Edit: it seems my problem is related to the supervisor. |
@gbaian10 the |
pydantic.BaseModel
state schema
I think this is the same issue as the one mentioned in #4074 (comment). |
@gbaian10 thanks for looking into this. But I believe this is a different issue. The serialization itself is incorrect. It's using the incorrect type ( |
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
When graph state schema has
pydantic.BaseModel
with generic types invovled. The validation does not perform correctly.In the repro example provided,
C
instead ofC[A]
is used in validation, resulting in the type ofstate.c.c
beingdict
instead ofA
.Manual validation (
g.invoke(State.model_validate(input_state))
) gives the correct result.The output of
g.invoke(input_state)
should be consistent withg.invoke(State.model_validate(input_state))
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: