mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
fix linting errors
This commit is contained in:
parent
8eb73381d6
commit
a4eb32f4f3
2 changed files with 12 additions and 11 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue