refactor(config): 将反截断设置移至模型配置 #真的能算refactor吗
反截断(anti-truncation)功能与特定模型的行为和能力更为相关,而不是任务本身的属性。 此更改将该设置从 `TaskConfig` 移动到 `ModelInfo`,以实现更合理的配置分组和更精细的控制。代码逻辑和配置文件模板也已相应更新。 BREAKING CHANGE: `anti_truncation` 配置项已从 `[model_task_config]` 部分移动到 `[[models]]` 下的具体模型配置中。用户需要更新其配置文件以适配新结构。
This commit is contained in:
@@ -290,12 +290,12 @@ class LLMRequest:
|
||||
model_name = model_info.name
|
||||
|
||||
# 检查是否启用反截断
|
||||
use_anti_truncation = getattr(self.model_for_task, "anti_truncation", False)
|
||||
use_anti_truncation = getattr(api_provider, "anti_truncation", False)
|
||||
|
||||
processed_prompt = prompt
|
||||
if use_anti_truncation:
|
||||
processed_prompt += self.anti_truncation_instruction
|
||||
logger.info(f"任务 '{self.task_name}' 已启用反截断功能")
|
||||
logger.info(f"{api_provider} '{self.task_name}' 已启用反截断功能")
|
||||
|
||||
processed_prompt = self._apply_content_obfuscation(processed_prompt, api_provider)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user