Agent 放在了 tools 里面
This commit is contained in:
parent
623e2e69da
commit
06c3352eaa
@ -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}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -7,8 +7,8 @@
|
||||
class="close nav-btn"
|
||||
@click="state.isSidebarOpen = true"
|
||||
>
|
||||
<MenuOutlined />
|
||||
</div>
|
||||
<img src="@/assets/icons/sidebar_left.svg" class="iconfont icon-24" alt="设置" />
|
||||
</div>
|
||||
<a-tooltip :title="configStore.config?.model_name" placement="rightTop">
|
||||
<div class="newchat nav-btn" @click="$emit('newconv')">
|
||||
<PlusCircleOutlined /> <span class="text">新对话</span>
|
||||
|
||||
@ -82,11 +82,6 @@ const mainList = [{
|
||||
path: '/chat',
|
||||
icon: MessageOutlined,
|
||||
activeIcon: MessageFilled,
|
||||
}, {
|
||||
name: '智能体',
|
||||
path: '/agent',
|
||||
icon: RobotOutlined,
|
||||
activeIcon: RobotFilled,
|
||||
}, {
|
||||
name: '图谱',
|
||||
path: '/graph',
|
||||
|
||||
@ -30,19 +30,19 @@ const router = createRouter({
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/agent',
|
||||
name: 'agent',
|
||||
component: AppLayout,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'AgentComp',
|
||||
component: () => import('../views/AgentView.vue'),
|
||||
meta: { keepAlive: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// path: '/agent',
|
||||
// name: 'agent',
|
||||
// component: AppLayout,
|
||||
// children: [
|
||||
// {
|
||||
// path: '',
|
||||
// name: 'AgentComp',
|
||||
// component: () => import('../views/AgentView.vue'),
|
||||
// meta: { keepAlive: true }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: '/graph',
|
||||
name: 'graph',
|
||||
@ -109,6 +109,12 @@ const router = createRouter({
|
||||
name: 'PDF_to_TXT',
|
||||
component: () => import('../components/tools/ConvertToTxtComponent.vue'),
|
||||
},
|
||||
{
|
||||
path: 'agent',
|
||||
name: 'Agent',
|
||||
component: () => import('../views/AgentView.vue'),
|
||||
meta: { keepAlive: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
<div v-if="toolCall" class="tool-call-display" :class="{ 'is-collapsed': !expandedToolCalls.has(toolCall.id) }">
|
||||
<div class="tool-header" @click="toggleToolCall(toolCall.id)">
|
||||
<span v-if="!toolCall.toolResultMsg">
|
||||
<ThunderboltOutlined />
|
||||
<ThunderboltOutlined />
|
||||
<span>正在调用工具: </span>
|
||||
<span class="tool-name">{{ toolCall.function.name }}</span>
|
||||
</span>
|
||||
|
||||
@ -4,7 +4,9 @@
|
||||
<div class="actions">
|
||||
<!-- <div class="action new" @click="addNewConv"><FormOutlined /></div> -->
|
||||
<span class="header-title">对话历史</span>
|
||||
<div class="action close" @click="state.isSidebarOpen = false"><MenuOutlined /></div>
|
||||
<div class="action close" @click="state.isSidebarOpen = false">
|
||||
<img src="@/assets/icons/sidebar_left.svg" class="iconfont icon-24" alt="设置" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="conversation-list">
|
||||
<div class="conversation"
|
||||
@ -178,6 +180,11 @@ onMounted(() => {
|
||||
&:hover {
|
||||
background-color: var(--main-light-3);
|
||||
}
|
||||
|
||||
.nav-btn-icon {
|
||||
width: 1.2rem;
|
||||
height: 1.2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -5,13 +5,9 @@
|
||||
description="这里展示了各种可用的工具,重点是为了测试部分功能的页面。(注:不是大模型的工具)"
|
||||
>
|
||||
</HeaderComponent>
|
||||
|
||||
<div class="tools-grid">
|
||||
<div v-for="tool in tools" :key="tool.id" class="tool-card" @click="navigateToTool(tool.name)">
|
||||
<div class="tool-header">
|
||||
<!-- <div class="tool-icon">
|
||||
<component :is="iconMap[tool.name]" />
|
||||
</div> -->
|
||||
<h3>{{ tool.title }}</h3>
|
||||
</div>
|
||||
<div class="tool-info">
|
||||
@ -79,19 +75,19 @@ onMounted(() => {
|
||||
border: 1px solid var(--gray-300);
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||
transition: transform 0.1s ease, box-shadow 0.1s ease;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
|
||||
// transform: translateY(-1px);
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
.tool-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
font-size: 1rem;
|
||||
font-size: 15px;
|
||||
|
||||
.tool-icon {
|
||||
margin-right: 10px;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user