mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-02 07:13:02 +00:00
test(integration): backport the cursor responses wire test fix from #47600 to rc/1.108.0
rc/1.108.0 carries the #43935 backport, which enforces gpt-5's supports_none_reasoning_effort and supports_xhigh_reasoning_effort flags, so the test now reads the levels it parametrizes from the cost map like main does. Only this file of #47600 is taken. Its other files follow changes rc does not have
(cherry picked from commit e78f7b4602, tests/integration/providers/test_cursor_responses_wire.py only)
This commit is contained in:
parent
c8218796c7
commit
38482f7cda
1 changed files with 11 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
import json
|
||||
import os
|
||||
import uuid
|
||||
from importlib.resources import files
|
||||
from typing import Final
|
||||
|
||||
import pytest
|
||||
|
|
@ -16,8 +17,16 @@ _MODEL: Final = "gpt-5"
|
|||
_API_KEY: Final = "synthetic-cursor-key"
|
||||
_JSON_OBJECT: Final = TypeAdapter(dict[str, JsonValue])
|
||||
_PROXY_WORKERS: Final = max(1, int(os.environ.get("INTEGRATION_PROXY_WORKERS", "1")))
|
||||
_THINKING_LEVELS: Final = ("none", "minimal", "low", "medium", "high", "xhigh", "max")
|
||||
_CHAT_THINKING_LEVELS: Final = ("none", "minimal", "low", "medium", "high", "max")
|
||||
_COST_MAP: Final = TypeAdapter(dict[str, dict[str, JsonValue]])
|
||||
_MODEL_ROW: Final = _COST_MAP.validate_json(
|
||||
(files("litellm") / "model_prices_and_context_window_backup.json").read_bytes()
|
||||
)[_MODEL]
|
||||
_THINKING_LEVELS: Final = tuple(
|
||||
level
|
||||
for level in ("none", "minimal", "low", "medium", "high", "xhigh", "max")
|
||||
if _MODEL_ROW.get(f"supports_{level}_reasoning_effort") is not False
|
||||
)
|
||||
_CHAT_THINKING_LEVELS: Final = tuple(level for level in _THINKING_LEVELS if level != "xhigh")
|
||||
_RESPONSES_SUFFIXES: Final[tuple[tuple[str, dict[str, JsonValue]], ...]] = tuple(
|
||||
(f"-thinking-{level}", {"reasoning": {"effort": level}}) for level in _THINKING_LEVELS
|
||||
) + (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue