mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
fix(lint): use builtin generics in build_mid_stream_continuation_messages
Swap List[...] -> list[...] in the new helper so the change adds 0 UP006 violations; the litellm_internal_staging strict-rule budget is tighter than litellm_oss_branch and flagged the 4 added annotations.
This commit is contained in:
parent
cb2b69d90d
commit
fa070c2650
1 changed files with 4 additions and 4 deletions
|
|
@ -40,11 +40,11 @@ def _prefill_explicitly_unsupported(model_group: Optional[str]) -> bool:
|
|||
|
||||
|
||||
def build_mid_stream_continuation_messages(
|
||||
messages: List[Any],
|
||||
messages: list[Any],
|
||||
generated_content: str,
|
||||
model_group: Optional[str],
|
||||
fallbacks: Optional[List[Any]] = None,
|
||||
) -> List[Any]:
|
||||
fallbacks: Optional[list[Any]] = None,
|
||||
) -> list[Any]:
|
||||
"""Build the message list a mid-stream fallback uses to resume an interrupted stream.
|
||||
|
||||
By default the partial response is appended as a prefixed assistant message,
|
||||
|
|
@ -63,7 +63,7 @@ def build_mid_stream_continuation_messages(
|
|||
configured fallback target for this model group is explicitly marked as
|
||||
not supporting prefill.
|
||||
"""
|
||||
candidate_models: List[Optional[str]] = [model_group]
|
||||
candidate_models: list[Optional[str]] = [model_group]
|
||||
if fallbacks is not None and model_group is not None:
|
||||
try:
|
||||
# Shallow copy: get_fallback_model_group POPS a matching entry from
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue