mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-17 23:51:30 +00:00
Fix greptile review
This commit is contained in:
parent
e748aa8e16
commit
64cbadb216
2 changed files with 10 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue