main
HuangHai 2 weeks ago
commit 52d9f4e911

@ -1,7 +1,6 @@
import asyncio
import json
import logging
import os
from logging.handlers import RotatingFileHandler
import fastapi
import uvicorn
@ -14,9 +13,6 @@ from starlette.staticfiles import StaticFiles
from Util.RagUtil import create_llm_model_func, create_vision_model_func, create_embedding_func
import logging
# 在程序开始时添加以下配置
logging.basicConfig(
level=logging.INFO, # 设置日志级别为INFO
@ -81,18 +77,22 @@ async def rag(request: fastapi.Request):
vision_model_func=vision_model_func,
)
# 直接使用app.state中已初始化的rag实例
# 修改为直接获取完整响应
resp = await app.state.rag.aquery(
user_prompt=user_prompt,
query=query,
mode="hybrid",
stream=True
stream=False # 改为False获取完整响应
)
async for chunk in resp:
if not chunk:
continue
# 将完整响应作为单个块返回
#yield f"data: {json.dumps({'reply': resp})}\n\n"
#print(resp, end='', flush=True)
# 添加逐字输出效果
for i in range(0, len(resp), 5): # 每次输出5个字符
chunk = resp[i:i + 5]
yield f"data: {json.dumps({'reply': chunk})}\n\n"
print(chunk, end='', flush=True)
await asyncio.sleep(0.1) # 控制输出速度
except Exception as e:
yield f"data: {json.dumps({'error': str(e)})}\n\n"
logger.error(f"处理查询时出错: {query}. 错误: {str(e)}")

@ -0,0 +1,88 @@
import asyncio
import json
import logging
import fastapi
import uvicorn
from fastapi import FastAPI
from lightrag import LightRAG, QueryParam
from lightrag.kg.shared_storage import initialize_pipeline_status
from raganything import RAGAnything
from sse_starlette import EventSourceResponse
from starlette.staticfiles import StaticFiles
from Config.Config import LLM_MODEL_NAME
from Util.RagUtil import create_llm_model_func, create_vision_model_func, create_embedding_func
# 在程序开始时添加以下配置
logging.basicConfig(
level=logging.INFO, # 设置日志级别为INFO
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
# 或者如果你想更详细地控制日志输出
logger = logging.getLogger('lightrag')
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
logger.addHandler(handler)
async def lifespan(app: FastAPI):
yield
async def print_stream(stream):
async for chunk in stream:
if chunk:
print(chunk, end="", flush=True)
app = FastAPI(lifespan=lifespan)
# 挂载静态文件目录
app.mount("/static", StaticFiles(directory="Static"), name="static")
@app.post("/api/rag")
async def rag(request: fastapi.Request):
data = await request.json()
topic = data.get("topic") # Chinese, Math
# 拼接路径
WORKING_PATH= "./Topic/" + topic
# 查询的问题
query = data.get("query")
# 关闭参考资料
user_prompt="\n 1、不要输出参考资料 或者 References "
user_prompt = user_prompt + "\n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到"
async def generate_response_stream(query: str):
try:
rag = LightRAG(
working_dir=WORKING_PATH,
llm_model_func=create_llm_model_func(),
embedding_func=create_embedding_func()
)
await rag.initialize_storages()
await initialize_pipeline_status()
resp = await rag.aquery(
query=query,
param=QueryParam(mode="hybrid", stream=True))
async for chunk in resp:
if not chunk:
continue
yield f"data: {json.dumps({'reply': chunk})}\n\n"
print(chunk, end='', flush=True)
except Exception as e:
yield f"data: {json.dumps({'error': str(e)})}\n\n"
finally:
# 清理资源
await rag.finalize_storages()
return EventSourceResponse(generate_response_stream(query=query))
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)

File diff suppressed because one or more lines are too long

