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.
This commit is contained in:
mateo-berri 2026-08-01 18:01:15 +00:00
parent a8b74325e0
commit de4913c97a
No known key found for this signature in database

View file

@ -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