🐛 fix(utils.py): remove unnecessary check for None value in handle_partial_variables function
🔀 refactor(utils.py): simplify dictionary comprehension in handle_partial_variables function
This commit is contained in:
parent
d01d8c2945
commit
3724876620
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 is not None
|
||||
key: value for key, value in partial_variables.items() if value
|
||||
}
|
||||
# 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