Add LLM token

This commit is contained in:
wangwei
2026-07-02 22:03:39 +08:00
parent e3afb8a07a
commit 52e67b0e7b
36 changed files with 2392 additions and 394 deletions
+15
View File
@@ -6,6 +6,7 @@ from functools import lru_cache
from typing import Callable
from app.application.agent import AgentConversationService, AgentSessionService
from app.application.agent.agentic_service import AgenticConversationService
from app.application.documents import DocumentCommandService, DocumentQueryService
from app.application.knowledge import KnowledgeRetrievalService
from app.application.perception.services import PerceptionService
@@ -365,6 +366,20 @@ def get_agent_session_service() -> AgentSessionService:
return AgentSessionService(conversation_store=get_conversation_store())
@lru_cache
def get_agentic_conversation_service() -> AgenticConversationService:
"""Return the Agentic RAG service (P0-1).
Uses the same retrieval, generation, and session infrastructure as the
standard chat service so no additional dependencies are required.
"""
return AgenticConversationService(
retrieval_service=get_retrieval_service(),
answer_generator=OpenAICompatibleAnswerGenerator(),
conversation_store=get_conversation_store(),
)
@lru_cache
def get_celery_app():
"""Return the shared Celery application instance.