Create rag-client package
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
from functools import lru_cache
|
||||
|
||||
from rag_client import HTTPRAGService, RAGServiceBase
|
||||
|
||||
from .config import Settings, settings
|
||||
from .services import (
|
||||
ConversationManagerService,
|
||||
@@ -10,7 +12,6 @@ from .services import (
|
||||
QuickReplyContentService,
|
||||
)
|
||||
from .services.firestore_service import FirestoreService
|
||||
from .services.rag_service import RAGService
|
||||
from .services.redis_service import RedisService
|
||||
|
||||
|
||||
@@ -50,9 +51,14 @@ def get_notification_manager() -> NotificationManagerService:
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def get_rag_service() -> RAGService:
|
||||
def get_rag_service() -> RAGServiceBase:
|
||||
"""Get RAG service instance."""
|
||||
return RAGService(settings)
|
||||
return HTTPRAGService(
|
||||
endpoint_url=settings.rag_endpoint_url,
|
||||
max_connections=100,
|
||||
max_keepalive_connections=20,
|
||||
timeout=30.0,
|
||||
)
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
|
||||
@@ -5,6 +5,8 @@ import re
|
||||
from datetime import UTC, datetime, timedelta
|
||||
from uuid import uuid4
|
||||
|
||||
from rag_client import RAGServiceBase
|
||||
|
||||
from capa_de_integracion.config import Settings
|
||||
from capa_de_integracion.models import (
|
||||
ConversationEntry,
|
||||
@@ -18,7 +20,6 @@ from capa_de_integracion.models.notification import NotificationSession
|
||||
from .dlp_service import DLPService
|
||||
from .firestore_service import FirestoreService
|
||||
from .quick_reply_content import QuickReplyContentService
|
||||
from .rag_service import RAGService
|
||||
from .redis_service import RedisService
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -35,7 +36,7 @@ class ConversationManagerService:
|
||||
def __init__(
|
||||
self,
|
||||
settings: Settings,
|
||||
rag_service: RAGService,
|
||||
rag_service: RAGServiceBase,
|
||||
redis_service: RedisService,
|
||||
firestore_service: FirestoreService,
|
||||
dlp_service: DLPService,
|
||||
|
||||
Reference in New Issue
Block a user