From cdb85ef9b7a4de80f3c795efcea850ad0eb2c574 Mon Sep 17 00:00:00 2001 From: snaily Date: Sun, 20 Jul 2025 13:42:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E6=80=9D=E8=80=83?= =?UTF-8?q?=E9=A2=84=E7=AE=97=E9=85=8D=E7=BD=AE=EF=BC=8C=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=5Fget=5Freal=5Fmodel=E5=87=BD=E6=95=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=9C=9F=E5=AE=9E=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/chat/gemini_chat_service.py | 2 +- app/service/chat/openai_chat_service.py | 2 +- app/service/chat/vertex_express_chat_service.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/service/chat/gemini_chat_service.py b/app/service/chat/gemini_chat_service.py index 93464a2..1444146 100644 --- a/app/service/chat/gemini_chat_service.py +++ b/app/service/chat/gemini_chat_service.py @@ -242,7 +242,7 @@ def _build_payload(model: str, request: GeminiRequest) -> Dict[str, Any]: payload["generationConfig"]["thinkingConfig"] = {"thinkingBudget": 128} else: payload["generationConfig"]["thinkingConfig"] = {"thinkingBudget": 0} - elif model in settings.THINKING_BUDGET_MAP: + elif _get_real_model(model) in settings.THINKING_BUDGET_MAP: if settings.SHOW_THINKING_PROCESS: payload["generationConfig"]["thinkingConfig"] = { "thinkingBudget": settings.THINKING_BUDGET_MAP.get(model,1000), diff --git a/app/service/chat/openai_chat_service.py b/app/service/chat/openai_chat_service.py index 47c6bd3..87482e4 100644 --- a/app/service/chat/openai_chat_service.py +++ b/app/service/chat/openai_chat_service.py @@ -206,7 +206,7 @@ def _build_payload( else: payload["generationConfig"]["thinkingConfig"] = {"thinkingBudget": 0} - if request.model in settings.THINKING_BUDGET_MAP: + if _get_real_model(request.model) in settings.THINKING_BUDGET_MAP: if settings.SHOW_THINKING_PROCESS: payload["generationConfig"]["thinkingConfig"] = { "thinkingBudget": settings.THINKING_BUDGET_MAP.get(request.model, 1000), diff --git a/app/service/chat/vertex_express_chat_service.py b/app/service/chat/vertex_express_chat_service.py index 16faf2b..95f1b77 100644 --- a/app/service/chat/vertex_express_chat_service.py +++ b/app/service/chat/vertex_express_chat_service.py @@ -180,7 +180,7 @@ def _build_payload(model: str, request: GeminiRequest) -> Dict[str, Any]: payload["generationConfig"]["thinkingConfig"] = {"thinkingBudget": 128} else: payload["generationConfig"]["thinkingConfig"] = {"thinkingBudget": 0} - elif model in settings.THINKING_BUDGET_MAP: + elif _get_real_model(model) in settings.THINKING_BUDGET_MAP: if settings.SHOW_THINKING_PROCESS: payload["generationConfig"]["thinkingConfig"] = { "thinkingBudget": settings.THINKING_BUDGET_MAP.get(model,1000),