mirror of
https://github.com/langchain-ai/langserve.git
synced 2026-07-18 10:54:29 -04:00
Chat Widget example not working with Pydantic > 2 and langchain > 0.1.1 #101
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dentroai on GitHub (Jan 23, 2024).
The code taken from https://python.langchain.com/docs/langserve#chat-widget doesn't work with pydantic > 2 and langchain > 0.1.1
It always throws:
TypeError: Object of type 'FieldInfo' is not JSON serializableCode from the docs:
@dentroai commented on GitHub (Jan 23, 2024):
Apparently adding this import fixed it (taken from the example in the docs of the file upload widget: https://python.langchain.com/docs/langserve#file-upload-widget):