fp-webui 0.1.1.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,183 @@
1
+ Metadata-Version: 2.4
2
+ Name: fp-webui
3
+ Version: 0.1.1.dev0
4
+ Summary: 五块卵石 - Web 界面
5
+ Author: zpb
6
+ License-Expression: MIT
7
+ Keywords: agent,webui,fastapi
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Environment :: Web Environment
14
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
15
+ Requires-Python: >=3.11
16
+ Description-Content-Type: text/markdown
17
+ Requires-Dist: fp-core>=0.1.0
18
+ Requires-Dist: fastapi>=0.122.0
19
+ Requires-Dist: uvicorn>=0.38.0
20
+
21
+ # fp-webui — 五块卵石 Web 界面
22
+
23
+ [![PyPI](https://img.shields.io/pypi/v/fp-webui)](https://pypi.org/project/fp-webui/)
24
+ [![Python](https://img.shields.io/pypi/pyversions/fp-webui)](https://pypi.org/project/fp-webui/)
25
+ [![License](https://img.shields.io/pypi/l/fp-webui)](LICENSE)
26
+
27
+ ## 简介
28
+
29
+ **fp-webui** 是五块卵石(Five Pebbles)Agent 框架的 Web 图形界面。基于 FastAPI + Uvicorn 构建,提供浏览器端的 Agent 交互体验,支持实时流式对话、会话管理、配置调整等。
30
+
31
+ > 通过 `pip install fp-agent[webui]` 或 `pip install fp-webui` 安装。
32
+
33
+ ---
34
+
35
+ ## 特性
36
+
37
+ - **浏览器端对话** — 现代化的 Web 聊天界面,无需安装终端
38
+ - **流式响应** — Server-Sent Events (SSE) 实时推送 LLM 输出
39
+ - **多会话管理** — 创建/切换/删除会话,历史记录永久保存
40
+ - **Markdown 渲染** — 代码语法高亮、表格、数学公式完美展示
41
+ - **深色/浅色主题** — 一键切换,护眼模式
42
+ - **配置面板** — 浏览器内调整 LLM 参数、切换模型
43
+ - **文件上传** — 支持拖拽上传文件作为上下文
44
+
45
+ ---
46
+
47
+ ## 安装
48
+
49
+ ```bash
50
+ pip install fp-webui
51
+ ```
52
+
53
+ 要求 Python >= 3.11。
54
+
55
+ ---
56
+
57
+ ## 快速启动
58
+
59
+ ### 命令行启动
60
+
61
+ ```bash
62
+ fp-webui
63
+ ```
64
+
65
+ 或使用主包:
66
+
67
+ ```bash
68
+ pip install fp-agent[webui]
69
+ fp --webui
70
+ ```
71
+
72
+ ### 指定主机和端口
73
+
74
+ ```bash
75
+ fp-webui --host 0.0.0.0 --port 8080
76
+ ```
77
+
78
+ ### 启动输出
79
+
80
+ ```
81
+ ╭─ Five Pebbles WebUI ─────────────────────╮
82
+ │ │
83
+ │ 地址: http://localhost:7860 │
84
+ │ 共享: http://192.168.1.100:7860 │
85
+ │ │
86
+ │ 按 Ctrl+C 停止服务 │
87
+ ╰───────────────────────────────────────────╯
88
+ ```
89
+
90
+ ---
91
+
92
+ ## 访问界面
93
+
94
+ 打开浏览器访问 `http://localhost:7860`:
95
+
96
+ ```
97
+ ┌─────────────────────────────────────────┐
98
+ │ 🤖 五块卵石 [⚙] [🌙] │
99
+ ├─────────────────────────────────────────┤
100
+ │ │
101
+ │ ┌─────────────────────────────────┐ │
102
+ │ │ 你好!我是五块卵石,有什么可以 │ │
103
+ │ │ 帮你的? │ │
104
+ │ └─────────────────────────────────┘ │
105
+ │ │
106
+ │ ┌─────────────────────────────────┐ │
107
+ │ │ 请用 Python 写一个 Web 服务器 │ │
108
+ │ │ [发送] │ │
109
+ │ └─────────────────────────────────┘ │
110
+ │ │
111
+ │ [会话: default] [新建] [历史] │
112
+ └─────────────────────────────────────────┘
113
+ ```
114
+
115
+ ---
116
+
117
+ ## API 接口(非 Web 页面场景)
118
+
119
+ fp-webui 同时暴露了 RESTful API,方便集成到其他前端或自动化工具中:
120
+
121
+ | 端点 | 方法 | 说明 |
122
+ |------|------|------|
123
+ | `/api/chat` | POST | 发送消息并获取流式响应 (SSE) |
124
+ | `/api/sessions` | GET | 获取会话列表 |
125
+ | `/api/sessions` | POST | 创建新会话 |
126
+ | `/api/sessions/{id}` | DELETE | 删除会话 |
127
+ | `/api/config` | GET | 获取当前配置 |
128
+ | `/api/config` | PUT | 更新配置 |
129
+ | `/api/models` | GET | 获取可用模型列表 |
130
+ | `/health` | GET | 健康检查 |
131
+
132
+ ### 调用示例
133
+
134
+ ```bash
135
+ curl -N http://localhost:7860/api/chat \
136
+ -H "Content-Type: application/json" \
137
+ -d '{"message": "你好", "session_id": "default", "stream": true}'
138
+ ```
139
+
140
+ ---
141
+
142
+ ## 配置
143
+
144
+ 通过命令行参数或环境变量配置:
145
+
146
+ ```bash
147
+ # 命令行参数
148
+ fp-webui --host 127.0.0.1 --port 7860 --reload
149
+
150
+ # 环境变量
151
+ export FP_WEBUI_HOST=0.0.0.0
152
+ export FP_WEBUI_PORT=7860
153
+ export FP_WEBUI_THEME=dark
154
+ fp-webui
155
+ ```
156
+
157
+ 配置文件(YAML):
158
+
159
+ ```yaml
160
+ webui:
161
+ host: "0.0.0.0"
162
+ port: 7860
163
+ theme: "dark" # dark / light
164
+ session_storage: "file" # file / memory
165
+ max_upload_size_mb: 10
166
+ cors_origins: ["*"]
167
+ ```
168
+
169
+ ---
170
+
171
+ ## 依赖
172
+
173
+ | 依赖 | 版本 | 用途 |
174
+ |------|------|------|
175
+ | `fp-core` | >= 0.1.0 | Agent 核心引擎 |
176
+ | `fastapi` | >= 0.122.0 | Web 框架 |
177
+ | `uvicorn` | >= 0.38.0 | ASGI 服务器 |
178
+
179
+ ---
180
+
181
+ ## 许可
182
+
183
+ MIT © zpb
@@ -0,0 +1,163 @@
1
+ # fp-webui — 五块卵石 Web 界面
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/fp-webui)](https://pypi.org/project/fp-webui/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/fp-webui)](https://pypi.org/project/fp-webui/)
5
+ [![License](https://img.shields.io/pypi/l/fp-webui)](LICENSE)
6
+
7
+ ## 简介
8
+
9
+ **fp-webui** 是五块卵石(Five Pebbles)Agent 框架的 Web 图形界面。基于 FastAPI + Uvicorn 构建,提供浏览器端的 Agent 交互体验,支持实时流式对话、会话管理、配置调整等。
10
+
11
+ > 通过 `pip install fp-agent[webui]` 或 `pip install fp-webui` 安装。
12
+
13
+ ---
14
+
15
+ ## 特性
16
+
17
+ - **浏览器端对话** — 现代化的 Web 聊天界面,无需安装终端
18
+ - **流式响应** — Server-Sent Events (SSE) 实时推送 LLM 输出
19
+ - **多会话管理** — 创建/切换/删除会话,历史记录永久保存
20
+ - **Markdown 渲染** — 代码语法高亮、表格、数学公式完美展示
21
+ - **深色/浅色主题** — 一键切换,护眼模式
22
+ - **配置面板** — 浏览器内调整 LLM 参数、切换模型
23
+ - **文件上传** — 支持拖拽上传文件作为上下文
24
+
25
+ ---
26
+
27
+ ## 安装
28
+
29
+ ```bash
30
+ pip install fp-webui
31
+ ```
32
+
33
+ 要求 Python >= 3.11。
34
+
35
+ ---
36
+
37
+ ## 快速启动
38
+
39
+ ### 命令行启动
40
+
41
+ ```bash
42
+ fp-webui
43
+ ```
44
+
45
+ 或使用主包:
46
+
47
+ ```bash
48
+ pip install fp-agent[webui]
49
+ fp --webui
50
+ ```
51
+
52
+ ### 指定主机和端口
53
+
54
+ ```bash
55
+ fp-webui --host 0.0.0.0 --port 8080
56
+ ```
57
+
58
+ ### 启动输出
59
+
60
+ ```
61
+ ╭─ Five Pebbles WebUI ─────────────────────╮
62
+ │ │
63
+ │ 地址: http://localhost:7860 │
64
+ │ 共享: http://192.168.1.100:7860 │
65
+ │ │
66
+ │ 按 Ctrl+C 停止服务 │
67
+ ╰───────────────────────────────────────────╯
68
+ ```
69
+
70
+ ---
71
+
72
+ ## 访问界面
73
+
74
+ 打开浏览器访问 `http://localhost:7860`:
75
+
76
+ ```
77
+ ┌─────────────────────────────────────────┐
78
+ │ 🤖 五块卵石 [⚙] [🌙] │
79
+ ├─────────────────────────────────────────┤
80
+ │ │
81
+ │ ┌─────────────────────────────────┐ │
82
+ │ │ 你好!我是五块卵石,有什么可以 │ │
83
+ │ │ 帮你的? │ │
84
+ │ └─────────────────────────────────┘ │
85
+ │ │
86
+ │ ┌─────────────────────────────────┐ │
87
+ │ │ 请用 Python 写一个 Web 服务器 │ │
88
+ │ │ [发送] │ │
89
+ │ └─────────────────────────────────┘ │
90
+ │ │
91
+ │ [会话: default] [新建] [历史] │
92
+ └─────────────────────────────────────────┘
93
+ ```
94
+
95
+ ---
96
+
97
+ ## API 接口(非 Web 页面场景)
98
+
99
+ fp-webui 同时暴露了 RESTful API,方便集成到其他前端或自动化工具中:
100
+
101
+ | 端点 | 方法 | 说明 |
102
+ |------|------|------|
103
+ | `/api/chat` | POST | 发送消息并获取流式响应 (SSE) |
104
+ | `/api/sessions` | GET | 获取会话列表 |
105
+ | `/api/sessions` | POST | 创建新会话 |
106
+ | `/api/sessions/{id}` | DELETE | 删除会话 |
107
+ | `/api/config` | GET | 获取当前配置 |
108
+ | `/api/config` | PUT | 更新配置 |
109
+ | `/api/models` | GET | 获取可用模型列表 |
110
+ | `/health` | GET | 健康检查 |
111
+
112
+ ### 调用示例
113
+
114
+ ```bash
115
+ curl -N http://localhost:7860/api/chat \
116
+ -H "Content-Type: application/json" \
117
+ -d '{"message": "你好", "session_id": "default", "stream": true}'
118
+ ```
119
+
120
+ ---
121
+
122
+ ## 配置
123
+
124
+ 通过命令行参数或环境变量配置:
125
+
126
+ ```bash
127
+ # 命令行参数
128
+ fp-webui --host 127.0.0.1 --port 7860 --reload
129
+
130
+ # 环境变量
131
+ export FP_WEBUI_HOST=0.0.0.0
132
+ export FP_WEBUI_PORT=7860
133
+ export FP_WEBUI_THEME=dark
134
+ fp-webui
135
+ ```
136
+
137
+ 配置文件(YAML):
138
+
139
+ ```yaml
140
+ webui:
141
+ host: "0.0.0.0"
142
+ port: 7860
143
+ theme: "dark" # dark / light
144
+ session_storage: "file" # file / memory
145
+ max_upload_size_mb: 10
146
+ cors_origins: ["*"]
147
+ ```
148
+
149
+ ---
150
+
151
+ ## 依赖
152
+
153
+ | 依赖 | 版本 | 用途 |
154
+ |------|------|------|
155
+ | `fp-core` | >= 0.1.0 | Agent 核心引擎 |
156
+ | `fastapi` | >= 0.122.0 | Web 框架 |
157
+ | `uvicorn` | >= 0.38.0 | ASGI 服务器 |
158
+
159
+ ---
160
+
161
+ ## 许可
162
+
163
+ MIT © zpb
@@ -0,0 +1,42 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64.0", "setuptools-scm>=8.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "fp-webui"
7
+ dynamic = ["version"]
8
+ description = "五块卵石 - Web 界面"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ authors = [{name = "zpb"}]
13
+ keywords = ["agent", "webui", "fastapi"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Operating System :: OS Independent",
20
+ "Environment :: Web Environment",
21
+ "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
22
+ ]
23
+
24
+ dependencies = [
25
+ "fp-core>=0.1.0",
26
+ "fastapi>=0.122.0",
27
+ "uvicorn>=0.38.0",
28
+ ]
29
+
30
+ [project.scripts]
31
+ fp-webui = "fp_webui.main:main"
32
+
33
+ [tool.setuptools.packages.find]
34
+ where = ["src"]
35
+ include = ["fp_webui*"]
36
+
37
+ [tool.setuptools.package-data]
38
+ "fp_webui" = ["static/*"]
39
+
40
+ [tool.setuptools_scm]
41
+ root = "../.."
42
+ local_scheme = "no-local-version"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from .main import main as run
2
+
3
+ __all__ = ["run"]