Reviver#

class langchain_core.load.load.Reviver(secrets_map: dict[str, str] | None = None, valid_namespaces: list[str] | None = None, secrets_from_env: bool = True, additional_import_mappings: dict[tuple[str, ...], tuple[str, ...]] | None = None)[source]#

Reviver for JSON objects.

Initialize the reviver.

Parameters:
  • secrets_map (dict[str, str] | None) – A map of secrets to load. If a secret is not found in the map, it will be loaded from the environment if secrets_from_env is True. Defaults to None.

  • valid_namespaces (list[str] | None) – A list of additional namespaces (modules) to allow to be deserialized. Defaults to None.

  • secrets_from_env (bool) – Whether to load secrets from the environment. Defaults to True.

  • additional_import_mappings (dict[tuple[str, ...], tuple[str, ...]] | None) – A dictionary of additional namespace mappings You can use this to override default mappings or add new mappings. Defaults to None.

Methods

__init__([secrets_map,Β valid_namespaces,Β ...])

Initialize the reviver.

__init__(secrets_map: dict[str, str] | None = None, valid_namespaces: list[str] | None = None, secrets_from_env: bool = True, additional_import_mappings: dict[tuple[str, ...], tuple[str, ...]] | None = None) β†’ None[source]#

Initialize the reviver.

Parameters:
  • secrets_map (dict[str, str] | None) – A map of secrets to load. If a secret is not found in the map, it will be loaded from the environment if secrets_from_env is True. Defaults to None.

  • valid_namespaces (list[str] | None) – A list of additional namespaces (modules) to allow to be deserialized. Defaults to None.

  • secrets_from_env (bool) – Whether to load secrets from the environment. Defaults to True.

  • additional_import_mappings (dict[tuple[str, ...], tuple[str, ...]] | None) – A dictionary of additional namespace mappings You can use this to override default mappings or add new mappings. Defaults to None.

Return type:

None