langchain dumps/loads unable to serialize/deserialize models that inherit from langchain models #30076
Open
5 tasks done
Labels
Ɑ: core
Related to langchain-core
Checked other resources
Example Code
Adding below a sample code along with the error stack trace:
Error Message and Stack Trace (if applicable)
Description
We use langchain heavily in our organization including writing custom wrappers on top of langchain models.
However, langchain loads/dumps methods doesn't seem to support serializing such custom models.
In this case, although the
GatewayGeneration
is a custom model, it somehow mapping it to langchain's namespace but when trying to load, it unable to findGatewayGeneration
.With completely custom models that do not inherit from langchain ones, we can make the serialization work by provided
valid_namespaces
argument. But in this case, it is incorrect mapping to a different namespace and resulting in errors.System Info
Standard langchain==0.3 installation.
The text was updated successfully, but these errors were encountered: