Spaces:
Running
Running
Update core/clone_architect.py
Browse files- core/clone_architect.py +16 -1
core/clone_architect.py
CHANGED
|
@@ -6,7 +6,22 @@ class CloneArchitect:
|
|
| 6 |
self.agent = agent
|
| 7 |
|
| 8 |
def deconstruct_skeleton(self, reference_text: str, section_name: str) -> str:
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# 显式指定 model_name="deepseek-chat",关闭 R1 深度思考,利用 V3 的高吞吐量极速提取骨架
|
| 11 |
skeleton = self.agent.call_deepseek(prompt, reference_text[:15000], model_name="deepseek-chat")
|
| 12 |
return skeleton
|
|
|
|
| 6 |
self.agent = agent
|
| 7 |
|
| 8 |
def deconstruct_skeleton(self, reference_text: str, section_name: str) -> str:
|
| 9 |
+
# 智能路由:根据章节名称分发到对应的多态解构 Schema
|
| 10 |
+
lower_sec = section_name.lower()
|
| 11 |
+
schemas = APP_CONFIG["prompt_templates"]["clone_deconstruct_schemas"]
|
| 12 |
+
|
| 13 |
+
if any(kw in lower_sec for kw in ["introduction", "background"]):
|
| 14 |
+
schema_prompt = schemas["introduction"]
|
| 15 |
+
elif any(kw in lower_sec for kw in ["literature", "theory", "hypothesis", "review"]):
|
| 16 |
+
schema_prompt = schemas["literature"]
|
| 17 |
+
elif any(kw in lower_sec for kw in ["method", "measure", "data", "sample"]):
|
| 18 |
+
schema_prompt = schemas["methodology"]
|
| 19 |
+
elif any(kw in lower_sec for kw in ["result", "analysis", "finding"]):
|
| 20 |
+
schema_prompt = schemas["results"]
|
| 21 |
+
else:
|
| 22 |
+
schema_prompt = schemas["discussion"] # 默认退化为讨论/结论格式
|
| 23 |
+
|
| 24 |
+
prompt = schema_prompt.replace("{section_name}", section_name)
|
| 25 |
# 显式指定 model_name="deepseek-chat",关闭 R1 深度思考,利用 V3 的高吞吐量极速提取骨架
|
| 26 |
skeleton = self.agent.call_deepseek(prompt, reference_text[:15000], model_name="deepseek-chat")
|
| 27 |
return skeleton
|