main
HuangHai 2 weeks ago
parent 60ffd73024
commit bbb8f11cfb

@ -39,7 +39,7 @@ os.environ["POSTGRES_PASSWORD"] = "postgres"
os.environ["POSTGRES_DATABASE"] = "rag"
async def initialize_rag():
async def initialize_pg_rag():
rag = LightRAG(
working_dir=WORKING_DIR,
llm_model_func=llm_model_func,
@ -66,7 +66,7 @@ async def initialize_rag():
async def main():
rag = await initialize_rag()
rag = await initialize_pg_rag()
with open(f"../Txt/sushi.txt", "r", encoding="utf-8") as f:
await rag.ainsert(f.read())

@ -40,7 +40,7 @@ os.environ["POSTGRES_PASSWORD"] = "postgres"
os.environ["POSTGRES_DATABASE"] = "rag"
async def initialize_rag():
async def initialize_pg_rag():
rag = LightRAG(
working_dir=WORKING_DIR,
llm_model_func=llm_model_func,
@ -67,7 +67,7 @@ async def initialize_rag():
async def main():
try:
rag = await initialize_rag()
rag = await initialize_pg_rag()
resp = await rag.aquery(
"What are the top themes in this story",
param=QueryParam(mode="hybrid", stream=True),

Loading…
Cancel
Save