Fix issue with runnable schema output + typed_dict

This commit is contained in:
William Zhu 2024-11-18 16:45:12 -05:00
parent 5b9b8fe80f
commit acffca8bb7

View File

@ -3593,6 +3593,12 @@ class RunnableParallel(RunnableSerializable[Input, dict[str, Any]]):
== "object" == "object"
for s in self.steps__.values() for s in self.steps__.values()
): ):
for step in self.steps__.values():
for k, v in step.get_input_schema(config).model_fields.items():
if v.annotation != Any and k == "root":
return super().get_input_schema(config)
# This is correct, but pydantic typings/mypy don't think so. # This is correct, but pydantic typings/mypy don't think so.
return create_model_v2( # type: ignore[call-overload] return create_model_v2( # type: ignore[call-overload]
self.get_name("Input"), self.get_name("Input"),