Fix SSE route dependency and align architecture docs
This commit is contained in:
7
backend/app/application/knowledge/__init__.py
Normal file
7
backend/app/application/knowledge/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
"""Initialize the app.application.knowledge package."""
|
||||
|
||||
from .services import KnowledgeRetrievalService
|
||||
# Keep package boundaries explicit so backend imports stay predictable.
|
||||
|
||||
|
||||
__all__ = ["KnowledgeRetrievalService"]
|
||||
19
backend/app/application/knowledge/services.py
Normal file
19
backend/app/application/knowledge/services.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""Implement application-layer logic for services."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.domain.retrieval import RetrievalQuery, Retriever, RetrievedChunk
|
||||
# Keep orchestration logic centralized so use-case flow stays easy to trace.
|
||||
|
||||
|
||||
|
||||
class KnowledgeRetrievalService:
|
||||
"""Provide the Knowledge Retrieval Service service."""
|
||||
def __init__(self, *, retriever: Retriever) -> None:
|
||||
"""Initialize the Knowledge Retrieval Service instance."""
|
||||
self.retriever = retriever
|
||||
|
||||
def retrieve(self, *, query: str, top_k: int, filters: str | None = None) -> list[RetrievedChunk]:
|
||||
"""Handle retrieve for the Knowledge Retrieval Service instance."""
|
||||
retrieval_query = RetrievalQuery(query=query, top_k=top_k, filters=filters)
|
||||
return self.retriever.retrieve(retrieval_query)
|
||||
Reference in New Issue
Block a user