Fix greptile review

This commit is contained in:
Sameer Kankute 2026-04-08 22:08:52 +05:30
parent e748aa8e16
commit 64cbadb216
No known key found for this signature in database
2 changed files with 10 additions and 4 deletions

View file

@ -58,9 +58,10 @@ from litellm.llms.lemonade.cost_calculator import (
cost_per_token as lemonade_cost_per_token,
)
from litellm.llms.openai.cost_calculation import (
_video_output_cost_per_second,
cost_per_second as openai_cost_per_second,
cost_per_token as openai_cost_per_token,
)
from litellm.llms.openai.cost_calculation import cost_per_token as openai_cost_per_token
from litellm.llms.perplexity.cost_calculator import (
cost_per_token as perplexity_cost_per_token,
)
@ -2038,8 +2039,6 @@ def default_video_cost_calculator(
if video_cost_per_second is not None:
return video_cost_per_second * duration_seconds
from litellm.llms.openai.cost_calculation import _video_output_cost_per_second
output_cost_per_second = _video_output_cost_per_second(cost_info, video_resolution)
if output_cost_per_second is not None:
return output_cost_per_second * duration_seconds

View file

@ -129,7 +129,14 @@ def cost_per_second(
def _video_resolution_to_cost_field_suffix(resolution: str) -> Optional[str]:
"""Map usage resolution to a safe suffix for ``output_cost_per_second_<suffix>`` keys."""
"""
Map usage resolution to a safe suffix for ``output_cost_per_second_<suffix>`` keys.
Note: Currently only ``output_cost_per_second_1080p`` is explicitly declared in
ModelInfo (types/utils.py). Other resolution tiers (e.g., 720p, 4k) can be added
to model_prices_and_context_window.json but are not exposed via get_model_info()
until added to the ModelInfo TypedDict.
"""
r = resolution.strip().lower()
if not r:
return None