From dd74ae2585f2e180e5b56ad1c232cadc5d28f897 Mon Sep 17 00:00:00 2001 From: MerCry Date: Wed, 25 Feb 2026 23:45:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=87=E6=8D=A2=E5=88=B0=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=A3=80=E7=B4=A2=E5=99=A8=E5=B9=B6=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E7=BC=96=E6=8E=92=E6=97=A5=E5=BF=97=20[AC-AISVC-02,=20AC-AISVC?= =?UTF-8?q?-16]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ai-service/app/api/chat.py | 4 ++-- ai-service/app/services/orchestrator.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ai-service/app/api/chat.py b/ai-service/app/api/chat.py index f0a7828..97ed5e6 100644 --- a/ai-service/app/api/chat.py +++ b/ai-service/app/api/chat.py @@ -32,12 +32,12 @@ async def get_orchestrator_service_with_memory( Ensures each request has a fresh MemoryService with database session. """ from app.services.llm.factory import get_llm_config_manager - from app.services.retrieval.vector_retriever import get_vector_retriever + from app.services.retrieval.optimized_retriever import get_optimized_retriever memory_service = MemoryService(session) llm_config_manager = get_llm_config_manager() llm_client = llm_config_manager.get_client() - retriever = await get_vector_retriever() + retriever = await get_optimized_retriever() return OrchestratorService( llm_client=llm_client, diff --git a/ai-service/app/services/orchestrator.py b/ai-service/app/services/orchestrator.py index fde1158..79d0d7c 100644 --- a/ai-service/app/services/orchestrator.py +++ b/ai-service/app/services/orchestrator.py @@ -402,6 +402,12 @@ class OrchestratorService: messages.extend(ctx.merged_context.messages) messages.append({"role": "user", "content": ctx.current_message}) + + logger.info( + f"[AC-AISVC-02] Built {len(messages)} messages for LLM: " + f"system_len={len(system_content)}, history_count={len(ctx.merged_context.messages) if ctx.merged_context else 0}" + ) + logger.debug(f"[AC-AISVC-02] System prompt preview: {system_content[:500]}...") return messages