@ -2351,6 +2351,36 @@
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼的家人都有谁?\n 1、不要输出参考资料 或者 References \n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到"
},
"9b37cd625bfa223f5c83501990ad6be1": {
"return": "{\"high_level_keywords\": [\"\\u82cf\\u8f7c\", \"\\u5bb6\\u4eba\", \"\\u5bb6\\u5ead\\u5173\\u7cfb\"], \"low_level_keywords\": [\"\\u7236\\u4eb2\", \"\\u6bcd\\u4eb2\", \"\\u5144\\u5f1f\", \"\\u59d0\\u59b9\", \"\\u59bb\\u5b50\", \"\\u5b50\\u5973\", \"\\u82cf\\u6d35\", \"\\u82cf\\u8f99\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼的家人都有谁?"
},
"e70ca446ac7a68719125a8c5975b56c1": {
"return": "根据提供的知识图谱和文档片段,苏轼的家族成员主要包括以下人物:\n\n### 直系亲属\n1. **父亲**苏洵1009-1066字明允号老泉北宋文学家\"唐宋八大家\"之一,亲自教授苏轼与苏辙知识。\n2. **母亲**程夫人1010-1057出身名门以东汉名士范滂的事迹勉励苏轼砥砺名节是苏轼兄弟的启蒙教师。\n3. **弟弟**苏辙1039-1112字子由号颍滨遗老北宋官员、文学家与苏轼并称\"二苏\",同属\"唐宋八大家\"。\n\n### 配偶与子女\n1. **第一任妻子**王弗1039-1065聪慧知书陪伴苏轼多年对其学习和生活有重要影响生有长子苏迈。\n2. **第二任妻子**王闰之1048-1093王弗堂妹性格温顺为苏轼生活提供稳定支持。\n3. **侍妾**:王朝云(朝云),生第四子苏遁(遯儿),深得苏轼赏识,常吟唱其词作,尤其对《蝶恋花》感触颇深。\n\n4. **子女**\n - 苏迈1059-?):长子,王弗所生\n - 苏迨1070-1126次子初名叔寄\n - 苏过1073-1123第三子字叔党\n - 苏遁1083-1084第四子王朝云所生小名干儿\n\n### 其他重要关系\n- **好友**:陈季常,苏轼曾作诗调侃其惧内之事,成就\"河东狮吼\"典故\n- **门生**\"苏门四学士\"(黄庭坚、秦观、张耒、晁补之)及\"苏门六君子\"\n\n苏轼家族以\"三苏\"(苏洵、苏轼、苏辙)闻名,其家庭成员间的深厚感情和相互影响在其文学创作和人生轨迹中均有明显体现。\n\nReferences:\n[KG] 苏轼.docx (苏洵、苏辙、程夫人、王弗、王闰之等实体关系)\n[DC] 苏轼.docx (家族成员详细记载)",
"cache_type": "query",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼的家人都有谁?"
},
"f228e58d06f5c7d16ab6f7094e733f60": {
"return": "{\"high_level_keywords\": [\"\\u82cf\\u8f7c\", \"\\u8bd7\\u53e5\", \"\\u6587\\u5b66\"], \"low_level_keywords\": [\"\\u6c34\\u8c03\\u6b4c\\u5934\", \"\\u5ff5\\u5974\\u5a07\\u00b7\\u8d64\\u58c1\\u6000\\u53e4\", \"\\u6c5f\\u57ce\\u5b50\\u00b7\\u5bc6\\u5dde\\u51fa\\u730e\", \"\\u9898\\u897f\\u6797\\u58c1\", \"\\u8d64\\u58c1\\u8d4b\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼有哪些有名的诗句?"
}
}
}

