fix: 修复未解析的饮用
This commit is contained in:
@@ -5,7 +5,8 @@ import time
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import datetime
|
import datetime
|
||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
from memory_manual_build import Memory_graph, Hippocampus # 海马体和记忆图
|
from Hippocampus import Hippocampus # 海马体和记忆图
|
||||||
|
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
@@ -45,13 +46,13 @@ else:
|
|||||||
|
|
||||||
|
|
||||||
# 查询节点信息
|
# 查询节点信息
|
||||||
def query_mem_info(memory_graph: Memory_graph):
|
def query_mem_info(hippocampus: Hippocampus):
|
||||||
while True:
|
while True:
|
||||||
query = input("\n请输入新的查询概念(输入'退出'以结束):")
|
query = input("\n请输入新的查询概念(输入'退出'以结束):")
|
||||||
if query.lower() == "退出":
|
if query.lower() == "退出":
|
||||||
break
|
break
|
||||||
|
|
||||||
items_list = memory_graph.get_related_item(query)
|
items_list = hippocampus.memory_graph.get_related_item(query)
|
||||||
if items_list:
|
if items_list:
|
||||||
have_memory = False
|
have_memory = False
|
||||||
first_layer, second_layer = items_list
|
first_layer, second_layer = items_list
|
||||||
@@ -312,14 +313,11 @@ def alter_mem_edge(hippocampus: Hippocampus):
|
|||||||
async def main():
|
async def main():
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|
||||||
# 创建记忆图
|
|
||||||
memory_graph = Memory_graph()
|
|
||||||
|
|
||||||
# 创建海马体
|
# 创建海马体
|
||||||
hippocampus = Hippocampus(memory_graph)
|
hippocampus = Hippocampus()
|
||||||
|
|
||||||
# 从数据库同步数据
|
# 从数据库同步数据
|
||||||
hippocampus.sync_memory_from_db()
|
hippocampus.entorhinal_cortex.sync_memory_from_db()
|
||||||
|
|
||||||
end_time = time.time()
|
end_time = time.time()
|
||||||
logger.info(f"\033[32m[加载海马体耗时: {end_time - start_time:.2f} 秒]\033[0m")
|
logger.info(f"\033[32m[加载海马体耗时: {end_time - start_time:.2f} 秒]\033[0m")
|
||||||
@@ -338,7 +336,7 @@ async def main():
|
|||||||
query = -1
|
query = -1
|
||||||
|
|
||||||
if query == 0:
|
if query == 0:
|
||||||
query_mem_info(memory_graph)
|
query_mem_info(hippocampus.memory_graph)
|
||||||
elif query == 1:
|
elif query == 1:
|
||||||
add_mem_node(hippocampus)
|
add_mem_node(hippocampus)
|
||||||
elif query == 2:
|
elif query == 2:
|
||||||
@@ -355,7 +353,7 @@ async def main():
|
|||||||
print("已结束操作")
|
print("已结束操作")
|
||||||
break
|
break
|
||||||
|
|
||||||
hippocampus.sync_memory_to_db()
|
hippocampus.entorhinal_cortex.sync_memory_to_db()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user