feat(providers): support DeepSeek V4 Pro Responses

This commit is contained in:
chengyongru
2026-08-13 01:02:41 +08:00
committed by chengyongru
parent 01c7323d74
commit edec29e997
6 changed files with 56 additions and 31 deletions
+3 -2
View File
@@ -1158,7 +1158,8 @@ class OpenAICompatProvider(LLMProvider):
self._sanitize_empty_content(sanitized_state.pending_messages)
)
)
preserve_reasoning = bool(self._spec and self._spec.name == "deepseek")
is_deepseek = bool(self._spec and self._spec.name == "deepseek")
preserve_reasoning = is_deepseek
instructions, input_items, replayed = prepare_responses_input(
sanitized_messages,
state=sanitized_state,
@@ -1194,7 +1195,7 @@ class OpenAICompatProvider(LLMProvider):
if not self._supports_temperature(model_name, reasoning_effort) and not preserve_reasoning:
body["include"] = ["reasoning.encrypted_content"]
if reasoning_effort and reasoning_effort.lower() != "none":
if reasoning_effort and (reasoning_effort.lower() != "none" or is_deepseek):
body["reasoning"] = {"effort": reasoning_effort}
if replayed and "gpt-5.6" in model_name.lower():
body.setdefault("reasoning", {})["context"] = "all_turns"
+2 -3
View File
@@ -112,8 +112,7 @@ class ProviderSpec:
implicit_reasoning_models: tuple[str, ...] = ()
# Models that expose the OpenAI Responses wire format. This is model-level
# because providers may add Responses support incrementally (DeepSeek V4
# Flash is supported before V4 Pro).
# because providers may add Responses support incrementally.
responses_models: tuple[str, ...] = ()
# Provider-hosted Responses tools sent unless extraBody.tools explicitly
@@ -482,7 +481,7 @@ PROVIDERS: tuple[ProviderSpec, ...] = (
backend="openai_compat",
default_api_base="https://api.deepseek.com",
thinking_style="thinking_type",
responses_models=("deepseek-v4-flash",),
responses_models=("deepseek-v4-flash", "deepseek-v4-pro"),
responses_default_tools=("web_search",),
),
# Gemini: Google's OpenAI-compatible endpoint