fix: fix linting errors

This commit is contained in:
Krrish Dholakia 2025-04-19 09:37:04 -07:00
parent ca9e2c8c4c
commit 880fd0e736

View file

@ -14,6 +14,7 @@ from litellm.types.llms.openai import ChatCompletionThinkingBlock
from litellm.types.utils import ( from litellm.types.utils import (
ChatCompletionDeltaToolCall, ChatCompletionDeltaToolCall,
ChatCompletionMessageToolCall, ChatCompletionMessageToolCall,
ChatCompletionRedactedThinkingBlock,
Choices, Choices,
Delta, Delta,
EmbeddingResponse, EmbeddingResponse,
@ -486,7 +487,14 @@ def convert_to_model_response_object( # noqa: PLR0915
) )
# Handle thinking models that display `thinking_blocks` within `content` # Handle thinking models that display `thinking_blocks` within `content`
thinking_blocks: Optional[List[ChatCompletionThinkingBlock]] = None thinking_blocks: Optional[
List[
Union[
ChatCompletionThinkingBlock,
ChatCompletionRedactedThinkingBlock,
]
]
] = None
if "thinking_blocks" in choice["message"]: if "thinking_blocks" in choice["message"]:
thinking_blocks = choice["message"]["thinking_blocks"] thinking_blocks = choice["message"]["thinking_blocks"]
provider_specific_fields["thinking_blocks"] = thinking_blocks provider_specific_fields["thinking_blocks"] = thinking_blocks