WebUI for Baicai
Project description
Baicai WebUI
A modern web interface for the Baicai AI agent system, built with Streamlit.
Overview
Baicai WebUI provides an intuitive and interactive web interface for interacting with the Baicai AI agent system. It offers visualization capabilities for agent workflows, real-time interaction with AI agents, and a user-friendly environment for managing and monitoring agent activities.
Features
- 🎨 Modern, responsive web interface built with Streamlit
- 📊 Interactive workflow visualization with Mermaid diagrams
- 🔄 Real-time agent interaction and monitoring
- 📈 Flow-based agent workflow visualization
- 🔌 Seamless integration with Baicai Base framework
Requirements
- Python 3.10 or higher (but less than 3.12)
- Poetry for dependency management
- Baicai Base package installed
Installation
方法1: 使用 Poetry 安装(开发环境)
- 确保已安装 Baicai Base:
cd ../baicai_base
poetry install
- 安装 Baicai WebUI:
cd ../baicai_webui
poetry install
- 设置环境变量:
cp .env.example .env
# 编辑 .env 文件配置
方法2: 构建自包含包(生产环境)
自包含包包含了完整的 Python 环境和所有依赖,无需安装任何环境即可运行。
构建自包含包
- 确保已安装所有依赖:
cd baicai_webui
poetry install
- 运行构建脚本:
python build_self_contained.py
- 构建完成后,自包含包位于
dist/baicai-self-contained/目录
使用自包含包
- 将
dist/baicai-self-contained/目录压缩分发给用户 - 用户解压后,运行启动脚本即可:
- Windows: 双击
启动应用.bat - Linux/Mac: 在终端运行
./启动应用.sh
- Windows: 双击
自包含包特点
✅ 完全自包含,无需安装 Python ✅ 无需安装任何依赖包 ✅ 环境完全隔离,不会影响系统 ✅ 即解压即用 ✅ 跨平台兼容
Running the Application
开发环境运行
- 激活虚拟环境:
poetry shell
- 启动 Web 界面:
baicai-webui
或者直接运行:
streamlit run baicai_webui/app.py
自包含包运行
- 解压自包含包到任意位置
- 进入解压后的目录
- 运行启动脚本:
- Windows: 双击
启动应用.bat - Linux/Mac: 在终端运行
./启动应用.sh
- Windows: 双击
- 应用会自动在浏览器中打开,地址通常是 http://localhost:8501
Development
Setup Development Environment
- Install development dependencies:
poetry install --with dev
- Run tests:
pytest
构建自包含包
- 确保所有依赖已安装:
poetry install
- 运行构建脚本:
python build_self_contained.py
-
构建完成后,自包含包位于
dist/baicai-self-contained/目录 -
测试自包含包:
cd dist/baicai-self-contained
./启动应用.sh # Linux/Mac
# 或
启动应用.bat # Windows
构建脚本功能
- 复制完整的 Python 环境(包括解释器和标准库)
- 复制所有已安装的依赖包
- 复制项目代码和相关模块
- 创建启动脚本(Windows 和 Linux/Mac)
- 自动配置 Python 路径
- 生成说明文档
Project Structure
baicai_webui/
├── baicai_webui/ # Main package directory
│ ├── app.py # Main Streamlit application
│ ├── components/ # UI components
│ └── utils/ # Utility functions
├── docs/ # Documentation
├── tests/ # Test files
├── build_self_contained.py # 自包含包构建脚本
├── pyproject.toml # Project configuration
└── dist/ # 构建输出目录
└── baicai-self-contained/ # 自包含包
├── python/ # Python 环境
├── baicai_webui/ # 应用代码
├── baicai_base/ # 基础模块
├── baicai_dev/ # 开发模块
├── baicai_tutor/ # 教程模块
├── 启动应用.sh # Linux/Mac 启动脚本
├── 启动应用.bat # Windows 启动脚本
└── README.txt # 使用说明
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and ensure they pass
- Submit a pull request
License
This project is licensed under the GPL-3.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file baicai_webui-0.1.1.tar.gz.
File metadata
- Download URL: baicai_webui-0.1.1.tar.gz
- Upload date:
- Size: 89.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b6efbaefc9f1509a97a7bd07e50f387576240462eca4d830caaf3f1dcc305a9
|
|
| MD5 |
131bb60c953dbe80bf76db4e636d93bd
|
|
| BLAKE2b-256 |
21fe15f921612826179e797e11305a612804e87a8ce1975d6692347c8251adf5
|
File details
Details for the file baicai_webui-0.1.1-py3-none-any.whl.
File metadata
- Download URL: baicai_webui-0.1.1-py3-none-any.whl
- Upload date:
- Size: 105.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1394a425900c58e004a6c8c915fad7c41176750481cdbd131e2535c5ccb5b588
|
|
| MD5 |
7357e3788c67731936397881f4a56bf7
|
|
| BLAKE2b-256 |
14fafa2bd2595b618a778eecf0c1ff73e16a0fcca54446f19c4b4fa8964bde73
|