From ad06257891aefbba218321f8d2f2ceeef292ea30 Mon Sep 17 00:00:00 2001 From: st2411020231 Date: Fri, 9 Jan 2026 10:26:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=90=AF=E5=8A=A8=E8=84=9A=E6=9C=AC=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=87=AA=E5=8A=A8=E7=8E=AF=E5=A2=83=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E5=92=8C=E6=B5=8F=E8=A7=88=E5=99=A8=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 自动检查Python环境 - 自动安装依赖包 - 智能获取网络IP地址 - 自动打开浏览器预览 - 显示本地和局域网访问地址 --- 一键启动.bat | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 一键启动.bat diff --git a/一键启动.bat b/一键启动.bat new file mode 100644 index 0000000..fd11256 --- /dev/null +++ b/一键启动.bat @@ -0,0 +1,72 @@ +@echo off +chcp 65001 >nul +title Multi-Agent Decision Workshop - Smart Launcher + +echo ======================================== +echo Multi-Agent Decision Workshop - Smart Launcher + +echo ======================================== +echo. + +echo Checking Python environment... + +:: Check Python +python --version >nul 2>&1 +if errorlevel 1 ( + echo ERROR: Python not found + echo. + echo Please install Python 3.8+ and add to PATH + echo Download: https://www.python.org/downloads/ + echo. + pause + exit /b 1 +) + +echo OK Python environment check passed +echo. + +echo Checking dependencies... + +:: Check and install dependencies +python -m pip install -r requirements.txt >nul 2>&1 +if errorlevel 1 ( + echo ERROR: Dependencies installation failed, trying manual installation... + python -m pip install streamlit openai python-dotenv +) + +echo OK Dependencies check completed +echo. + +echo Getting network information... + +:: Get local IP address +for /f "tokens=2 delims=:" %%i in ('ipconfig ^| findstr "IPv4"') do ( + set "IP_ADDR=%%i" + goto :IP_FOUND +) + +:IP_FOUND +set "IP_ADDR=%IP_ADDR: =%" + +echo Network information obtained: +echo Local URL: http://localhost:8513 +echo LAN URL: http://%IP_ADDR%:8513 +echo. + +echo Starting application... +echo Please wait, browser will open automatically... +echo. + +:: Automatically open browser (local address) +start http://localhost:8513 + +:: Run application +python -m streamlit run app.py --server.headless true --server.port 8513 --server.address 0.0.0.0 --browser.gatherUsageStats false --browser.serverAddress 0.0.0.0 + +echo. +echo ======================================== +echo Application stopped running + +echo ======================================== +echo. +pause \ No newline at end of file