修复参数错误
This commit is contained in:
parent
c3fdab134b
commit
65cf68a012
@ -13,6 +13,12 @@ from fastapi.responses import StreamingResponse
|
||||
from module_admin.service.login_service import LoginService
|
||||
from module_admin.service.ragflow_service import RAGFlowService
|
||||
from module_admin.service.search_service import SearchService
|
||||
from module_admin.entity.vo.ragflow_vo import (
|
||||
ConverseWithChatAssistantModel,
|
||||
CreateSessionWithChatModel,
|
||||
UpdateChatAssistantModel,
|
||||
RagflowListQueryModel
|
||||
)
|
||||
from utils.log_util import logger
|
||||
from utils.response_util import ResponseUtil
|
||||
|
||||
@ -46,7 +52,7 @@ def build_chat_cache_key(chat_id: str, question: str) -> str:
|
||||
@ragflowController.post('/converse_with_chat_assistant')
|
||||
async def converse_with_chat_assistant(
|
||||
request: Request,
|
||||
converse_params: Any, # 使用Any避免导入具体模型类
|
||||
converse_params: ConverseWithChatAssistantModel, # 使用正确的Pydantic模型
|
||||
):
|
||||
"""
|
||||
与聊天助手进行对话 - 同步版本,简化复杂性
|
||||
@ -168,7 +174,7 @@ def stream_ragflow_response(result: Generator, chat_id: str, start_time: float)
|
||||
# 聊天助手列表
|
||||
@ragflowController.post('/get_chat_assistant_list')
|
||||
async def get_chat_assistant_list(
|
||||
query_params: Any, # 使用Any避免导入具体模型类
|
||||
query_params: RagflowListQueryModel, # 使用正确的Pydantic模型
|
||||
):
|
||||
"""获取聊天助手列表"""
|
||||
result = RAGFlowService.get_chat_assistant_list_services(query_params)
|
||||
@ -178,7 +184,7 @@ async def get_chat_assistant_list(
|
||||
# 创建会话
|
||||
@ragflowController.post('/create_session_with_chat')
|
||||
async def create_session_with_chat(
|
||||
create_params: Any, # 使用Any避免导入具体模型类
|
||||
create_params: CreateSessionWithChatModel, # 使用正确的Pydantic模型
|
||||
):
|
||||
"""创建聊天会话"""
|
||||
result = RAGFlowService.create_session_with_chat_services(create_params)
|
||||
@ -188,7 +194,7 @@ async def create_session_with_chat(
|
||||
# 更新聊天助手
|
||||
@ragflowController.post('/update_chat_assistant')
|
||||
async def update_chat_assistant(
|
||||
update_params: Any, # 使用Any避免导入具体模型类
|
||||
update_params: UpdateChatAssistantModel, # 使用正确的Pydantic模型
|
||||
):
|
||||
"""更新聊天助手"""
|
||||
result = RAGFlowService.update_chat_assistant_services(update_params)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user