mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-09-27 15:02:39 +03:00
fix(llm): treat deepseek-flash as a thinking model (#1389)
This commit is contained in:
@@ -25,6 +25,17 @@ class TestExactIdMatches:
|
|||||||
assert caps.supports_tool_choice is False
|
assert caps.supports_tool_choice is False
|
||||||
assert caps.requires_reasoning_content_roundtrip is True
|
assert caps.requires_reasoning_content_roundtrip is True
|
||||||
|
|
||||||
|
def test_deepseek_flash_alias_rejects_tool_choice(self):
|
||||||
|
"""``deepseek-flash`` is what the model picker offers for V4.1 Flash.
|
||||||
|
|
||||||
|
It was falling through to _DEFAULT (tool_choice on), so every
|
||||||
|
structured-output call 400'd with "Thinking mode does not support
|
||||||
|
this tool_choice" and burned a retry as free text.
|
||||||
|
"""
|
||||||
|
caps = get_capabilities("deepseek-flash")
|
||||||
|
assert caps.supports_tool_choice is False
|
||||||
|
assert caps.requires_reasoning_content_roundtrip is True
|
||||||
|
|
||||||
def test_deepseek_v4_pro_rejects_tool_choice(self):
|
def test_deepseek_v4_pro_rejects_tool_choice(self):
|
||||||
caps = get_capabilities("deepseek-v4-pro")
|
caps = get_capabilities("deepseek-v4-pro")
|
||||||
assert caps.supports_tool_choice is False
|
assert caps.supports_tool_choice is False
|
||||||
@@ -48,6 +59,10 @@ class TestPatternMatches:
|
|||||||
caps = get_capabilities("deepseek-reasoner-pro")
|
caps = get_capabilities("deepseek-reasoner-pro")
|
||||||
assert caps.supports_tool_choice is False
|
assert caps.supports_tool_choice is False
|
||||||
|
|
||||||
|
def test_future_flash_variant_inherits_thinking_quirks(self):
|
||||||
|
caps = get_capabilities("deepseek-flash-lite")
|
||||||
|
assert caps.supports_tool_choice is False
|
||||||
|
|
||||||
def test_minimax_m3_inherits_thinking_quirks(self):
|
def test_minimax_m3_inherits_thinking_quirks(self):
|
||||||
caps = get_capabilities("MiniMax-M3")
|
caps = get_capabilities("MiniMax-M3")
|
||||||
assert caps.supports_tool_choice is False
|
assert caps.supports_tool_choice is False
|
||||||
@@ -128,6 +143,9 @@ class TestOpenRouterDeepSeekNamespace:
|
|||||||
def test_prefixed_reasoner_suppresses_tool_choice(self):
|
def test_prefixed_reasoner_suppresses_tool_choice(self):
|
||||||
assert get_capabilities("deepseek/deepseek-reasoner").supports_tool_choice is False
|
assert get_capabilities("deepseek/deepseek-reasoner").supports_tool_choice is False
|
||||||
|
|
||||||
|
def test_prefixed_flash_alias_suppresses_tool_choice(self):
|
||||||
|
assert get_capabilities("deepseek/deepseek-flash").supports_tool_choice is False
|
||||||
|
|
||||||
def test_prefixed_chat_selects_deepseek_chat_not_default(self):
|
def test_prefixed_chat_selects_deepseek_chat_not_default(self):
|
||||||
# Must resolve to _DEEPSEEK_CHAT, not _DEFAULT: supports_json_schema=False
|
# Must resolve to _DEEPSEEK_CHAT, not _DEFAULT: supports_json_schema=False
|
||||||
# is what distinguishes them (both keep tool_choice).
|
# is what distinguishes them (both keep tool_choice).
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ _DEFAULT = ModelCapabilities(
|
|||||||
_BY_ID: dict[str, ModelCapabilities] = {
|
_BY_ID: dict[str, ModelCapabilities] = {
|
||||||
"deepseek-chat": _DEEPSEEK_CHAT,
|
"deepseek-chat": _DEEPSEEK_CHAT,
|
||||||
"deepseek-reasoner": _DEEPSEEK_THINKING,
|
"deepseek-reasoner": _DEEPSEEK_THINKING,
|
||||||
|
"deepseek-flash": _DEEPSEEK_THINKING,
|
||||||
"deepseek-v4-flash": _DEEPSEEK_THINKING,
|
"deepseek-v4-flash": _DEEPSEEK_THINKING,
|
||||||
"deepseek-v4-pro": _DEEPSEEK_THINKING,
|
"deepseek-v4-pro": _DEEPSEEK_THINKING,
|
||||||
# MiniMax — full official model lineup per
|
# MiniMax — full official model lineup per
|
||||||
@@ -108,10 +109,14 @@ _BY_ID: dict[str, ModelCapabilities] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Forward-compat patterns. New ``deepseek-v5-*`` / ``deepseek-reasoner-*``
|
# Forward-compat patterns. New ``deepseek-v5-*`` / ``deepseek-reasoner-*``
|
||||||
# or ``MiniMax-M3*`` variants inherit the thinking-mode quirks automatically.
|
# / ``deepseek-flash-*`` or ``MiniMax-M3*`` variants inherit the thinking-mode
|
||||||
|
# quirks automatically. ``deepseek-flash`` is the unversioned alias the model
|
||||||
|
# picker offers for V4.1 Flash; it serves thinking mode and so rejects
|
||||||
|
# ``tool_choice`` exactly like the versioned ``deepseek-v4-flash`` ID does.
|
||||||
_BY_PATTERN: list[tuple[re.Pattern[str], ModelCapabilities]] = [
|
_BY_PATTERN: list[tuple[re.Pattern[str], ModelCapabilities]] = [
|
||||||
(re.compile(r"^deepseek-v\d"), _DEEPSEEK_THINKING),
|
(re.compile(r"^deepseek-v\d"), _DEEPSEEK_THINKING),
|
||||||
(re.compile(r"^deepseek-reasoner"), _DEEPSEEK_THINKING),
|
(re.compile(r"^deepseek-reasoner"), _DEEPSEEK_THINKING),
|
||||||
|
(re.compile(r"^deepseek-flash"), _DEEPSEEK_THINKING),
|
||||||
(re.compile(r"^MiniMax-M\d"), _MINIMAX_THINKING),
|
(re.compile(r"^MiniMax-M\d"), _MINIMAX_THINKING),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user