Skip to content
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

Pydantic 2 #180

Merged
merged 18 commits into from
Oct 20, 2023
Merged

Pydantic 2 #180

merged 18 commits into from
Oct 20, 2023

Conversation

kreneskyp
Copy link
Owner

@kreneskyp kreneskyp commented Aug 22, 2023

Description

LangChain .0.0.268 enabled Pydantic 2 but supports v1 and v2. This PR updates IX to pydantic 2.

Langchain is not forcing v2 yet but trying to stay ahead of the game here.

Changes

  • various changes for Pydantic2.0 support

How Tested

  • unittests pass
  • manual testing
    • first pass smoke test: editor, chat, agent functionality tested manually and revealed a number of v2 incompatibilities not covered by unittests. all fixed. More thorough tested needed of different components.
    • @moderator
    • @pirate - memory sessions
    • @code - openai functions, artifact memory
    • @klarna / @botsmith: openAPI functions
    • @wikipedia - openai functions agent
    • @retrieval - retrieval components

TODOs

  • chromdb==0.4.6 does not support pydantic2. This is a blocker for upgrade unless a workaround can be found.

  • OpenAPI chains aren't compatible with pydantic2 yet because OpenAPISpec doesn't yet have support:

    Error

    AttributeError: type object 'OpenAPISpec' has no attribute 'from_url'
    

    Upstream fix: Pydantic v2 support for OpenAPI Specs langchain-ai/langchain#11936

@kreneskyp
Copy link
Owner Author

This will be put on hold for a while. LangChain should support v1 through end of year to give other projects like Chroma the time to migrate.

There will likely be some bit-rot in that time but this was only 1 day of work.

langchain-ai/langchain#9337

@kreneskyp kreneskyp marked this pull request as ready for review October 20, 2023 15:47
@kreneskyp kreneskyp merged commit 19778c7 into master Oct 20, 2023
6 checks passed
@kreneskyp kreneskyp deleted the pydantic2 branch October 20, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant