Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

style: apply black formatting to transformation.py

Ethan T.6658a8ffb321
diff --git a/litellm/completion_extras/litellm_responses_transformation/transformation.py b/litellm/completion_extras/litellm_responses_transformation/transformation.py
index ab69e9ca13f..f5856ab1f45 100644
--- a/litellm/completion_extras/litellm_responses_transformation/transformation.py
+++ b/litellm/completion_extras/litellm_responses_transformation/transformation.py
@@ -240,10 +240,10 @@ class LiteLLMResponsesTransformationHandler(CompletionTransformationBridge):
if key in ("max_tokens", "max_completion_tokens"):
responses_api_request["max_output_tokens"] = value
elif key == "tools" and value is not None:
- responses_api_request[
- "tools"
- ] = self._convert_tools_to_responses_format(
- cast(List[Dict[str, Any]], value)
+ responses_api_request["tools"] = (
+ self._convert_tools_to_responses_format(
+ cast(List[Dict[str, Any]], value)
+ )
)
elif key == "response_format":
text_format = self._transform_response_format_to_text_format(value)
@@ -398,6 +398,7 @@ class LiteLLMResponsesTransformationHandler(CompletionTransformationBridge):
ResponseOutputMessage,
ResponseReasoningItem,
)
+
try:
from openai.types.responses.response_output_item import (
ResponseApplyPatchToolCall,
@@ -460,7 +461,9 @@ class LiteLLMResponsesTransformationHandler(CompletionTransformationBridge):
accumulated_tool_calls.append(tool_call_dict)
tool_call_index += 1
- elif ResponseApplyPatchToolCall is not None and isinstance(item, ResponseApplyPatchToolCall):
+ elif ResponseApplyPatchToolCall is not None and isinstance(
+ item, ResponseApplyPatchToolCall
+ ):
from litellm.responses.litellm_completion_transformation.transformation import (
LiteLLMCompletionResponsesConfig,
)
@@ -1069,9 +1072,9 @@ class OpenAiResponsesToChatCompletionStreamIterator(BaseModelResponseIterator):
)
if provider_specific_fields:
- function_chunk[
- "provider_specific_fields"
- ] = provider_specific_fields
+ function_chunk["provider_specific_fields"] = (
+ provider_specific_fields
+ )
tool_call_index = parsed_chunk.get("output_index", 0)
tool_call_chunk = ChatCompletionToolCallChunk(
@@ -1144,9 +1147,9 @@ class OpenAiResponsesToChatCompletionStreamIterator(BaseModelResponseIterator):
# Add provider_specific_fields to function if present
if provider_specific_fields:
- function_chunk[
- "provider_specific_fields"
- ] = provider_specific_fields
+ function_chunk["provider_specific_fields"] = (
+ provider_specific_fields
+ )
tool_call_index = parsed_chunk.get("output_index", 0)
tool_call_chunk = ChatCompletionToolCallChunk(