|
|
|
@ -1,8 +1,4 @@
|
|
|
|
|
import json
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
import os.path
|
|
|
|
|
=======
|
|
|
|
|
>>>>>>> 8a5ee36bebcc62d27044e0e6967719d6d343306c
|
|
|
|
|
import subprocess
|
|
|
|
|
import tempfile
|
|
|
|
|
import urllib
|
|
|
|
@ -20,11 +16,6 @@ from starlette.staticfiles import StaticFiles
|
|
|
|
|
from Util.LightRagUtil import *
|
|
|
|
|
from Util.PostgreSQLUtil import init_postgres_pool
|
|
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
rag_instances = {}
|
|
|
|
|
rag_lock = asyncio.Lock()
|
|
|
|
|
|
|
|
|
|
=======
|
|
|
|
|
# 在程序开始时添加以下配置
|
|
|
|
|
logging.basicConfig(
|
|
|
|
|
level=logging.INFO, # 设置日志级别为INFO
|
|
|
|
@ -32,7 +23,6 @@ logging.basicConfig(
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# 或者如果你想更详细地控制日志输出
|
|
|
|
|
>>>>>>> 8a5ee36bebcc62d27044e0e6967719d6d343306c
|
|
|
|
|
logger = logging.getLogger('lightrag')
|
|
|
|
|
logger.setLevel(logging.INFO)
|
|
|
|
|
handler = logging.StreamHandler()
|
|
|
|
@ -60,6 +50,7 @@ app.mount("/static", StaticFiles(directory="Static"), name="static")
|
|
|
|
|
async def rag(request: fastapi.Request):
|
|
|
|
|
data = await request.json()
|
|
|
|
|
topic = data.get("topic") # Chinese, Math
|
|
|
|
|
mode = data.get("mode", "hybrid") # 默认为hybrid模式
|
|
|
|
|
# 拼接路径
|
|
|
|
|
WORKING_PATH = "./Topic/" + topic
|
|
|
|
|
# 查询的问题
|
|
|
|
|