style: format metadata forwarding condition

This commit is contained in:
与世无争剑宇子 2026-10-19 13:28:06 +08:00
parent 8d29f8738f
commit be110a0b68

View file

@ -2681,9 +2681,7 @@ def _complete_custom_openai(
# OpenAI accepts request metadata independently of preview features. Other
# providers keep the existing preview gate because compatible providers may
# reject the field.
if metadata is not None and (
custom_llm_provider == "openai" or litellm.enable_preview_features
):
if metadata is not None and (custom_llm_provider == "openai" or litellm.enable_preview_features):
openai_metadata: Final = get_requester_metadata(metadata)
if openai_metadata is not None:
optional_params["metadata"] = openai_metadata