mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-27 06:18:05 +00:00
nit
This commit is contained in:
@@ -96,16 +96,15 @@ class Reviver:
|
|||||||
):
|
):
|
||||||
[*namespace, name] = value["id"]
|
[*namespace, name] = value["id"]
|
||||||
|
|
||||||
|
mapping_key = tuple(namespace + [name])
|
||||||
|
|
||||||
if namespace[0] not in self.valid_namespaces:
|
if namespace[0] not in self.valid_namespaces:
|
||||||
raise ValueError(f"Invalid namespace: {value}")
|
raise ValueError(f"Invalid namespace: {value}")
|
||||||
|
|
||||||
# The root namespace "langchain" is not a valid identifier.
|
# The root namespace "langchain" is not a valid identifier.
|
||||||
if len(namespace) == 1 and namespace[0] == "langchain":
|
elif len(namespace) == 1 and namespace[0] == "langchain":
|
||||||
raise ValueError(f"Invalid namespace: {value}")
|
raise ValueError(f"Invalid namespace: {value}")
|
||||||
|
# Default namespace that has explicit import path
|
||||||
# If namespace is in mapping, used custom path
|
elif (
|
||||||
mapping_key = tuple(namespace + [name])
|
|
||||||
if (
|
|
||||||
namespace[0] in DEFAULT_NAMESPACES
|
namespace[0] in DEFAULT_NAMESPACES
|
||||||
and mapping_key in ALL_SERIALIZABLE_MAPPINGS
|
and mapping_key in ALL_SERIALIZABLE_MAPPINGS
|
||||||
):
|
):
|
||||||
|
Reference in New Issue
Block a user