🐛 fix(utils.py): handle_partial_variables now filters out partial variables with None values to prevent errors in LangChain
This commit is contained in:
parent
2b7062a3ec
commit
f25e390e8c
1 changed files with 1 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ def handle_format_kwargs(prompt, params: Dict):
|
|||
def handle_partial_variables(prompt, format_kwargs: Dict):
|
||||
partial_variables = format_kwargs.copy()
|
||||
partial_variables = {
|
||||
key: value for key, value in partial_variables.items() if value
|
||||
key: value for key, value in partial_variables.items() if value is not None
|
||||
}
|
||||
# Remove handle_keys otherwise LangChain raises an error
|
||||
partial_variables.pop("handle_keys", None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue