feat: add rag backend and review access fixes

This commit is contained in:
wren
2026-05-08 10:58:24 +08:00
parent 1c84209f38
commit 9c86bf59e5
32 changed files with 3877 additions and 23 deletions
@@ -0,0 +1,62 @@
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import AsyncGenerator
from fastapi_modules.fastapi_leaudit.domian.Dto.ragChatDto import (
RagConversationRenameDTO,
RagMessageFeedbackDTO,
)
from fastapi_modules.fastapi_leaudit.domian.vo.ragChatVo import (
RagAppParametersVO,
RagChatAppListVO,
RagChatAppVO,
RagConversationPageVO,
RagConversationRenameVO,
RagMessagePageVO,
RagOperationResultVO,
)
class IRagChatService(ABC):
@abstractmethod
async def GetApps(self, CurrentUserId: int, UserArea: str | None, UserRole: str | None) -> RagChatAppListVO: ...
@abstractmethod
async def GetDefaultApp(self, CurrentUserId: int, UserArea: str | None, UserRole: str | None) -> RagChatAppVO | None: ...
@abstractmethod
async def SendMessage(
self,
CurrentUserId: int,
UserName: str,
UserArea: str | None,
UserRole: str | None,
Query: str,
ConversationId: str | None,
AppId: int | None,
) -> AsyncGenerator[bytes, None]: ...
@abstractmethod
async def GetConversations(self, CurrentUserId: int, AppId: int | None, Page: int, PageSize: int) -> RagConversationPageVO: ...
@abstractmethod
async def GetConversationMessages(self, CurrentUserId: int, ConversationId: str, Page: int, PageSize: int) -> RagMessagePageVO: ...
@abstractmethod
async def RenameConversation(self, CurrentUserId: int, ConversationId: str, Body: RagConversationRenameDTO) -> RagConversationRenameVO: ...
@abstractmethod
async def DeleteConversation(self, CurrentUserId: int, ConversationId: str) -> RagOperationResultVO: ...
@abstractmethod
async def UpdateFeedback(self, CurrentUserId: int, MessageId: str, Body: RagMessageFeedbackDTO) -> RagOperationResultVO: ...
@abstractmethod
async def GetAppParameters(
self,
CurrentUserId: int,
UserArea: str | None,
UserRole: str | None,
AppId: int | None,
) -> RagAppParametersVO: ...