redis include + client with bis logic
This commit is contained in:
@@ -19,7 +19,9 @@ from src.domain.repositories.collection_access_repository import ICollectionAcce
|
||||
from src.domain.repositories.vector_repository import IVectorRepository
|
||||
from src.infrastructure.external.yandex_ocr import YandexOCRService
|
||||
from src.infrastructure.external.deepseek_client import DeepSeekClient
|
||||
from src.infrastructure.external.redis_client import RedisClient
|
||||
from src.application.services.document_parser_service import DocumentParserService
|
||||
from src.application.services.cache_service import CacheService
|
||||
from src.application.use_cases.user_use_cases import UserUseCases
|
||||
from src.application.use_cases.collection_use_cases import CollectionUseCases
|
||||
from src.application.use_cases.document_use_cases import DocumentUseCases
|
||||
@@ -73,6 +75,14 @@ class RepositoryProvider(Provider):
|
||||
|
||||
|
||||
class ServiceProvider(Provider):
|
||||
@provide(scope=Scope.APP)
|
||||
def get_redis_client(self) -> RedisClient:
|
||||
return RedisClient()
|
||||
|
||||
@provide(scope=Scope.APP)
|
||||
def get_cache_service(self, redis_client: RedisClient) -> CacheService:
|
||||
return CacheService(redis_client)
|
||||
|
||||
@provide(scope=Scope.APP)
|
||||
def get_ocr_service(self) -> YandexOCRService:
|
||||
return YandexOCRService()
|
||||
@@ -180,9 +190,10 @@ class UseCaseProvider(Provider):
|
||||
rag_service: RAGService,
|
||||
document_repo: IDocumentRepository,
|
||||
conversation_repo: IConversationRepository,
|
||||
message_repo: IMessageRepository
|
||||
message_repo: IMessageRepository,
|
||||
cache_service: CacheService
|
||||
) -> RAGUseCases:
|
||||
return RAGUseCases(rag_service, document_repo, conversation_repo, message_repo)
|
||||
return RAGUseCases(rag_service, document_repo, conversation_repo, message_repo, cache_service)
|
||||
|
||||
|
||||
def create_container() -> Container:
|
||||
|
||||
Reference in New Issue
Block a user