style: format modified files with ruff

This commit is contained in:
pfolex 2026-10-25 11:00:48 -04:00
parent 577db03ef6
commit 491401c7fa
3 changed files with 3 additions and 10 deletions

View file

@ -1659,9 +1659,7 @@ def completion_cost(
)
requested_model: Final = model
request_pricing_provider: Final = (
custom_llm_provider
if isinstance(custom_llm_provider, str)
else _get_provider_for_cost_calc(model)
custom_llm_provider if isinstance(custom_llm_provider, str) else _get_provider_for_cost_calc(model)
)
raw_candidates: Final = (
(
@ -1686,9 +1684,7 @@ def completion_cost(
for idx, (model, candidate_pricing_provider) in enumerate(potential_model_names):
try:
candidate_custom_llm_provider: str | None = (
candidate_pricing_provider or request_pricing_provider
)
candidate_custom_llm_provider: str | None = candidate_pricing_provider or request_pricing_provider
if verbose_logger.isEnabledFor(logging.DEBUG):
verbose_logger.debug("selected model name for cost calculation: %s", model)

View file

@ -151,9 +151,7 @@ class OpenAILikeChatConfig(OpenAIGPTConfig):
json_mode: bool | None = None,
) -> ModelResponse:
resolved_custom_llm_provider = (
litellm_params.get("custom_llm_provider")
if isinstance(litellm_params, dict)
else None
litellm_params.get("custom_llm_provider") if isinstance(litellm_params, dict) else None
) or (
getattr(model_response, "_hidden_params", {}).get("custom_llm_provider")
if hasattr(model_response, "_hidden_params") and isinstance(getattr(model_response, "_hidden_params"), dict)

View file

@ -122,4 +122,3 @@ def test_groq_openai_aliased_completion_cost():
)
c_raw = litellm.completion_cost(completion_response=raw_resp, model="groq/openai/gpt-oss-120b")
assert c_raw == pytest.approx(2.295e-05)