From 06c3352eaa5460c14e48c95759766491b4fca769 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Fri, 28 Mar 2025 00:48:33 +0800 Subject: [PATCH] =?UTF-8?q?Agent=20=E6=94=BE=E5=9C=A8=E4=BA=86=20tools=20?= =?UTF-8?q?=E9=87=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routers/tool_router.py | 9 +++++++- web/src/assets/main.css | 25 ++++++++++++++++++++++ web/src/components/ChatComponent.vue | 4 ++-- web/src/layouts/AppLayout.vue | 5 ----- web/src/router/index.js | 32 +++++++++++++++++----------- web/src/views/AgentView.vue | 2 +- web/src/views/ChatView.vue | 9 +++++++- web/src/views/ToolsView.vue | 12 ++++------- 8 files changed, 67 insertions(+), 31 deletions(-) diff --git a/src/routers/tool_router.py b/src/routers/tool_router.py index 22573fde..ace06b65 100644 --- a/src/routers/tool_router.py +++ b/src/routers/tool_router.py @@ -13,7 +13,7 @@ class Tool(BaseModel): title: str description: str url: str - method: str + method: Optional[str] = "POST" params: Optional[Dict[str, Any]] = None @tool.get("/", response_model=List[Tool]) @@ -32,6 +32,12 @@ async def route_index(): description="将PDF文件转换为文本文件。", url="/tools/pdf2txt", method="POST", + ), + Tool( + name="agent", + title="智能体(Dev)", + description="智能体演练平台", + url="/tools/agent", ) ] @@ -48,3 +54,4 @@ async def handle_pdf2txt(file: str = Body(...)): from src.plugins import ocr text = ocr.process_pdf(file) return {"text": text} + diff --git a/web/src/assets/main.css b/web/src/assets/main.css index a7ca809e..c07dd712 100644 --- a/web/src/assets/main.css +++ b/web/src/assets/main.css @@ -15,4 +15,29 @@ h2 { margin: 20px 0 10px 0; } +} + +.iconfont { + max-width: 100%; + max-height: 100%; + + &.icon-10 { + width: 10px; + height: 10px; + } + + &.icon-16 { + width: 16px; + height: 16px; + } + + &.icon-20 { + width: 20px; + height: 20px; + } + + &.icon-24 { + width: 24px; + height: 24px; + } } \ No newline at end of file diff --git a/web/src/components/ChatComponent.vue b/web/src/components/ChatComponent.vue index 4f98c5e0..94dd4224 100644 --- a/web/src/components/ChatComponent.vue +++ b/web/src/components/ChatComponent.vue @@ -7,8 +7,8 @@ class="close nav-btn" @click="state.isSidebarOpen = true" > - - + 设置 +