fix linting errors

This commit is contained in:
Ishaan Jaff
2024-08-05 08:54:04 -07:00
parent 8eb73381d6
commit a4eb32f4f3
2 changed files with 12 additions and 11 deletions
+11 -1
View File
@@ -817,9 +817,19 @@ from .utils import (
ModelResponse,
EmbeddingResponse,
ImageResponse,
TranscriptionResponse,
TextCompletionResponse,
get_provider_fields,
)
from .litellm_core_utils.logging_utils import ALL_LITELLM_RESPONSE_TYPES
ALL_LITELLM_RESPONSE_TYPES = [
ModelResponse,
EmbeddingResponse,
ImageResponse,
TranscriptionResponse,
TextCompletionResponse,
]
from .types.utils import ImageObject
from .llms.custom_llm import CustomLLM
from .llms.huggingface_restapi import HuggingfaceConfig
+1 -10
View File
@@ -7,15 +7,6 @@ Helper utils used for logging callbacks
"""
ALL_LITELLM_RESPONSE_TYPES = [
litellm.ModelResponse,
litellm.EmbeddingResponse,
litellm.ImageResponse,
litellm.TranscriptionResponse,
litellm.TextCompletionResponse,
]
def convert_litellm_response_object_to_dict(response_obj: Any) -> dict:
"""
Convert a LiteLLM response object to a dictionary
@@ -23,7 +14,7 @@ def convert_litellm_response_object_to_dict(response_obj: Any) -> dict:
"""
if isinstance(response_obj, dict):
return response_obj
for _type in ALL_LITELLM_RESPONSE_TYPES:
for _type in litellm.ALL_LITELLM_RESPONSE_TYPES:
if isinstance(response_obj, _type):
return response_obj.model_dump()