feat: 文档检索接口

This commit is contained in:
martsforever
2025-09-07 20:57:44 +08:00
parent 949b4eda8b
commit 3c7683a827
2 changed files with 18 additions and 17 deletions
+5 -7
View File
@@ -7,16 +7,14 @@ from starlette.requests import Request
from app.utils.db_utils import AsyncSessionDep
from app.utils.knowledge_utils import knowledge_service
from app.utils.milvus_utils import milvus_service
from app.utils.milvus_utils import milvus_service, KnowledgeQueryParam
def add_knowledge_route(app):
# @app.get("/knowledge/search")
# async def knowledge_search(text: str = Param()):
# print("text", text)
# query_result = await milvus_service.async_search(text or "hello")
# return query_result
#
@app.post("/knowledge/search")
async def knowledge_search(param: KnowledgeQueryParam):
return await milvus_service.async_search(param)
# @app.post("/knowledge/embed_text")
# async def knowledge_embed_text(text_list: List[str]):
# id_list = await next_id(len(text_list))