forked from phoenix/litellm-mirror
fix(types/utils.py): fix linting errors
This commit is contained in:
parent
dae6659dbc
commit
b79e21a81a
1 changed files with 2 additions and 11 deletions
|
@ -1,22 +1,13 @@
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
import json
|
|
||||||
import time
|
|
||||||
import uuid
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Dict, List, Literal, Optional, Tuple, Union
|
from typing import Dict, List, Literal, Optional, Tuple, Union
|
||||||
|
|
||||||
from typing import Dict, List, Literal, Optional, Tuple, Union
|
|
||||||
|
|
||||||
from openai._models import BaseModel as OpenAIObject
|
from openai._models import BaseModel as OpenAIObject
|
||||||
from pydantic import ConfigDict
|
from pydantic import ConfigDict
|
||||||
from typing_extensions import Dict, Required, TypedDict, override
|
from typing_extensions import Dict, Required, TypedDict, override
|
||||||
|
|
||||||
from ..litellm_core_utils.core_helpers import map_finish_reason
|
|
||||||
from .llms.openai import ChatCompletionToolCallChunk, ChatCompletionUsageBlock
|
|
||||||
from typing_extensions import Dict, Required, TypedDict, override
|
|
||||||
|
|
||||||
from ..litellm_core_utils.core_helpers import map_finish_reason
|
from ..litellm_core_utils.core_helpers import map_finish_reason
|
||||||
from .llms.openai import ChatCompletionToolCallChunk, ChatCompletionUsageBlock
|
from .llms.openai import ChatCompletionToolCallChunk, ChatCompletionUsageBlock
|
||||||
|
|
||||||
|
@ -548,9 +539,9 @@ class ModelResponse(OpenAIObject):
|
||||||
new_choices = []
|
new_choices = []
|
||||||
for choice in choices:
|
for choice in choices:
|
||||||
if isinstance(choice, Choices):
|
if isinstance(choice, Choices):
|
||||||
_new_choice = choice
|
_new_choice = choice # type: ignore
|
||||||
elif isinstance(choice, dict):
|
elif isinstance(choice, dict):
|
||||||
_new_choice = Choices(**choice)
|
_new_choice = Choices(**choice) # type: ignore
|
||||||
new_choices.append(_new_choice)
|
new_choices.append(_new_choice)
|
||||||
choices = new_choices
|
choices = new_choices
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue