mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-31 15:45:08 +08:00
refactor:re order logics in clean_gen_conf (#12391)
### What problem does this PR solve? re order logics in clean_gen_conf #12388 ### Type of change - [x] Refactoring
This commit is contained in:
@ -100,6 +100,12 @@ class Base(ABC):
|
|||||||
return LLMErrorCode.ERROR_GENERIC
|
return LLMErrorCode.ERROR_GENERIC
|
||||||
|
|
||||||
def _clean_conf(self, gen_conf):
|
def _clean_conf(self, gen_conf):
|
||||||
|
model_name_lower = (self.model_name or "").lower()
|
||||||
|
# gpt-5 and gpt-5.1 endpoints have inconsistent parameter support, clear custom generation params to prevent unexpected issues
|
||||||
|
if "gpt-5" in model_name_lower:
|
||||||
|
gen_conf = {}
|
||||||
|
return gen_conf
|
||||||
|
|
||||||
if "max_tokens" in gen_conf:
|
if "max_tokens" in gen_conf:
|
||||||
del gen_conf["max_tokens"]
|
del gen_conf["max_tokens"]
|
||||||
|
|
||||||
@ -127,12 +133,6 @@ class Base(ABC):
|
|||||||
}
|
}
|
||||||
|
|
||||||
gen_conf = {k: v for k, v in gen_conf.items() if k in allowed_conf}
|
gen_conf = {k: v for k, v in gen_conf.items() if k in allowed_conf}
|
||||||
|
|
||||||
model_name_lower = (self.model_name or "").lower()
|
|
||||||
# gpt-5 and gpt-5.1 endpoints have inconsistent parameter support, clear custom generation params to prevent unexpected issues
|
|
||||||
if "gpt-5" in model_name_lower:
|
|
||||||
gen_conf = {}
|
|
||||||
|
|
||||||
return gen_conf
|
return gen_conf
|
||||||
|
|
||||||
async def _async_chat_streamly(self, history, gen_conf, **kwargs):
|
async def _async_chat_streamly(self, history, gen_conf, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user