From 997576d577b9c0b3c5a00736096d1b51580b6227 Mon Sep 17 00:00:00 2001 From: Maxime Thoonsen Date: Thu, 18 Apr 2024 23:20:38 -1000 Subject: [PATCH] move file service in wrong directory to file service --- backend/modules/brain/integrations/Notion/Notion_connector.py | 2 +- backend/modules/brain/knowledge_brain_qa.py | 2 +- .../brain/service}/brain_subscription/__init__.py | 0 .../service}/brain_subscription/resend_invitation_email.py | 0 .../brain_subscription/subscription_invitation_service.py | 0 .../modules/brain/service/get_question_context_from_brain.py | 2 +- backend/modules/knowledge/controller/knowledge_routes.py | 2 +- backend/modules/upload/controller/upload_routes.py | 2 +- backend/{repository => modules/upload/service}/__init__.py | 0 .../upload/service}/generate_file_signed_url.py | 0 .../{repository/files => modules/upload/service}/list_files.py | 0 .../{repository/files => modules/upload/service}/upload_file.py | 0 backend/packages/files/parsers/common.py | 2 +- backend/repository/files/__init__.py | 0 backend/routes/subscription_routes.py | 2 +- backend/tests/ragas_evaluation/run_evaluation.py | 2 +- 16 files changed, 8 insertions(+), 8 deletions(-) rename backend/{repository => modules/brain/service}/brain_subscription/__init__.py (100%) rename backend/{repository => modules/brain/service}/brain_subscription/resend_invitation_email.py (100%) rename backend/{repository => modules/brain/service}/brain_subscription/subscription_invitation_service.py (100%) rename backend/{repository => modules/upload/service}/__init__.py (100%) rename backend/{repository/files => modules/upload/service}/generate_file_signed_url.py (100%) rename backend/{repository/files => modules/upload/service}/list_files.py (100%) rename backend/{repository/files => modules/upload/service}/upload_file.py (100%) delete mode 100644 backend/repository/files/__init__.py diff --git a/backend/modules/brain/integrations/Notion/Notion_connector.py b/backend/modules/brain/integrations/Notion/Notion_connector.py index 72d3d5341..013d054b7 100644 --- a/backend/modules/brain/integrations/Notion/Notion_connector.py +++ b/backend/modules/brain/integrations/Notion/Notion_connector.py @@ -14,7 +14,7 @@ from modules.knowledge.dto.inputs import CreateKnowledgeProperties from modules.knowledge.repository.knowledge_interface import KnowledgeInterface from modules.knowledge.service.knowledge_service import KnowledgeService from pydantic import BaseModel -from repository.files.upload_file import upload_file_storage +from modules.upload.service.upload_file import upload_file_storage logger = get_logger(__name__) diff --git a/backend/modules/brain/knowledge_brain_qa.py b/backend/modules/brain/knowledge_brain_qa.py index ed3834bfa..de0bdc91f 100644 --- a/backend/modules/brain/knowledge_brain_qa.py +++ b/backend/modules/brain/knowledge_brain_qa.py @@ -24,7 +24,7 @@ from modules.chat.dto.outputs import GetChatHistoryOutput from modules.chat.service.chat_service import ChatService from pydantic import BaseModel, ConfigDict from pydantic_settings import BaseSettings -from repository.files.generate_file_signed_url import generate_file_signed_url +from modules.upload.service.generate_file_signed_url import generate_file_signed_url logger = get_logger(__name__) QUIVR_DEFAULT_PROMPT = "Your name is Quivr. You're a helpful assistant. If you don't know the answer, just say that you don't know, don't try to make up an answer." diff --git a/backend/repository/brain_subscription/__init__.py b/backend/modules/brain/service/brain_subscription/__init__.py similarity index 100% rename from backend/repository/brain_subscription/__init__.py rename to backend/modules/brain/service/brain_subscription/__init__.py diff --git a/backend/repository/brain_subscription/resend_invitation_email.py b/backend/modules/brain/service/brain_subscription/resend_invitation_email.py similarity index 100% rename from backend/repository/brain_subscription/resend_invitation_email.py rename to backend/modules/brain/service/brain_subscription/resend_invitation_email.py diff --git a/backend/repository/brain_subscription/subscription_invitation_service.py b/backend/modules/brain/service/brain_subscription/subscription_invitation_service.py similarity index 100% rename from backend/repository/brain_subscription/subscription_invitation_service.py rename to backend/modules/brain/service/brain_subscription/subscription_invitation_service.py diff --git a/backend/modules/brain/service/get_question_context_from_brain.py b/backend/modules/brain/service/get_question_context_from_brain.py index 14eca2c96..da7b9aa44 100644 --- a/backend/modules/brain/service/get_question_context_from_brain.py +++ b/backend/modules/brain/service/get_question_context_from_brain.py @@ -3,7 +3,7 @@ from uuid import UUID from attr import dataclass from logger import get_logger from models.settings import get_embeddings, get_supabase_client -from repository.files.generate_file_signed_url import generate_file_signed_url +from modules.upload.service.generate_file_signed_url import generate_file_signed_url from vectorstore.supabase import CustomSupabaseVectorStore logger = get_logger(__name__) diff --git a/backend/modules/knowledge/controller/knowledge_routes.py b/backend/modules/knowledge/controller/knowledge_routes.py index b8d09b26e..98e282b31 100644 --- a/backend/modules/knowledge/controller/knowledge_routes.py +++ b/backend/modules/knowledge/controller/knowledge_routes.py @@ -11,7 +11,7 @@ from modules.brain.service.brain_authorization_service import ( from modules.brain.service.brain_vector_service import BrainVectorService from modules.knowledge.service.knowledge_service import KnowledgeService from modules.user.entity.user_identity import UserIdentity -from repository.files.generate_file_signed_url import generate_file_signed_url +from modules.upload.service.generate_file_signed_url import generate_file_signed_url knowledge_router = APIRouter() logger = get_logger(__name__) diff --git a/backend/modules/upload/controller/upload_routes.py b/backend/modules/upload/controller/upload_routes.py index 0345daa0c..c7086fc47 100644 --- a/backend/modules/upload/controller/upload_routes.py +++ b/backend/modules/upload/controller/upload_routes.py @@ -22,7 +22,7 @@ from modules.notification.service.notification_service import NotificationServic from modules.user.entity.user_identity import UserIdentity from packages.files.file import convert_bytes, get_file_size from packages.utils.telemetry import maybe_send_telemetry -from repository.files.upload_file import upload_file_storage +from modules.upload.service.upload_file import upload_file_storage logger = get_logger(__name__) upload_router = APIRouter() diff --git a/backend/repository/__init__.py b/backend/modules/upload/service/__init__.py similarity index 100% rename from backend/repository/__init__.py rename to backend/modules/upload/service/__init__.py diff --git a/backend/repository/files/generate_file_signed_url.py b/backend/modules/upload/service/generate_file_signed_url.py similarity index 100% rename from backend/repository/files/generate_file_signed_url.py rename to backend/modules/upload/service/generate_file_signed_url.py diff --git a/backend/repository/files/list_files.py b/backend/modules/upload/service/list_files.py similarity index 100% rename from backend/repository/files/list_files.py rename to backend/modules/upload/service/list_files.py diff --git a/backend/repository/files/upload_file.py b/backend/modules/upload/service/upload_file.py similarity index 100% rename from backend/repository/files/upload_file.py rename to backend/modules/upload/service/upload_file.py diff --git a/backend/packages/files/parsers/common.py b/backend/packages/files/parsers/common.py index d439d8808..379566c6b 100644 --- a/backend/packages/files/parsers/common.py +++ b/backend/packages/files/parsers/common.py @@ -5,7 +5,7 @@ from logger import get_logger from models import File from modules.brain.service.brain_vector_service import BrainVectorService from packages.embeddings.vectors import Neurons -from repository.files.upload_file import DocumentSerializable +from modules.upload.service.upload_file import DocumentSerializable logger = get_logger(__name__) diff --git a/backend/repository/files/__init__.py b/backend/repository/files/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/backend/routes/subscription_routes.py b/backend/routes/subscription_routes.py index 1b50075f3..c864e37a7 100644 --- a/backend/routes/subscription_routes.py +++ b/backend/routes/subscription_routes.py @@ -17,7 +17,7 @@ from modules.prompt.service.prompt_service import PromptService from modules.user.entity.user_identity import UserIdentity from modules.user.service.user_service import UserService from pydantic import BaseModel -from repository.brain_subscription import ( +from modules.brain.service.brain_subscription import ( SubscriptionInvitationService, resend_invitation_email, ) diff --git a/backend/tests/ragas_evaluation/run_evaluation.py b/backend/tests/ragas_evaluation/run_evaluation.py index 4f31a52f3..9544a8e48 100644 --- a/backend/tests/ragas_evaluation/run_evaluation.py +++ b/backend/tests/ragas_evaluation/run_evaluation.py @@ -24,7 +24,7 @@ from modules.knowledge.dto.inputs import CreateKnowledgeProperties from modules.knowledge.service.knowledge_service import KnowledgeService from ragas import evaluate from ragas.embeddings.base import LangchainEmbeddingsWrapper -from repository.files.upload_file import upload_file_storage +from modules.upload.service.upload_file import upload_file_storage def main(