Skip to content

Commit 0b58457

Browse files
committed
updated MindMap-Component (#2023)
1 parent 354ba83 commit 0b58457

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

education-ai-suite/smart-classroom/components/mindmap_component.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def generate_mindmap(self, summary_text):
3939
add_generation_prompt=True
4040
)
4141

42-
mindmap_streamer = self.model.generate(mindmap_prompt)
43-
full_mindmap = "".join(token for token in mindmap_streamer)
42+
full_mindmap = self.model.generate(mindmap_prompt, False)
4443
StorageManager.save(mindmap_path, full_mindmap, append=False)
4544
logger.info("Mindmap generation completed successfully.")
4645
return full_mindmap

education-ai-suite/smart-classroom/config.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ mindmap:
259259
10. Ensure conceptual accuracy - each node should represent a distinct, meaningful concept
260260
11. Do NOT include any markdown formatting, code fences, or explanatory text
261261
12. Output only the raw JSON structure
262+
13. Always return a valid JSON structure.
262263

263264
Example of GOOD specificity:
264265
{
@@ -321,12 +322,13 @@ mindmap:
321322
10. 确保概念准确性 - 每个节点应代表一个独特、有意义的概念
322323
11. 不要包含任何markdown格式、代码块或解释性文本
323324
12. 只输出原始JSON结构
325+
13. 始终返回有效的JSON结构。
324326

325327
良好特异性示例:
326328
{
327329
"meta": {
328-
"name": "physics_lecture",
329-
"author": "ai_assistant",
330+
"name": "物理课程",
331+
"author": "人工智能助手",
330332
"version": "1.0"
331333
},
332334
"format": "node_tree",
@@ -335,21 +337,21 @@ mindmap:
335337
"topic": "量子力学与波动理论",
336338
"children": [
337339
{
338-
"id": "wave_particle_duality",
340+
"id": "波粒二象性",
339341
"topic": "波粒二象性",
340342
"children": [
341-
{"id": "photon_behavior", "topic": "光子同时表现出波动和粒子特性"},
342-
{"id": "double_slit", "topic": "双缝实验证明干涉现象"},
343-
{"id": "measurement_effect", "topic": "测量导致波函数坍缩"}
343+
{"id": "光子特性", "topic": "光子同时表现出波动和粒子特性"},
344+
{"id": "双缝实验", "topic": "双缝实验证明干涉现象"},
345+
{"id": "测量效应", "topic": "测量导致波函数坍缩"}
344346
]
345347
},
346348
{
347-
"id": "uncertainty_principle",
349+
"id": "不确定性原理",
348350
"topic": "海森堡不确定性原理",
349351
"children": [
350-
{"id": "position_momentum", "topic": "无法同时精确知道位置和动量"},
351-
{"id": "mathematical_formulation", "topic": "Δx·Δp ≥ ℏ/2 数学关系"},
352-
{"id": "quantum_limitations", "topic": "量子测量的基本限制"}
352+
{"id": "位置动量", "topic": "无法同时精确知道位置和动量"},
353+
{"id": "数学表达式", "topic": "Δx·Δp ≥ ℏ/2 数学关系"},
354+
{"id": "量子限制", "topic": "量子测量的基本限制"}
353355
]
354356
}
355357
]

0 commit comments

Comments
 (0)