mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
style(anthropic): ruff format batches files
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
8d04196b79
commit
0502cc4a67
3 changed files with 16 additions and 5 deletions
|
|
@ -18,7 +18,9 @@ if TYPE_CHECKING:
|
|||
else:
|
||||
LiteLLMLoggingObj = Any
|
||||
|
||||
_EMPTY_PARAMS: Final[dict] = {} # mutable-ok: shared empty mapping for signatures that declare dict; every callee here only reads it
|
||||
_EMPTY_PARAMS: Final[
|
||||
dict
|
||||
] = {} # mutable-ok: shared empty mapping for signatures that declare dict; every callee here only reads it
|
||||
_EMPTY_MESSAGES: Final[list] = [] # mutable-ok: shared empty list for the messages signature; callees only read it
|
||||
|
||||
from ..common_utils import AnthropicModelInfo
|
||||
|
|
@ -207,7 +209,9 @@ class AnthropicBatchesHandler:
|
|||
if not resolved_api_key:
|
||||
raise ValueError("Missing Anthropic API Key")
|
||||
|
||||
resolved_logging_obj: Final = logging_obj or self._default_logging_obj(call_type="batch_list", call_id="batch_list")
|
||||
resolved_logging_obj: Final = logging_obj or self._default_logging_obj(
|
||||
call_type="batch_list", call_id="batch_list"
|
||||
)
|
||||
|
||||
list_url: Final = self.provider_config.get_list_batches_url(
|
||||
api_base=resolved_api_base,
|
||||
|
|
|
|||
|
|
@ -92,7 +92,9 @@ class AnthropicMessageBatchList(TypedDict, total=False):
|
|||
_ANTHROPIC_MESSAGE_BATCH_ADAPTER: Final = TypeAdapter(AnthropicMessageBatch)
|
||||
_ANTHROPIC_MESSAGE_BATCH_LIST_ADAPTER: Final = TypeAdapter(AnthropicMessageBatchList)
|
||||
_OBJECT_DICT_ADAPTER: Final = TypeAdapter(dict[str, object])
|
||||
_EMPTY_PARAMS: Final[dict] = {} # mutable-ok: shared empty mapping for signatures that declare dict; callees only read it
|
||||
_EMPTY_PARAMS: Final[
|
||||
dict
|
||||
] = {} # mutable-ok: shared empty mapping for signatures that declare dict; callees only read it
|
||||
_EMPTY_METADATA: Final[dict] = {} # mutable-ok: shared empty LiteLLMBatch metadata; callers never mutate it
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -260,11 +260,16 @@ async def _create_anthropic_batch_for_managed_file(
|
|||
extra_body: Final = (
|
||||
cast( # cast-ok: extra_body is declared dict[str, str] but the Anthropic requests array is a list value
|
||||
"dict[str, str]",
|
||||
{**(create_batch_data.get("extra_body") or EMPTY_MAPPING), "requests": list(requests)}, # mutable-ok: one-shot payload build; the requests contract requires list
|
||||
{
|
||||
**(create_batch_data.get("extra_body") or EMPTY_MAPPING),
|
||||
"requests": list(requests),
|
||||
}, # mutable-ok: one-shot payload build; the requests contract requires list
|
||||
)
|
||||
)
|
||||
request: Final[LiteLLMBatchCreateRequest] = {
|
||||
**{key: value for key, value in create_batch_data.items() if key != "model_file_id_mapping"}, # mutable-ok: one-shot rebuild without the managed-files key; the request contract requires dict
|
||||
**{
|
||||
key: value for key, value in create_batch_data.items() if key != "model_file_id_mapping"
|
||||
}, # mutable-ok: one-shot rebuild without the managed-files key; the request contract requires dict
|
||||
"model": model,
|
||||
"input_file_id": input_file_id,
|
||||
"disable_fallbacks": True,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue