added ability to override default verbose and memory when load chain … (#1153)

It is useful to be able to specify `verbose` or `memory` while still
keeping the chain's overall structure.

---------

Co-authored-by: Francisco Ingham <>
searx-query-suffixy
Francisco Ingham 1 year ago committed by GitHub
parent d2ef5d6167
commit 0b6a650cb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -463,5 +463,12 @@ def _load_chain_from_file(file: Union[str, Path], **kwargs: Any) -> Chain:
config = yaml.safe_load(f)
else:
raise ValueError("File type must be json or yaml")
# Override default 'verbose' and 'memory' for the chain
if "verbose" in kwargs:
config["verbose"] = kwargs.pop("verbose")
if "memory" in kwargs:
config["memory"] = kwargs.pop("memory")
# Load the chain from the config now.
return load_chain_from_config(config, **kwargs)

Loading…
Cancel
Save