From b1b764eac98d657005084e01b3dc89144d592e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AC=A7=E9=98=B3=E6=B4=8B?= <2443479321@qq.com> Date: Fri, 11 Sep 2026 14:14:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=AE=A2=E6=9C=8Dagent=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E8=B0=83=E6=95=B4=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/{routers => chat}/customer_agent.py | 0 api/{routers => chat}/knowledge.py | 0 api/router.py | 6 ++---- tests/test_customer_agent_router.py | 2 +- tests/test_knowledge_router.py | 3 +-- 5 files changed, 4 insertions(+), 7 deletions(-) rename api/{routers => chat}/customer_agent.py (100%) rename api/{routers => chat}/knowledge.py (100%) diff --git a/api/routers/customer_agent.py b/api/chat/customer_agent.py similarity index 100% rename from api/routers/customer_agent.py rename to api/chat/customer_agent.py diff --git a/api/routers/knowledge.py b/api/chat/knowledge.py similarity index 100% rename from api/routers/knowledge.py rename to api/chat/knowledge.py diff --git a/api/router.py b/api/router.py index 2e35ced..e623950 100644 --- a/api/router.py +++ b/api/router.py @@ -3,10 +3,8 @@ """ from fastapi import APIRouter -from api.routers import auth -from api.routers import customer_agent -from api.routers import knowledge -from api.routers import auth, product, questionnaire +from api.chat import customer_agent, knowledge +from api.routers import product, questionnaire from api.routers import account, auth, holdings, purchase, redeem api_router = APIRouter() diff --git a/tests/test_customer_agent_router.py b/tests/test_customer_agent_router.py index 2604a94..20613f8 100644 --- a/tests/test_customer_agent_router.py +++ b/tests/test_customer_agent_router.py @@ -5,7 +5,7 @@ from types import SimpleNamespace import httpx from fastapi import FastAPI -from api.routers.customer_agent import router +from api.chat.customer_agent import router from rag.intent import Intent from service.customer_agent.chat import AnonymousCustomerAgent from agent.customer_agent.session import AnonymousSessionService diff --git a/tests/test_knowledge_router.py b/tests/test_knowledge_router.py index bc7e8d5..d18f13e 100644 --- a/tests/test_knowledge_router.py +++ b/tests/test_knowledge_router.py @@ -1,9 +1,8 @@ import tempfile import unittest -from types import SimpleNamespace from unittest.mock import AsyncMock -from api.routers.knowledge import ( +from api.chat.knowledge import ( confirm_document_upload, delete_document, get_document,