feat: stream dual-agent answers over sse
This commit is contained in:
@@ -7,6 +7,7 @@ from fastapi import FastAPI
|
||||
from pymilvus import MilvusClient
|
||||
|
||||
from kbqa.config import get_settings
|
||||
from kbqa.chat.service import ChatService
|
||||
from kbqa.database import Database
|
||||
from kbqa.documents.service import DocumentService
|
||||
from kbqa.indexing.worker import IndexWorker
|
||||
@@ -53,6 +54,7 @@ async def lifespan(app: FastAPI) -> AsyncIterator[None]:
|
||||
vector_store,
|
||||
vector_mutation_lock,
|
||||
)
|
||||
chat_service = ChatService(settings, database.session_factory, retriever)
|
||||
app.state.settings = settings
|
||||
app.state.database = database
|
||||
app.state.milvus_client = milvus_client
|
||||
@@ -61,6 +63,7 @@ async def lifespan(app: FastAPI) -> AsyncIterator[None]:
|
||||
app.state.retriever = retriever
|
||||
app.state.index_worker = worker
|
||||
app.state.document_service = document_service
|
||||
app.state.chat_service = chat_service
|
||||
await worker.start()
|
||||
await document_service.recover_deletions()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user