mirror of https://github.com/hwchase17/langchain
core[patch]: improve PydanticOutputParser typing (#18740)
This PR adds generic typing to `PydanticOutputParser` so we get a typed output from `.parse` instead of `Any`. It should provide a better DX by way of Intellisense and for anyone strictly typing. Pre-change: ![Screenshot 2024-03-07 at 10 22 31 AM](https://github.com/langchain-ai/langchain/assets/22690160/fd22dde0-9fdc-4283-b283-4c98f0bc46e5) Post-change: ![Screenshot 2024-03-07 at 10 26 31 AM](https://github.com/langchain-ai/langchain/assets/22690160/7e23d2b7-8f8c-494f-80b3-187530a173ee) I haven't dug too deep, but I think a similar change could probably be added to `JsonOutputParser` so we don't have to pull up `.parse`. Co-authored-by: Jan Nissen <jan23@gmail.com>pull/18774/head
parent
3b975c6ebe
commit
b8922480ed
Loading…
Reference in New Issue