You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The langchain_core's current implementation of Serializable and Reviver modules makes it hard/impossible to work with custom objects. This is because the Reviver module requires the class namespace to be passed in the valid_namespaces argument for non-langchain objects. But if a developer uses another custom object in their object, they will have to pass all the associated namespaces and makes it very hard to use.
In the shared example, if the code is being run in a jupyter notebook, one would have to pass valid_namespaces=['main'] when calling loads() method. But if a different user uses the GatewayRequestInfo object in their code, they would have to add both their object's namespace and the GatewayRequestInfo's namespace for the deserialization to work.
In short, could it be possible to remove the condition on namespaces? That fixes this issue
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
The langchain_core's current implementation of Serializable and Reviver modules makes it hard/impossible to work with custom objects. This is because the Reviver module requires the class namespace to be passed in the valid_namespaces argument for non-langchain objects. But if a developer uses another custom object in their object, they will have to pass all the associated namespaces and makes it very hard to use.
In the shared example, if the code is being run in a jupyter notebook, one would have to pass valid_namespaces=['main'] when calling loads() method. But if a different user uses the GatewayRequestInfo object in their code, they would have to add both their object's namespace and the GatewayRequestInfo's namespace for the deserialization to work.
In short, could it be possible to remove the condition on namespaces? That fixes this issue
System Info
pip freeze|grep langchain
langchain==0.2.16
langchain-anthropic==0.1.23
langchain-cli==0.0.31
langchain-community==0.2.17
langchain-core==0.2.40
langchain-experimental==0.0.65
langchain-text-splitters==0.2.2
langchainplus-sdk==0.0.21
Beta Was this translation helpful? Give feedback.
All reactions