diff --git a/litellm/types/llms/openai.py b/litellm/types/llms/openai.py index 0369ed1e204..980bdd6fde4 100644 --- a/litellm/types/llms/openai.py +++ b/litellm/types/llms/openai.py @@ -44,7 +44,7 @@ from openai.types.responses.response import ( # Handle OpenAI SDK version compatibility for Text type try: # fmt: off - from openai.types.responses.response_create_params import ( # type: ignore[attr-defined] + from openai.types.responses.response_create_params import ( Text as ResponseText, # type: ignore[attr-defined] ) @@ -1053,11 +1053,11 @@ class ResponsesAPIResponse(BaseLiteLLMOpenAIResponseObject): List[Union[ResponseOutputItem, Dict]], List[Union[GenericResponseOutputItem, OutputFunctionToolCall]], ] - parallel_tool_calls: bool + parallel_tool_calls: Optional[bool] = None temperature: Optional[float] = None - tool_choice: ToolChoice - tools: Union[List[Tool], List[ResponseFunctionToolCall], List[Dict[str, Any]]] - top_p: Optional[float] + tool_choice: Optional[ToolChoice] = None + tools: Optional[Union[List[Tool], List[ResponseFunctionToolCall], List[Dict[str, Any]]]] = None + top_p: Optional[float] = None max_output_tokens: Optional[int] = None previous_response_id: Optional[str] = None reasoning: Optional[Reasoning] = None diff --git a/tests/llm_responses_api_testing/base_responses_api.py b/tests/llm_responses_api_testing/base_responses_api.py index afb30f15f08..9a77ca6b683 100644 --- a/tests/llm_responses_api_testing/base_responses_api.py +++ b/tests/llm_responses_api_testing/base_responses_api.py @@ -57,9 +57,6 @@ def validate_responses_api_response(response, final_chunk: bool = False): assert "output" in response and isinstance( response["output"], list ), "Response should have a list 'output' field" - assert "parallel_tool_calls" in response and isinstance( - response["parallel_tool_calls"], bool - ), "Response should have a boolean 'parallel_tool_calls' field" # Optional fields with their expected types optional_fields = { @@ -69,9 +66,10 @@ def validate_responses_api_response(response, final_chunk: bool = False): "metadata": dict, "model": str, "object": str, + "parallel_tool_calls": (bool, type(None)), "temperature": (int, float, type(None)), - "tool_choice": (dict, str), - "tools": list, + "tool_choice": (dict, str, type(None)), + "tools": (list, type(None)), "top_p": (int, float, type(None)), "max_output_tokens": (int, type(None)), "previous_response_id": (str, type(None)),