Hello!
Whenever I define a state as TypedDict as described in the guide, e.g.,
class OverallState(TypedDict):
foo: str
user_input: str
graph_output: str
def node_1(state: InputState) -> OverallState:
# Write to OverallState
return {"foo": state["user_input"] + " name"}
node_1 function returns the state but the actual returned value is just a patch of the state (and it makes sense), but as such I get warnings from mypy like
Missing key “graph_output” for TypedDict “OverallState” [typeddict-item]
I could make all dict properties NotRequired but the input for instance I’d like to keep it mandatory.
How do you usually deal with this?
Thank!