mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-14 00:23:05 +00:00
fix linting errors
This commit is contained in:
+11
-1
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user