Fix SSE route dependency and align architecture docs

This commit is contained in:
ash66
2026-05-18 16:32:42 +08:00
parent 86b9ac806a
commit 3f69cad404
149 changed files with 4786 additions and 5957 deletions

View 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)