diff --git a/studio/backend/core/inference/chat_template_helpers.py b/studio/backend/core/inference/chat_template_helpers.py index f0070e4933..a77679bfc5 100644 --- a/studio/backend/core/inference/chat_template_helpers.py +++ b/studio/backend/core/inference/chat_template_helpers.py @@ -115,9 +115,7 @@ def _neutralize_tool_call_arguments(tool_calls: list) -> list: for call in tool_calls: function = call.get("function") if isinstance(call, dict) else None arguments = function.get("arguments") if isinstance(function, dict) else None - new_arguments = ( - arguments if arguments is None else _neutralize_argument_leaves(arguments) - ) + new_arguments = arguments if arguments is None else _neutralize_argument_leaves(arguments) if new_arguments is arguments or new_arguments == arguments: out.append(call) else: diff --git a/studio/backend/tests/test_control_markup_neutralize_7066.py b/studio/backend/tests/test_control_markup_neutralize_7066.py index c51af3131d..5fcb7c22b1 100644 --- a/studio/backend/tests/test_control_markup_neutralize_7066.py +++ b/studio/backend/tests/test_control_markup_neutralize_7066.py @@ -188,7 +188,11 @@ class _JinjaTokenizer: # Templates that take "tools" are rendered by passing supports = ("tools",); # by default the kwarg is dropped, standing in for a tokenizer that has no # tool support. - def __init__(self, template: str, supports: tuple = ()): + def __init__( + self, + template: str, + supports: tuple = (), + ): self._template = template self._supports = supports