mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
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:
parent
b39fd06037
commit
1e7d04a065
1 changed files with 10 additions and 5 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue