Skip to main content

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 安装(开发环境)

  1. 确保已安装 Baicai Base:
cd ../baicai_base
poetry install
  1. 安装 Baicai WebUI:
cd ../baicai_webui
poetry install
  1. 设置环境变量:
cp .env.example .env
# 编辑 .env 文件配置

方法2: 构建自包含包(生产环境)

自包含包包含了完整的 Python 环境和所有依赖,无需安装任何环境即可运行。

构建自包含包

  1. 确保已安装所有依赖:
cd baicai_webui
poetry install
  1. 运行构建脚本:
python build_self_contained.py
  1. 构建完成后,自包含包位于 dist/baicai-self-contained/ 目录

使用自包含包

  1. dist/baicai-self-contained/ 目录压缩分发给用户
  2. 用户解压后,运行启动脚本即可:
    • Windows: 双击 启动应用.bat
    • Linux/Mac: 在终端运行 ./启动应用.sh

自包含包特点

✅ 完全自包含,无需安装 Python ✅ 无需安装任何依赖包 ✅ 环境完全隔离,不会影响系统 ✅ 即解压即用 ✅ 跨平台兼容

Running the Application

开发环境运行

  1. 激活虚拟环境:
poetry shell
  1. 启动 Web 界面:
baicai-webui

或者直接运行:

streamlit run baicai_webui/app.py

自包含包运行

  1. 解压自包含包到任意位置
  2. 进入解压后的目录
  3. 运行启动脚本:
    • Windows: 双击 启动应用.bat
    • Linux/Mac: 在终端运行 ./启动应用.sh
  4. 应用会自动在浏览器中打开,地址通常是 http://localhost:8501

Development

Setup Development Environment

  1. Install development dependencies:
poetry install --with dev
  1. Run tests:
pytest

构建自包含包

  1. 确保所有依赖已安装:
poetry install
  1. 运行构建脚本:
python build_self_contained.py
  1. 构建完成后,自包含包位于 dist/baicai-self-contained/ 目录

  2. 测试自包含包:

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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and ensure they pass
  5. Submit a pull request

License

This project is licensed under the GPL-3.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

baicai_webui-0.1.1.tar.gz (89.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

baicai_webui-0.1.1-py3-none-any.whl (105.4 kB view details)

Uploaded Python 3

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

Hashes for baicai_webui-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4b6efbaefc9f1509a97a7bd07e50f387576240462eca4d830caaf3f1dcc305a9
MD5 131bb60c953dbe80bf76db4e636d93bd
BLAKE2b-256 21fe15f921612826179e797e11305a612804e87a8ce1975d6692347c8251adf5

See more details on using hashes here.

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

Hashes for baicai_webui-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1394a425900c58e004a6c8c915fad7c41176750481cdbd131e2535c5ccb5b588
MD5 7357e3788c67731936397881f4a56bf7
BLAKE2b-256 14fafa2bd2595b618a778eecf0c1ff73e16a0fcca54446f19c4b4fa8964bde73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page