Pin langchain-core
dependency to prevent Settings UI crash
#558
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR is to be merged & released ASAP, as the latest releases are currently broken.
Context
LangChain now defines
name
as an instance field on theBaseLLM
class we inherit from. This causes an unfortunate interaction with ourname
class attribute, where it causesClass.name
to somehow always resolve to...
instead of the one stated in our class definition, which in turn is causing #555.Even though the PR was only merged roughly a week ago, this affects Jupyter AI users because the change was made to the
langchain-core
package, and was released inlangchain-core==0.1.4
.langchain==0.0.350
(the current version of LangChain we use) used a loose version specifier that allowed this problematic version to be installed, despite our existing version lock onlangchain
.You can reproduce this bug with Pydantic in Python like so:
Root cause
After doing a bit of digging, I found the root cause of this bug in Pydantic's
ModelMetaclass
definition. The metaclass excludes any keys from showing up incls.__dict__
if it's listed incls.__dict__['__fields__']
(which only contains instance fields):Tentatively, our next step is to rename this field in the LangChain source, as it seems to only be used for testing anyways. Then once that's released, we can revert this PR and bump our
langchain
version.