From 4b32648eb5336c31626d0f11440e7c6eaf8bdd5e Mon Sep 17 00:00:00 2001 From: yangdx Date: Wed, 15 Jan 2025 02:25:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=B5=81=E5=BC=8F=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=92=8C=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/lightrag_yangdx.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/lightrag_yangdx.py b/examples/lightrag_yangdx.py index eeb651f8..2691deac 100644 --- a/examples/lightrag_yangdx.py +++ b/examples/lightrag_yangdx.py @@ -1,6 +1,6 @@ -import asyncio import os -import inspect +# import asyncio +# import inspect import logging from dotenv import load_dotenv from lightrag import LightRAG, QueryParam @@ -64,19 +64,19 @@ print( rag.query("What are the top themes in this story?", param=QueryParam(mode="hybrid")) ) -# stream response -resp = rag.query( - "What are the top themes in this story?", - param=QueryParam(mode="hybrid", stream=True), -) +# # stream response +# resp = rag.query( +# "What are the top themes in this story?", +# param=QueryParam(mode="hybrid", stream=True), +# ) -async def print_stream(stream): - async for chunk in stream: - print(chunk, end="", flush=True) +# async def print_stream(stream): +# async for chunk in stream: +# print(chunk, end="", flush=True) -if inspect.isasyncgen(resp): - asyncio.run(print_stream(resp)) -else: - print(resp) +# if inspect.isasyncgen(resp): +# asyncio.run(print_stream(resp)) +# else: +# print(resp)