Skip to content

Commit

Permalink
add mindmap gen
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiesun committed Nov 22, 2023
1 parent 866d647 commit e8f5f11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ class IndexItem(BaseModel):


class MindmapItem(BaseModel):
title: str = Field(default="Mindmap", title="Mindmap Title", description="Mindmap Title",
title: str = Field(default="Mindmap", title="Mindmap Title as root node", description="Mindmap Title, Root node",
example="Python 学习")
structure: Dict[str, List[str]] = Field(default={}, title="Mindmap Structure data",
description="Mindmap Structure data",
description="Mindmap Structure data, "
"The title value must be included in the structure's keys",
example={
"Python 学习": ["基础知识", "高级主题"],
"基础知识": ["变量", "数据类型", "控制流"],
Expand Down
14 changes: 9 additions & 5 deletions tests/test.http
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,22 @@ Content-Type: application/json
Authorization: Bearer a99e05501a0405531caf783eef419b56a5a32f57b64ae3b89587b3a0d5202ee167d80d727a1b8181

{
"title": "Python 学习",
"title": "Python学习",
"structure": {
"Python 学习": ["基础知识", "高级主题"],
"Python学习": ["基础知识", "高级主题"],
"基础知识": ["变量", "数据类型", "控制流"],
"高级主题": ["面向对象", "装饰器", "迭代器"]
"高级主题": ["面向对象", "装饰器", "迭代器"],
"变量": ["定义", "赋值"],
"数据类型": ["整数", "浮点数", "字符串"],
"控制流": ["if语句", "for循环", "while循环"],
"面向对象": ["", "继承", "多态"],
"装饰器": ["定义", "应用"],
"迭代器": ["创建", "使用"]
}
}





###

POST http://127.0.0.1:8700/knowledge/search
Expand Down

0 comments on commit e8f5f11

Please sign in to comment.