From de4913c97a93c998123e528deeaf6a4da6310c40 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Sat, 1 Aug 2026 18:01:15 +0000 Subject: [PATCH] chore(typing): retype responses/main.py payload params using the base's conventions litellm_internal_staging standardized on Dict[str, object] for extra_headers, extra_query and extra_body and on Coroutine[object, object, T] for the sync/async dual-mode returns. Matching those here keeps the Any reduction without the argument- and return-type mismatches the previous Dict[str, str] and Coroutine[None, None, T] annotations produced against the new handler types. --- litellm/responses/main.py | 66 +++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/litellm/responses/main.py b/litellm/responses/main.py index 35909c87dc7..5939c2edd4b 100644 --- a/litellm/responses/main.py +++ b/litellm/responses/main.py @@ -159,8 +159,8 @@ async def aresponses_api_with_mcp( user: Optional[str] = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Optional[Dict[str, str]] = None, - extra_query: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, + extra_query: Optional[Dict[str, object]] = None, extra_body: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, # LiteLLM specific params, @@ -427,8 +427,8 @@ async def aresponses( safety_identifier: Optional[str] = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Optional[Dict[str, str]] = None, - extra_query: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, + extra_query: Optional[Dict[str, object]] = None, extra_body: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, # LiteLLM specific params, @@ -738,8 +738,8 @@ def _responses_try_dispatch_mcp_gateway( top_p: Optional[float], truncation: Optional[Literal["auto", "disabled"]], user: Optional[str], - extra_headers: Optional[Dict[str, str]], - extra_query: Optional[Dict[str, str]], + extra_headers: Optional[Dict[str, object]], + extra_query: Optional[Dict[str, object]], extra_body: Optional[Dict[str, object]], timeout: Optional[Union[float, httpx.Timeout]], custom_llm_provider: Optional[str], @@ -814,8 +814,8 @@ def _responses_try_dispatch_emulated_file_search( safety_identifier: Optional[str], text_format: Optional[Union[Type[BaseModel], dict]], allowed_openai_params: Optional[List[str]], - extra_headers: Optional[Dict[str, str]], - extra_query: Optional[Dict[str, str]], + extra_headers: Optional[Dict[str, object]], + extra_query: Optional[Dict[str, object]], extra_body: Optional[Dict[str, object]], timeout: Optional[Union[float, httpx.Timeout]], custom_llm_provider: Optional[str], @@ -906,8 +906,8 @@ def responses( safety_identifier: Optional[str] = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Optional[Dict[str, str]] = None, - extra_query: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, + extra_query: Optional[Dict[str, object]] = None, extra_body: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, # LiteLLM specific params, @@ -1163,8 +1163,8 @@ async def adelete_responses( response_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Optional[Dict[str, str]] = None, - extra_query: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, + extra_query: Optional[Dict[str, object]] = None, extra_body: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, # LiteLLM specific params, @@ -1224,14 +1224,14 @@ def delete_responses( response_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Optional[Dict[str, str]] = None, - extra_query: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, + extra_query: Optional[Dict[str, object]] = None, extra_body: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, # LiteLLM specific params, custom_llm_provider: Optional[str] = None, **kwargs, -) -> Union[DeleteResponseResult, Coroutine[None, None, DeleteResponseResult]]: +) -> Union[DeleteResponseResult, Coroutine[object, object, DeleteResponseResult]]: """ Synchronous version of the DELETE Responses API @@ -1314,8 +1314,8 @@ async def aget_responses( response_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Optional[Dict[str, str]] = None, - extra_query: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, + extra_query: Optional[Dict[str, object]] = None, extra_body: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, # LiteLLM specific params, @@ -1389,14 +1389,14 @@ def get_responses( response_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Optional[Dict[str, str]] = None, - extra_query: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, + extra_query: Optional[Dict[str, object]] = None, extra_body: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, # LiteLLM specific params, custom_llm_provider: Optional[str] = None, **kwargs, -) -> Union[ResponsesAPIResponse, Coroutine[None, None, ResponsesAPIResponse]]: +) -> Union[ResponsesAPIResponse, Coroutine[object, object, ResponsesAPIResponse]]: """ Fetch a response by its ID. @@ -1496,7 +1496,7 @@ async def alist_input_items( include: Optional[List[str]] = None, limit: int = 20, order: Literal["asc", "desc"] = "desc", - extra_headers: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, custom_llm_provider: Optional[str] = None, **kwargs, @@ -1552,11 +1552,11 @@ def list_input_items( include: Optional[List[str]] = None, limit: int = 20, order: Literal["asc", "desc"] = "desc", - extra_headers: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, custom_llm_provider: Optional[str] = None, **kwargs, -) -> Union[Dict, Coroutine[None, None, Dict]]: +) -> Union[Dict, Coroutine[object, object, Dict]]: """List input items for a response""" local_vars = locals() try: @@ -1627,8 +1627,8 @@ async def acancel_responses( response_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Optional[Dict[str, str]] = None, - extra_query: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, + extra_query: Optional[Dict[str, object]] = None, extra_body: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, # LiteLLM specific params, @@ -1688,14 +1688,14 @@ def cancel_responses( response_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Optional[Dict[str, str]] = None, - extra_query: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, + extra_query: Optional[Dict[str, object]] = None, extra_body: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, # LiteLLM specific params, custom_llm_provider: Optional[str] = None, **kwargs, -) -> Union[ResponsesAPIResponse, Coroutine[None, None, ResponsesAPIResponse]]: +) -> Union[ResponsesAPIResponse, Coroutine[object, object, ResponsesAPIResponse]]: """ Synchronous version of the POST Responses API @@ -1781,8 +1781,8 @@ async def acompact_responses( previous_response_id: Optional[str] = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Optional[Dict[str, str]] = None, - extra_query: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, + extra_query: Optional[Dict[str, object]] = None, extra_body: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, # LiteLLM specific params, @@ -1859,14 +1859,14 @@ def compact_responses( previous_response_id: Optional[str] = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Optional[Dict[str, str]] = None, - extra_query: Optional[Dict[str, str]] = None, + extra_headers: Optional[Dict[str, object]] = None, + extra_query: Optional[Dict[str, object]] = None, extra_body: Optional[Dict[str, object]] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, # LiteLLM specific params, custom_llm_provider: Optional[str] = None, **kwargs, -) -> Union[ResponsesAPIResponse, Coroutine[None, None, ResponsesAPIResponse]]: +) -> Union[ResponsesAPIResponse, Coroutine[object, object, ResponsesAPIResponse]]: """ Synchronous version of the POST Compact Responses API