mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix: linting errors
This commit is contained in:
parent
9492fa6a7a
commit
38c0074cfb
4 changed files with 15 additions and 6 deletions
|
|
@ -37,5 +37,7 @@ def cost_calculator(
|
|||
)
|
||||
|
||||
output_cost_per_image: float = _model_info.get("output_cost_per_image") or 0.0
|
||||
num_images: int = len(image_response.data)
|
||||
num_images: int = 0
|
||||
if image_response.data:
|
||||
num_images = len(image_response.data)
|
||||
return output_cost_per_image * num_images
|
||||
|
|
|
|||
|
|
@ -19,5 +19,7 @@ def cost_calculator(
|
|||
)
|
||||
|
||||
output_cost_per_image: float = _model_info.get("output_cost_per_image") or 0.0
|
||||
num_images: int = len(image_response.data)
|
||||
num_images: int = 0
|
||||
if image_response.data:
|
||||
num_images = len(image_response.data)
|
||||
return output_cost_per_image * num_images
|
||||
|
|
|
|||
|
|
@ -457,8 +457,8 @@ class LiteLLMCompletionResponsesConfig:
|
|||
function=ChatCompletionToolParamFunctionChunk(
|
||||
name=tool["name"],
|
||||
description=tool.get("description") or "",
|
||||
parameters=tool.get("parameters", {}),
|
||||
strict=tool.get("strict", False),
|
||||
parameters=dict(tool.get("parameters", {}) or {}),
|
||||
strict=tool.get("strict", False) or False,
|
||||
),
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1567,7 +1567,7 @@ class ImageUsage(BaseLiteLLMOpenAIResponseObject):
|
|||
from openai.types.images_response import ImagesResponse as OpenAIImageResponse
|
||||
|
||||
|
||||
class ImageResponse(OpenAIImageResponse, BaseLiteLLMOpenAIResponseObject):
|
||||
class ImageResponse(BaseLiteLLMOpenAIResponseObject):
|
||||
_hidden_params: dict = {}
|
||||
usage: ImageUsage
|
||||
|
||||
|
|
@ -1609,7 +1609,12 @@ class ImageResponse(OpenAIImageResponse, BaseLiteLLMOpenAIResponseObject):
|
|||
output_tokens=0,
|
||||
total_tokens=0,
|
||||
)
|
||||
super().__init__(created=created, data=_data, usage=_usage) # type: ignore
|
||||
|
||||
#######################
|
||||
self.created = created
|
||||
self.data = _data
|
||||
self.usage = _usage
|
||||
#######################
|
||||
self._hidden_params = hidden_params or {}
|
||||
|
||||
def __contains__(self, key):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue