From eb75783f2f9d9e6fbce97355dcdf6d19c7194786 Mon Sep 17 00:00:00 2001 From: leecoder Date: Tue, 11 Aug 2026 14:26:55 +0900 Subject: [PATCH] style(fusion): ruff format --- litellm/fusion/main.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/litellm/fusion/main.py b/litellm/fusion/main.py index fb75fc57b41..3472b2112a9 100644 --- a/litellm/fusion/main.py +++ b/litellm/fusion/main.py @@ -95,6 +95,7 @@ FusionStrategy = Literal["single_judge", "majority_vote", "best_of_n"] # Helpers # --------------------------------------------------------------------------- + def _build_judge_messages( original_messages: list[dict], panel_responses: list[ModelResponse], @@ -193,10 +194,7 @@ async def _run_panel( panel_kwargs: dict, ) -> tuple[list[ModelResponse], list[str]]: """Fan out to all panel models in parallel; filter failed calls.""" - tasks = [ - litellm.acompletion(model=m, messages=messages, stream=False, **panel_kwargs) - for m in models - ] + tasks = [litellm.acompletion(model=m, messages=messages, stream=False, **panel_kwargs) for m in models] raw: list = list(await asyncio.gather(*tasks, return_exceptions=True)) valid_responses: list[ModelResponse] = [] @@ -218,6 +216,7 @@ async def _run_panel( # Overloads for precise return-type inference # --------------------------------------------------------------------------- + @overload async def afusion( models: List[str], @@ -252,6 +251,7 @@ async def afusion( # Core async implementation # --------------------------------------------------------------------------- + async def afusion( models: List[str], messages: list, @@ -291,9 +291,7 @@ async def afusion( if not models: raise ValueError("fusion: `models` must be a non-empty list") if strategy not in _JUDGE_PROMPTS: - raise ValueError( - f"fusion: unknown strategy {strategy!r}. Choose from {list(_JUDGE_PROMPTS)}" - ) + raise ValueError(f"fusion: unknown strategy {strategy!r}. Choose from {list(_JUDGE_PROMPTS)}") panel_kwargs: dict = dict(kwargs) if temperature is not None: @@ -345,6 +343,7 @@ async def afusion( # Sync overloads # --------------------------------------------------------------------------- + @overload def fusion( models: List[str],