diff --git a/bbit_ai/app/app.py b/bbit_ai/app/app.py index 34bc49e..37575d5 100644 --- a/bbit_ai/app/app.py +++ b/bbit_ai/app/app.py @@ -61,7 +61,7 @@ async def main(): # MCP服务-ailab endpoint_url_ai_lab = "wss://ai.ronsunny.cn:8090/aimcp/mcp_endpoint/mcp/?token=TsSP9lBq6Oa1WMkachHoS2TtNt4GKV/Gli24pk5Rjpk%3D" # endpoint_url_ai_lab = "ws://ce_bot_mcp:8004/mcp_endpoint/mcp/?token=TsSP9lBq6Oa1WMkachHoS2TtNt4GKV/Gli24pk5Rjpk%3D" - task_mcp1 = asyncio.create_task(init_mcp_server(endpoint_url_ai_lab)) + # task_mcp1 = asyncio.create_task(init_mcp_server(endpoint_url_ai_lab)) # MCP服务-ql endpoint_url_ql = "wss://ai.ronsunny.cn:8090/aimcp/mcp_endpoint/mcp/?token=8ZmCzp7FzsbxwHOg2%2FvBQkxrC3QWJiI%2B4iTfouExinjcT8ZgLwQfFUtgcMInI7St" @@ -70,7 +70,8 @@ async def main(): # RabbitMQ服务 task_mq = asyncio.create_task(mq_pull_analysis_async()) - await asyncio.gather(task_api, task_mcp1, task_mcp2, task_mq) + # await asyncio.gather(task_api, task_mcp1, task_mcp2, task_mq) + await asyncio.gather(task_api, task_mcp2, task_mq) if __name__ == "__main__": diff --git a/bbit_ai/app/config/minIO.py b/bbit_ai/app/config/minIO.py index e20a945..4975151 100644 --- a/bbit_ai/app/config/minIO.py +++ b/bbit_ai/app/config/minIO.py @@ -22,6 +22,13 @@ def push_file(bucket_name, object_name, file_bytes, contents, content_type): ) +def get_upload_token(bucket_name, object_name, xpires=timedelta(hours=1)): + upload_url = minio_client.presigned_put_object( + bucket_name=bucket_name, object_name=object_name, expires=xpires + ) + return {"upload_url": upload_url, "object_name": object_name} + + def get_temp_url(bucket_name, object_name): return minio_client.presigned_get_object( bucket_name, object_name, expires=timedelta(seconds=3600) diff --git a/bbit_ai/app/config/rabbitMQ.py b/bbit_ai/app/config/rabbitMQ.py index 2ae108d..51c911d 100644 --- a/bbit_ai/app/config/rabbitMQ.py +++ b/bbit_ai/app/config/rabbitMQ.py @@ -1,7 +1,7 @@ from utils.GlobalVariable import LOCAL_IP RABBIT_HOST = LOCAL_IP -RABBIT_VHOST = "/bbit_ai" -RABBIT_USER = "bbit_ai" +RABBIT_VHOST = "bbit_ai" +RABBIT_USER = "ai_lab" RABBIT_PASSWORD = "123456" QUEUE_NAME = "analysis_queue" diff --git a/bbit_ai/app/routers/Service.py b/bbit_ai/app/routers/Service.py index cbf5ee9..58b368f 100644 --- a/bbit_ai/app/routers/Service.py +++ b/bbit_ai/app/routers/Service.py @@ -4,15 +4,15 @@ from uuid import UUID from fastapi import APIRouter, Depends import db.postgres as pg +import utils.MyUtils as utils +from agent.serviceAgent import get_service_agent_reply from config.security import get_user_id_from_token +from llm.memLLM import take_memory +from llm.titleChain import get_title from models.BaseResponse import BaseResponse from models.ChatRequest import ChatRequest serviceRouter = APIRouter() -from llm.titleChain import get_title -from agent.serviceAgent import get_service_agent_reply -from llm.memLLM import take_memory -import utils.MyUtils as utils # 对话列表 diff --git a/bbit_ai/app/routers/Vision.py b/bbit_ai/app/routers/Vision.py index 363a35d..a5da11f 100644 --- a/bbit_ai/app/routers/Vision.py +++ b/bbit_ai/app/routers/Vision.py @@ -1,8 +1,10 @@ +import uuid from uuid import UUID from fastapi import APIRouter, File, Form, Depends, Query import db.postgres as pg +from config.minIO import get_upload_token from config.security import get_user_id_from_token from llm.ticketLLM import * from models.BaseResponse import BaseResponse @@ -149,3 +151,10 @@ def getSilkwormCocoonAnalysisTasks( "items": items, } ) + + +@visionRouter.post("/getIVASCUploadToken") +def getIVASCUploadToken(): + # 生成唯一文件名,避免覆盖 + object_name = f"raw/{uuid.uuid4()}" + return get_upload_token("video-sca", object_name) diff --git a/vue/.vscode/launch.json b/vue/.vscode/launch.json index d3bcacb..08e0509 100644 --- a/vue/.vscode/launch.json +++ b/vue/.vscode/launch.json @@ -13,7 +13,7 @@ }, { "type": "chrome", - "name": "主干AI实验室", + "name": "AI实验室", "request": "launch", "url": "http://localhost:5666", "env": { "NODE_ENV": "development" }, diff --git a/vue/apps/web-antd/.env b/vue/apps/web-antd/.env index 978688a..c4bcd6b 100644 --- a/vue/apps/web-antd/.env +++ b/vue/apps/web-antd/.env @@ -1,5 +1,5 @@ # 应用标题 -VITE_APP_TITLE=主干AI实验室 +VITE_APP_TITLE=AI实验室 # 应用命名空间,用于缓存、store等功能的前缀,确保隔离 VITE_APP_NAMESPACE=vben-web-antd diff --git a/vue/apps/web-antd/src/router/routes/modules/cv.ts b/vue/apps/web-antd/src/router/routes/modules/cv.ts index b934ffd..350585c 100644 --- a/vue/apps/web-antd/src/router/routes/modules/cv.ts +++ b/vue/apps/web-antd/src/router/routes/modules/cv.ts @@ -7,7 +7,7 @@ const routes: RouteRecordRaw[] = [ { meta: { icon: 'ic:round-remove-red-eye', - authority: ['iva', 'sca', 'sca2', 'ysa', 'ticket', 'license'], + authority: ['iva', 'iva-sc', 'sca', 'sca2', 'ysa', 'ticket', 'license'], keepAlive: true, order: 2, title: $t('计算机视觉'), @@ -21,11 +21,22 @@ const routes: RouteRecordRaw[] = [ meta: { authority: ['iva'], icon: 'mdi:video', - title: $t('ai.intelligence_video_analysis'), + title: '工作视频分析', keepAlive: true, }, component: () => import('#/views/cv/iva/index.vue'), }, + { + name: 'IVA-sc', + path: '/cv/iva-sc', + meta: { + authority: ['iva-sc'], + icon: 'mdi:video-image', + title: '蚕茧视频分析', + keepAlive: true, + }, + component: () => import('#/views/cv/iva-sc/index.vue'), + }, { name: 'SCA', path: '/cv/sca', diff --git a/vue/apps/web-antd/src/router/routes/modules/set.ts b/vue/apps/web-antd/src/router/routes/modules/set.ts index add1cf4..ccf66e5 100644 --- a/vue/apps/web-antd/src/router/routes/modules/set.ts +++ b/vue/apps/web-antd/src/router/routes/modules/set.ts @@ -97,6 +97,16 @@ const routes: RouteRecordRaw[] = [ title: '数据可视化', }, }, + { + name: 'VMManager-webui', + path: '/set/VMManager', + component: IFrameView, + meta: { + icon: 'mdi:monitor-dashboard', + link: `https://10.10.12.100/ui/#/host`, + title: '虚拟机管理', + }, + }, ], }, ]; diff --git a/vue/apps/web-antd/src/views/cv/iva-sc/index.vue b/vue/apps/web-antd/src/views/cv/iva-sc/index.vue new file mode 100644 index 0000000..947d55a --- /dev/null +++ b/vue/apps/web-antd/src/views/cv/iva-sc/index.vue @@ -0,0 +1,502 @@ + + + diff --git a/vue/apps/web-antd/src/views/dashboard/workspace/index.vue b/vue/apps/web-antd/src/views/dashboard/workspace/index.vue index c14dd0e..2468fc3 100644 --- a/vue/apps/web-antd/src/views/dashboard/workspace/index.vue +++ b/vue/apps/web-antd/src/views/dashboard/workspace/index.vue @@ -19,9 +19,16 @@ const cv: WorkbenchQuickNavItem[] = [ color: '#3fb27f', authority: ['iva'], icon: 'mdi:video', - title: '视频智能分析', + title: '工作视频分析', url: '/cv/iva', }, + { + color: '#3fb27f', + authority: ['iva-sc'], + icon: 'mdi:video-image', + title: '蚕茧视频分析', + url: '/cv/iva-sc', + }, { color: '#3fb27f', authority: ['sca'], @@ -139,7 +146,7 @@ function getGreeting() { {{ getGreeting() }}, {{ userStore.userInfo?.username }}, 开始您一天的工作吧! - +