mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-01 08:15:44 +08:00
fix: gpt-5 name-based config clearing from base chat path (#13949)
### What problem does this PR solve? fix #13944 where OpenAI-compatible custom endpoints failed verification when model names contained `gpt-5` becauser of incorrect name-based handling in the Base/backend=`base` path. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -77,9 +77,6 @@ def _apply_model_family_policies(
|
||||
sanitized_kwargs["extra_body"] = {"enable_thinking": False}
|
||||
|
||||
if backend == "base":
|
||||
# GPT-5 and GPT-5.1 endpoints in this path have inconsistent generation-param support.
|
||||
if "gpt-5" in model_name_lower:
|
||||
sanitized_gen_conf = {}
|
||||
return sanitized_gen_conf, sanitized_kwargs
|
||||
|
||||
if backend == "litellm":
|
||||
@@ -151,14 +148,11 @@ class Base(ABC):
|
||||
return LLMErrorCode.ERROR_GENERIC
|
||||
|
||||
def _clean_conf(self, gen_conf):
|
||||
model_name_lower = (self.model_name or "").lower()
|
||||
gen_conf, _ = _apply_model_family_policies(
|
||||
self.model_name,
|
||||
backend="base",
|
||||
gen_conf=gen_conf,
|
||||
)
|
||||
if "gpt-5" in model_name_lower:
|
||||
return gen_conf
|
||||
|
||||
if "max_tokens" in gen_conf:
|
||||
del gen_conf["max_tokens"]
|
||||
|
||||
Reference in New Issue
Block a user