@ -62,28 +62,237 @@
}
},
"hybrid": {
<<<<<<< HEAD
"2aa147fe2387a611b187f93614709710": {
"return": "{\"high_level_keywords\": [\"\\u5316\\u5b66\\u53cd\\u5e94\", \"\\u6c27\\u5316\\u8fd8\\u539f\\u53cd\\u5e94\"], \"low_level_keywords\": [\"\\u6c27\\u5316\\u94c1\", \"\\u785d\\u9178\", \"\\u53cd\\u5e94\\u65b9\\u7a0b\\u5f0f\"]}",
=======
"fc3284234d7b14d883b20618d5715b6b": {
"return": "{\"high_level_keywords\": [\"\\u5c0f\\u5b66\\u6570\\u5b66\", \"\\u6559\\u80b2\\u6a21\\u578b\", \"\\u6570\\u5b66\\u6559\\u5b66\"], \"low_level_keywords\": [\"\\u52a0\\u51cf\\u6cd5\\u6a21\\u578b\", \"\\u51e0\\u4f55\\u56fe\\u5f62\", \"\\u5206\\u6570\\u6a21\\u578b\", \"\\u5e94\\u7528\\u9898\", \"\\u6570\\u8f74\"]}",
>>>>>>> 097b38400845e9c6e88091c490721e35f599bc4c
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
<<<<<<< HEAD
"original_prompt": "氧化铁和硝酸的反应方程式?"
},
"5b157a366b34673889b37e87f7314b3e": {
"return": "根据提供的知识库氧化铁Iron(II) Oxide与硝酸Nitric Acid的反应方程式如下 \n\n### 反应方程式 \n$$\\ \nFeO + 4 HNO_3 \\stackrel{\\Delta}{=} Fe(NO_3)_3 + 2 H_2 \\uparrow + NO_2 \\uparrow \n$$ \n\n### 反应描述 \n1. **反应物** \n - 氧化铁FeO \n - 硝酸HNO₃ \n\n2. **条件** \n - 需要加热(Δ符号表示)。 \n\n3. **生成物** \n - 硝酸铁Fe(NO₃)₃) \n - 氢气H₂气体形式逸出 \n - 二氧化氮NO₂气体形式逸出 \n\n4. **反应类型** \n - 属于氧化还原反应Redox Reaction涉及电子转移和化合价变化如铁从+2价变为+3价。 \n\n### 中文补充说明 \n知识库中也提到对应的中文表述 \n- 氧化铁(氧化铁)与硝酸(硝酸)反应生成硝酸铁、氢气和二氧化氮(见“氧化铁和硝酸的反应方程式”实体)。 \n\n### 其他关联信息 \n- 该反应与“氢气与氧气燃烧生成水”的方程式($$2H_2 + O_2 = 2H_2O$$)同为氧化还原反应的示例,但机制不同。 \n- 反应遵守质量守恒定律Law of Conservation of Mass方程式的系数已平衡。 \n\n### 参考文献 \n1. [KG] 化学方程式_CHEMISTRY_1.docx实体氧化铁和硝酸的反应方程式 \n2. [DC] 化学方程式_CHEMISTRY_1.docxLaTeX格式方程式及分析 \n3. [KG] 化学方程式_CHEMISTRY_1.docx实体Chemical Reaction描述硝酸与氧化铁的反应 \n4. [KG] 化学方程式_CHEMISTRY_1.docx关系Iron(II) Oxide与Nitric Acid的反应关联 \n5. [KG] 化学方程式_CHEMISTRY_1.docx实体Redox Reaction反应类型说明",
=======
"original_prompt": "小学数学有哪些模型"
},
"6a2a99a3bd4688b079a45fedbd1cd493": {
"return": "{\"high_level_keywords\": [\"\\u5c0f\\u5b66\\u6570\\u5b66\", \"\\u6570\\u5b66\\u6559\\u80b2\", \"\\u5b66\\u4e60\\u6a21\\u578b\"], \"low_level_keywords\": [\"\\u52a0\\u51cf\\u6cd5\\u6a21\\u578b\", \"\\u4e58\\u9664\\u6cd5\\u6a21\\u578b\", \"\\u51e0\\u4f55\\u56fe\\u5f62\", \"\\u5206\\u6570\\u6a21\\u578b\", \"\\u5e94\\u7528\\u9898\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "小学数学中有哪些模型?"
},
"9b50a199b83407c62d8532b7b904c17d": {
"return": "{\"high_level_keywords\": [\"\\u82cf\\u8f7c\", \"\\u5bb6\\u4eba\", \"\\u5bb6\\u5ead\\u5173\\u7cfb\"], \"low_level_keywords\": [\"\\u7236\\u4eb2\", \"\\u6bcd\\u4eb2\", \"\\u5144\\u5f1f\", \"\\u59bb\\u5b50\", \"\\u5b50\\u5973\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼的家人都有谁?"
},
"585eef85444b748e7c7fce9281f7152b": {
"return": "{\"high_level_keywords\": [\"\\u82cf\\u8f7c\", \"\\u5bb6\\u5ead\\u6210\\u5458\", \"\\u5bb6\\u65cf\\u5173\\u7cfb\"], \"low_level_keywords\": [\"\\u7a0b\\u592b\\u4eba\", \"\\u738b\\u5f17\", \"\\u82cf\\u8f99\", \"\\u82cf\\u8fc8\", \"\\u7709\\u5c71\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼的家人都有谁?\n 不要输出参考资料!"
},
"5c5ee10a1a6deda17447c905118427e3": {
"return": "{\"high_level_keywords\": [\"\\u82cf\\u8f7c\", \"\\u597d\\u53cb\", \"\\u4eba\\u9645\\u5173\\u7cfb\"], \"low_level_keywords\": [\"\\u9ec4\\u5ead\\u575a\", \"\\u79e6\\u89c2\", \"\\u7c73\\u82be\", \"\\u4f5b\\u5370\", \"\\u6587\\u4eba\\u4ea4\\u5f80\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼的好朋友都有谁?\n 不要输出参考资料!"
},
"aa541ae622441668370c2515c5756622": {
"return": "{\"high_level_keywords\": [\"\\u5c0f\\u5b66\\u6570\\u5b66\", \"\\u6570\\u5b66\\u6a21\\u578b\", \"\\u57fa\\u7840\\u6559\\u80b2\"], \"low_level_keywords\": [\"\\u52a0\\u51cf\\u6cd5\", \"\\u4e58\\u9664\\u6cd5\", \"\\u5206\\u6570\", \"\\u5c0f\\u6570\", \"\\u51e0\\u4f55\\u56fe\\u5f62\", \"\\u5e94\\u7528\\u9898\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "小学数学中有哪些模型?\n 不要输出参考资料!"
},
"cef372244b52137466d4538968bdef8e": {
"return": "{\"high_level_keywords\": [\"\\u5fae\\u79ef\\u5206\", \"\\u57fa\\u672c\\u5b9a\\u7406\", \"\\u6570\\u5b66\\u5206\\u6790\"], \"low_level_keywords\": [\"\\u5bfc\\u6570\", \"\\u79ef\\u5206\", \"\\u725b\\u987f-\\u83b1\\u5e03\\u5c3c\\u5179\\u516c\\u5f0f\", \"\\u51fd\\u6570\", \"\\u9762\\u79ef\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "微积分的基本定理是什么?\n 不要输出参考资料!"
},
"7e5ce4bd3ec5160ecb223526b726b73d": {
"return": "{\"high_level_keywords\": [\"\\u5fae\\u79ef\\u5206\", \"\\u57fa\\u672c\\u5b9a\\u7406\", \"\\u6570\\u5b66\\u539f\\u7406\"], \"low_level_keywords\": [\"\\u5bfc\\u6570\", \"\\u79ef\\u5206\", \"\\u51fd\\u6570\", \"\\u5fae\\u5206\\u5b66\", \"\\u79ef\\u5206\\u5b66\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "微积分的基本定理是什么?\n 1、不要输出参考资料\n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到"
},
"dd1b7f53e9b28a94d97890915f554ffe": {
"return": "{\"high_level_keywords\": [\"\\u5c0f\\u5b66\\u6570\\u5b66\", \"\\u6a21\\u578b\", \"\\u6570\\u5b66\\u6559\\u5b66\"], \"low_level_keywords\": [\"\\u51e0\\u4f55\\u6a21\\u578b\", \"\\u4ee3\\u6570\\u6a21\\u578b\", \"\\u6570\\u5b57\\u6a21\\u578b\", \"\\u56fe\\u5f62\\u6a21\\u578b\", \"\\u5e94\\u7528\\u9898\\u6a21\\u578b\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "小学数学中有哪些模型?\n 1、不要输出参考资料\n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到"
},
"a11bdf6a9714f6d5fe11a734924ed67d": {
"return": "{\"high_level_keywords\": [\"\\u6559\\u5b66\\u8bbe\\u8ba1\", \"\\u51e0\\u4f55\\u6982\\u5ff5\", \"\\u7a7a\\u95f4\\u8ba4\\u77e5\", \"\\u6570\\u5b66\\u6559\\u80b2\"], \"low_level_keywords\": [\"\\u70b9\", \"\\u7ebf\", \"\\u9762\", \"\\u4f53\", \"\\u89d2\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "帮我写一下 如何理解点、线、面、体、角 的教学设计\n 1、不要输出参考资料\n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到\n 3、严格按照知识库内容进行回答不要随意发散"
},
"add2f8fe8acd6b2b8f818756a8c4d322": {
"return": "{\"high_level_keywords\": [\"\\u5c0f\\u5b66\\u6570\\u5b66\", \"\\u6a21\\u578b\", \"\\u6570\\u5b66\\u6559\\u5b66\"], \"low_level_keywords\": [\"\\u51e0\\u4f55\\u6a21\\u578b\", \"\\u4ee3\\u6570\\u6a21\\u578b\", \"\\u5e94\\u7528\\u9898\\u6a21\\u578b\", \"\\u56fe\\u5f62\\u6a21\\u578b\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "小学数学中有哪些模型?\n 1、不要输出参考资料\n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到\n 3、按照知识库内容进行回答可适当扩展但不要随意发散"
},
"660cad009d0324583ce88c4912f21c8d": {
"return": "{\"high_level_keywords\": [\"\\u5c0f\\u5b66\\u6570\\u5b66\", \"\\u6570\\u5b66\\u6a21\\u578b\", \"\\u6559\\u80b2\\u5185\\u5bb9\"], \"low_level_keywords\": [\"\\u6a21\\u578b\", \"\\u6570\\u5b66\\u6559\\u5b66\", \"\\u8bfe\\u7a0b\\u5185\\u5bb9\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "小学数学中有哪些模型?\n 1、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到\n 2、按照知识库内容进行回答可适当扩展但不要随意发散"
},
"1aeec13410f14223c05d3a4e4207d1cc": {
"return": "{\"high_level_keywords\": [\"\\u5c0f\\u5b66\\u6570\\u5b66\", \"\\u6570\\u5b66\\u6a21\\u578b\", \"\\u6559\\u80b2\\u5185\\u5bb9\"], \"low_level_keywords\": [\"\\u6a21\\u578b\\u7c7b\\u578b\", \"\\u6559\\u5b66\\u65b9\\u6cd5\", \"\\u8bfe\\u7a0b\\u7ed3\\u6784\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "小学数学中有哪些模型?\n 1、不要输出参考资料 或者 References \n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到\n 3、严格按照知识库内容进行回答不要进行推理知识库中条目清晰体现的才算答案。"
},
"5cfe38f12c7e487e3b06c9a8159d0468": {
"return": "{\"high_level_keywords\": [\"\\u5c0f\\u5b66\\u6570\\u5b66\", \"\\u5e38\\u89c1\\u6a21\\u578b\", \"\\u6570\\u5b66\\u6559\\u5b66\"], \"low_level_keywords\": [\"\\u52a0\\u51cf\\u6cd5\\u6a21\\u578b\", \"\\u4e58\\u9664\\u6cd5\\u6a21\\u578b\", \"\\u51e0\\u4f55\\u56fe\\u5f62\\u6a21\\u578b\", \"\\u5e94\\u7528\\u9898\\u6a21\\u578b\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "小学数学中有哪些常见模型?\n 1、不要输出参考资料 或者 References \n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到\n 3、严格按照知识库内容进行回答不要进行推理知识库中条目清晰体现的才算答案。"
},
"1483fe9cdb027119c0758c80c9a9475b": {
"return": "{\"high_level_keywords\": [\"\\u5c0f\\u5b66\\u6570\\u5b66\", \"\\u5e38\\u89c1\\u6a21\\u578b\", \"\\u6570\\u5b66\\u6559\\u5b66\"], \"low_level_keywords\": [\"\\u52a0\\u51cf\\u6cd5\\u6a21\\u578b\", \"\\u4e58\\u9664\\u6cd5\\u6a21\\u578b\", \"\\u51e0\\u4f55\\u56fe\\u5f62\\u6a21\\u578b\", \"\\u5206\\u6570\\u6a21\\u578b\", \"\\u5e94\\u7528\\u9898\\u6a21\\u578b\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "小学数学中有哪些常见模型??\n 1、不要输出参考资料 或者 References \n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到\n 3、严格按照知识库内容进行回答不要进行推理知识库中条目清晰体现的才算答案。"
},
"2ca4cce66cff2786beef562b80d2b126": {
"return": "{\"high_level_keywords\": [\"\\u5bb6\\u5ead\\u6210\\u5458\", \"\\u82cf\\u8f7c\", \"\\u5bb6\\u65cf\\u5173\\u7cfb\"], \"low_level_keywords\": [\"\\u7a0b\\u6c0f\", \"\\u82cf\\u6d35\", \"\\u738b\\u5f17\", \"\\u82cf\\u8fc8\", \"\\u82cf\\u8fe8\", \"\\u82cf\\u8fc7\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼的家人都有谁?\n 1、不要输出参考资料 或者 References \n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到\n 3、严格按照知识库内容进行回答不要进行推理知识库中条目清晰体现的才算答案。"
},
"71b83653df36350ef401ca5ba7d132cf": {
"return": "{\"high_level_keywords\": [\"\\u82cf\\u8f7c\", \"\\u4eba\\u9645\\u5173\\u7cfb\", \"\\u5386\\u53f2\\u4eba\\u7269\"], \"low_level_keywords\": [\"\\u9ec4\\u5ead\\u575a\", \"\\u7c73\\u82be\", \"\\u8521\\u8944\", \"\\u6b27\\u9633\\u4fee\", \"\\u53f8\\u9a6c\\u5149\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼的好朋友都有谁?\n 1、不要输出参考资料 或者 References \n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到"
},
"b02d54965d8a82801745fb1e44f1bf52": {
"return": "{\"high_level_keywords\": [\"\\u82cf\\u8f7c\", \"\\u5bb6\\u4eba\", \"\\u5bb6\\u5ead\\u80cc\\u666f\"], \"low_level_keywords\": [\"\\u7236\\u4eb2\", \"\\u6bcd\\u4eb2\", \"\\u5144\\u5f1f\\u59d0\\u59b9\", \"\\u59bb\\u5b50\", \"\\u5b50\\u5973\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼的家人都有谁?\n 1、不要输出参考资料 或者 References \n 2、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到"
},
"9b37cd625bfa223f5c83501990ad6be1": {
"return": "{\"high_level_keywords\": [\"\\u82cf\\u8f7c\", \"\\u5bb6\\u4eba\", \"\\u5bb6\\u5ead\\u5173\\u7cfb\"], \"low_level_keywords\": [\"\\u7236\\u4eb2\", \"\\u6bcd\\u4eb2\", \"\\u5144\\u5f1f\", \"\\u59d0\\u59b9\", \"\\u59bb\\u5b50\", \"\\u5b50\\u5973\", \"\\u82cf\\u6d35\", \"\\u82cf\\u8f99\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼的家人都有谁?"
},
"e70ca446ac7a68719125a8c5975b56c1": {
"return": "根据提供的知识图谱和文档片段,苏轼的家族成员主要包括以下人物:\n\n### 直系亲属\n1. **父亲**苏洵1009-1066字明允号老泉北宋文学家\"唐宋八大家\"之一,亲自教授苏轼与苏辙知识。\n2. **母亲**程夫人1010-1057出身名门以东汉名士范滂的事迹勉励苏轼砥砺名节是苏轼兄弟的启蒙教师。\n3. **弟弟**苏辙1039-1112字子由号颍滨遗老北宋官员、文学家与苏轼并称\"二苏\",同属\"唐宋八大家\"。\n\n### 配偶与子女\n1. **第一任妻子**王弗1039-1065聪慧知书陪伴苏轼多年对其学习和生活有重要影响生有长子苏迈。\n2. **第二任妻子**王闰之1048-1093王弗堂妹性格温顺为苏轼生活提供稳定支持。\n3. **侍妾**:王朝云(朝云),生第四子苏遁(遯儿),深得苏轼赏识,常吟唱其词作,尤其对《蝶恋花》感触颇深。\n\n4. **子女**\n - 苏迈1059-?):长子,王弗所生\n - 苏迨1070-1126次子初名叔寄\n - 苏过1073-1123第三子字叔党\n - 苏遁1083-1084第四子王朝云所生小名干儿\n\n### 其他重要关系\n- **好友**:陈季常,苏轼曾作诗调侃其惧内之事,成就\"河东狮吼\"典故\n- **门生**\"苏门四学士\"(黄庭坚、秦观、张耒、晁补之)及\"苏门六君子\"\n\n苏轼家族以\"三苏\"(苏洵、苏轼、苏辙)闻名,其家庭成员间的深厚感情和相互影响在其文学创作和人生轨迹中均有明显体现。\n\nReferences:\n[KG] 苏轼.docx (苏洵、苏辙、程夫人、王弗、王闰之等实体关系)\n[DC] 苏轼.docx (家族成员详细记载)",
>>>>>>> 097b38400845e9c6e88091c490721e35f599bc4c
"cache_type": "query",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
<<<<<<< HEAD
"original_prompt": "氧化铁和硝酸的反应方程式?"
},
"0eea3a1f6f9b9c5cc3fc45c951cdff0b": {
"return": "{\"high_level_keywords\": [\"\\u5c0f\\u5b66\\u6570\\u5b66\", \"\\u5e38\\u89c1\\u6a21\\u578b\"], \"low_level_keywords\": [\"\\u52a0\\u51cf\\u6cd5\", \"\\u4e58\\u9664\\u6cd5\", \"\\u5206\\u6570\", \"\\u51e0\\u4f55\\u56fe\\u5f62\", \"\\u5e94\\u7528\\u9898\"]}",
=======
"original_prompt": "苏轼的家人都有谁?"
},
"f228e58d06f5c7d16ab6f7094e733f60": {
"return": "{\"high_level_keywords\": [\"\\u82cf\\u8f7c\", \"\\u8bd7\\u53e5\", \"\\u6587\\u5b66\"], \"low_level_keywords\": [\"\\u6c34\\u8c03\\u6b4c\\u5934\", \"\\u5ff5\\u5974\\u5a07\\u00b7\\u8d64\\u58c1\\u6000\\u53e4\", \"\\u6c5f\\u57ce\\u5b50\\u00b7\\u5bc6\\u5dde\\u51fa\\u730e\", \"\\u9898\\u897f\\u6797\\u58c1\", \"\\u8d64\\u58c1\\u8d4b\"]}",
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "苏轼有哪些有名的诗句?"
},
"0eea3a1f6f9b9c5cc3fc45c951cdff0b": {
"return": "{\"high_level_keywords\": [\"\\u5c0f\\u5b66\\u6570\\u5b66\", \"\\u6559\\u80b2\\u6a21\\u578b\", \"\\u6570\\u5b66\\u6982\\u5ff5\"], \"low_level_keywords\": [\"\\u52a0\\u51cf\\u4e58\\u9664\", \"\\u51e0\\u4f55\\u56fe\\u5f62\", \"\\u5206\\u6570\", \"\\u5e94\\u7528\\u9898\", \"\\u6570\\u91cf\\u5173\\u7cfb\"]}",
>>>>>>> 097b38400845e9c6e88091c490721e35f599bc4c
"cache_type": "keywords",
"chunk_id": null,
"embedding": null,

Loading…
Cancel
Save