mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
fix(providers): keep main's reading of a dotted minor version like gpt-5.6o
This commit is contained in:
parent
86bf1983d2
commit
34b91e41cd
2 changed files with 5 additions and 2 deletions
|
|
@ -72,7 +72,7 @@ MAX_CACHE_CONTROL_BLOCKS: Final = 4
|
|||
|
||||
CACHE_BREAKPOINT_KEYS: Final = ("cache_control", "prompt_cache_breakpoint")
|
||||
OPENAI_PROMPT_CACHE_BREAKPOINT_MIN_GPT_VERSION: Final = (5, 6)
|
||||
_GPT_VERSION_PATTERN: Final = re.compile(r"^gpt-(\d+)(?:[.-](0|[1-9]\d?)(?![\da-z]))?")
|
||||
_GPT_VERSION_PATTERN: Final = re.compile(r"^gpt-(\d+)(?:\.(\d+)|-(0|[1-9]\d?)(?![\da-z]))?")
|
||||
_FINE_TUNED_BASE_PATTERN: Final = re.compile(r"^ft:([^:]+)")
|
||||
_O_SERIES_PATTERN: Final = re.compile(r"^o\d+(?:-|$)")
|
||||
OPENAI_PROMPT_CACHE_BREAKPOINT_BLOCK_TYPES: Final = frozenset(
|
||||
|
|
@ -365,7 +365,7 @@ def _named_model_breakpoint_support(model: str) -> bool | None:
|
|||
version_match: Final = _GPT_VERSION_PATTERN.match(bare_model)
|
||||
if version_match is None:
|
||||
return None
|
||||
version: Final = (int(version_match.group(1)), int(version_match.group(2) or 0))
|
||||
version: Final = (int(version_match.group(1)), int(version_match.group(2) or version_match.group(3) or 0))
|
||||
return version >= OPENAI_PROMPT_CACHE_BREAKPOINT_MIN_GPT_VERSION
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3477,6 +3477,9 @@ class TestOpenAIPromptCacheBreakpoint:
|
|||
("gpt-5.6-sol", True),
|
||||
("gpt-5.6-luna", True),
|
||||
("gpt-5.7", True),
|
||||
("gpt-5.6o", True),
|
||||
("gpt-5.10", True),
|
||||
("gpt-5.06", True),
|
||||
("gpt-6", True),
|
||||
("GPT-5.6", True),
|
||||
("gpt-5.5", False),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue