mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-29 06:33:28 +00:00
typing: annotate cache scope tuples
This commit is contained in:
parent
48c556e6cf
commit
882e2709ca
1 changed files with 2 additions and 2 deletions
|
|
@ -393,13 +393,13 @@ class Cache:
|
|||
return value if isinstance(value, Mapping) else {}
|
||||
|
||||
litellm_params: Final = as_mapping(kwargs.get("litellm_params"))
|
||||
metadata_sources: Final = tuple( # comprehension-ok: flatten trusted metadata containers
|
||||
metadata_sources: Final[tuple[Mapping[str, object], ...]] = tuple( # comprehension-ok: flatten trusted metadata containers
|
||||
as_mapping(source.get(key))
|
||||
for source in (kwargs, litellm_params)
|
||||
for key in ("metadata", "litellm_metadata")
|
||||
)
|
||||
|
||||
scope_values: Final = tuple(
|
||||
scope_values: Final[tuple[tuple[str, object | None], ...]] = tuple(
|
||||
(
|
||||
field,
|
||||
next((source[field] for source in metadata_sources if source.get(field) is not None), None),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue