PR was blocked by .github/workflows/guard-fork-dependencies.yml: fork PRs cannot modify uv.lock. Reverting: - uv.lock + pyproject.toml black bump (24.10.0 -> 26.3.1) and the 295 files of mechanical Black 26 reformat coupled to it - pyproject.toml diskcache extra change (kept the runtime mitigation in litellm/caching/disk_cache.py via JSONDisk) Kept: - Dockerfile cache narrowing (drops ~660 MB of uv build cache that surfaced cached setuptools as CVE findings) - litellm/caching/disk_cache.py: dc.JSONDisk to neutralize CVE-2025-69872 - ui/litellm-dashboard/package-lock.json + litellm-js/spend-logs/package-lock.json: next/postcss/hono/uuid CVE bumps (these are not blocked by the fork guard) - tests/test_litellm/caching/test_disk_cache.py - tests/code_coverage_tests/liccheck.ini: harmless black authorization Black + gitpython + langchain dep upgrades will need a follow-up from a maintainer pushing a branch in the canonical BerriAI/litellm repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
42 lines
912 B
Python
42 lines
912 B
Python
"""Anthropic error format type definitions."""
|
|
|
|
from typing_extensions import Literal, Required, TypedDict
|
|
|
|
|
|
# Known Anthropic error types
|
|
# Source: https://docs.anthropic.com/en/api/errors
|
|
AnthropicErrorType = Literal[
|
|
"invalid_request_error",
|
|
"authentication_error",
|
|
"permission_error",
|
|
"not_found_error",
|
|
"request_too_large",
|
|
"rate_limit_error",
|
|
"api_error",
|
|
"overloaded_error",
|
|
]
|
|
|
|
|
|
class AnthropicErrorDetail(TypedDict):
|
|
"""Inner error detail in Anthropic format."""
|
|
|
|
type: AnthropicErrorType
|
|
message: str
|
|
|
|
|
|
class AnthropicErrorResponse(TypedDict, total=False):
|
|
"""
|
|
Anthropic-formatted error response.
|
|
|
|
Format:
|
|
{
|
|
"type": "error",
|
|
"error": {"type": "...", "message": "..."},
|
|
"request_id": "req_..." # optional
|
|
}
|
|
"""
|
|
|
|
type: Required[Literal["error"]]
|
|
error: Required[AnthropicErrorDetail]
|
|
request_id: str
|