feat: 文档检索接口
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user