refactor: clean up fresh tech debt in otel baggage metadata, model budget limiter and batch line items

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Devin AI 2026-10-16 08:06:33 +00:00
parent 730ee862b6
commit 68737c457c
2 changed files with 6 additions and 3 deletions

View file

@ -25,7 +25,7 @@ from litellm.types.utils import (
BatchFileProvider: TypeAlias = Literal["openai", "azure", "vertex_ai", "hosted_vllm", "anthropic", "mistral"]
_VERTEX_AI_UNKNOWN_CUSTOM_ID: Final = "unknown" # what a Vertex AI batch row that carries no custom_id is read as
_VERTEX_AI_UNKNOWN_CUSTOM_ID: Final = "unknown"
_LINE: Final = re.compile(rb"[^\n]+")

View file

@ -36,7 +36,7 @@ model. They coincide on the SDK path, which is correct.
from __future__ import annotations
from collections.abc import Callable, Iterator, Mapping
from collections.abc import Iterator, Mapping
from dataclasses import dataclass, field
from datetime import datetime
from types import MappingProxyType
@ -132,7 +132,10 @@ class RequestIdentity:
snapshot) is flattened to dotted keys so ``requester_metadata.<key>``
resolves too.
"""
get: Final[Callable[[str], object]] = lambda name: _AUTH_ATTRIBUTE.validate_python(getattr(auth, name, None)) # noqa: E731
def get(name: str) -> object:
return _AUTH_ATTRIBUTE.validate_python(getattr(auth, name, None))
auth_meta: Final = tuple(
(meta_key, str(value))
for meta_key, attr in (