mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
chore(ollama): mark the object cast at the helper call sites as cast-ok
The loop value is untyped dict content, so widening it to object is the only way to hand it to the typed helper without a new unknown-argument report. Names the LIT006 suppression and its reason as the gate expects
This commit is contained in:
parent
28f8e6d341
commit
ee86931b0d
2 changed files with 14 additions and 2 deletions
|
|
@ -172,7 +172,13 @@ class OllamaChatConfig(BaseConfig):
|
|||
optional_params["format"] = value["json_schema"]["schema"]
|
||||
if (
|
||||
param == "reasoning_effort"
|
||||
and (think := think_from_reasoning_effort(model, cast(object, value))) is not None
|
||||
and (
|
||||
think := think_from_reasoning_effort(
|
||||
model,
|
||||
cast(object, value), # cast-ok: [LIT006] untyped dict value, widened to object for the helper
|
||||
)
|
||||
)
|
||||
is not None
|
||||
):
|
||||
optional_params["think"] = think
|
||||
### FUNCTION CALLING LOGIC ###
|
||||
|
|
|
|||
|
|
@ -216,7 +216,13 @@ class OllamaConfig(BaseConfig):
|
|||
optional_params["stop"] = value
|
||||
elif (
|
||||
param == "reasoning_effort"
|
||||
and (think := think_from_reasoning_effort(model, cast(object, value))) is not None
|
||||
and (
|
||||
think := think_from_reasoning_effort(
|
||||
model,
|
||||
cast(object, value), # cast-ok: [LIT006] untyped dict value, widened to object for the helper
|
||||
)
|
||||
)
|
||||
is not None
|
||||
):
|
||||
optional_params["think"] = think
|
||||
elif param == "response_format" and isinstance(value, dict):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue