mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix(batches): keep cast-ok tags on the flagged cast lines for the discipline gate
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
c0b69aedb9
commit
67d4471a37
1 changed files with 4 additions and 6 deletions
|
|
@ -770,11 +770,9 @@ def set_response_cost_in_hidden_params(response: _CarriesHiddenParams, cost: flo
|
|||
def is_batch_line_item_event(kwargs: object) -> bool:
|
||||
if not isinstance(kwargs, Mapping):
|
||||
return False
|
||||
litellm_params: Final = cast(Mapping[str, object], kwargs).get(
|
||||
"litellm_params"
|
||||
) # cast-ok: isinstance narrows only to unparameterized Mapping
|
||||
typed_kwargs: Final = cast(Mapping[str, object], kwargs) # cast-ok: isinstance leaves Mapping unparameterized
|
||||
litellm_params: Final = typed_kwargs.get("litellm_params")
|
||||
if not isinstance(litellm_params, Mapping):
|
||||
return False
|
||||
return bool(
|
||||
cast(Mapping[str, object], litellm_params).get("batch_parent_id")
|
||||
) # cast-ok: same narrowing limit as above
|
||||
typed_params: Final = cast(Mapping[str, object], litellm_params) # cast-ok: same narrowing limit
|
||||
return bool(typed_params.get("batch_parent_id"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue