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:
woongstardev 2026-09-22 21:25:21 +09:00
parent 28f8e6d341
commit ee86931b0d
2 changed files with 14 additions and 2 deletions

View file

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

View file

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