refactor(router): declare the reasoning transport options on the param models that use them

Declaring `forward_reasoning_content` and `reasoning_content_field` on
`GenericLiteLLMParams` reached every caller that builds those params from an
unannotated `**kwargs`, because basedpyright reports one unknown-argument
diagnostic per declared parameter at every such spread site: 113 sites, so the
two fields added 226 diagnostics and pushed `reportUnknownArgumentType` past its
ceiling without any of those files changing. `LiteLLM_Params` (deployment and
creation) and `updateLiteLLMParams` (model update) are the models that carry the
options, and neither is built by spreading unknown kwargs, so declaring them
there keeps the API, the generated dashboard types and the partial-update
behaviour identical while the shared signature stays as it was.
This commit is contained in:
jibanez-staticduo 2026-09-30 14:08:51 +02:00
parent b39fd06037
commit 1e7d04a065
No known key found for this signature in database

View file

@ -425,11 +425,6 @@ class GenericLiteLLMParams(CredentialLiteLLMParams, CustomPricingLiteLLMParams):
)
model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
merge_reasoning_content_in_choices: bool | None = False
forward_reasoning_content: bool | None = None
reasoning_content_field: str | None = Field(
default=None,
description="Historical assistant reasoning field: reasoning_content (default) or reasoning.",
)
model_info: dict | None = None
mock_response: str | ModelResponse | Exception | object | None = None
@ -531,6 +526,11 @@ class LiteLLM_Params(GenericLiteLLMParams):
model: str
model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
forward_reasoning_content: bool | None = None
reasoning_content_field: str | None = Field(
default=None,
description="Historical assistant reasoning field: reasoning_content (default) or reasoning.",
)
def __contains__(self, key) -> bool:
# Define custom behavior for the 'in' operator
@ -553,6 +553,11 @@ class updateLiteLLMParams(GenericLiteLLMParams):
# This class is used to update the LiteLLM_Params
# only differece is model is optional
model: str | None = None
forward_reasoning_content: bool | None = None
reasoning_content_field: str | None = Field(
default=None,
description="Historical assistant reasoning field: reasoning_content (default) or reasoning.",
)
class updateDeployment(BaseModel):