Skip to content

Commit 00f0e95

Browse files
authored
Merge pull request #5 from Sanotsu/ai_tools_new_design
全面移除了初始版本的“AI智能助手”相关模块,并修正和新增一些细节
2 parents 00aa193 + 37f9893 commit 00f0e95

File tree

284 files changed

+2448
-17455
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+2448
-17455
lines changed

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
一些较大变更、新功能、bug 修复等记录放在此处,仅做参看的提交更新.
44

5+
## 0.4.1-beta.1
6+
7+
- refactor:
8+
- 全面移除了第一版“AI 智能助手”的所有功能代码,并简单调整了项目文件夹结构
9+
- feat:
10+
- 添加了应用签名
11+
- 支持了 DeepSeek 官方平台的 api
12+
- 模型选择弹窗添加关键词筛选
13+
- 自定义导入的模型列表可点击标题排序(默认是导入创建时间降序)
14+
- fix:
15+
- 修正不同云平台简单流式响应的处理可能会报错
16+
- "开启新对话"和滚动到底部按钮从输入框组件拆出,改在对话主页面悬浮
17+
18+
**注意**,因为有测试添加了应用签名,所以需要卸载重装:
19+
20+
- `0.4.0-beta.1`可以全量备份数据后重新覆盖恢复;更早的版本请当作全新应用使用。
21+
522
## 0.4.0-beta.1
623

724
- refactor:

README.md

+53-13
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ Smart Work&Life Mate
44

55
使用 flutter 开发的一个“智能工作生活类助手”应用。主要包含:
66

7-
- 以调用各个云平台部署的在线大模型 API 为基底的“**AI 智能助手**”,(简称“工具”)。
8-
- 2025-02-26 大模型 API 调用**只保留其 HTTP API 兼容 openAI API 结构的**平台和模型,不再兼容其他平台自己定义的 API 结构,具体如下:
7+
- 以简单参数调用各个云平台部署的在线大模型 API 为基底的“**AI 智能助手**”,(简称“工具”)。
8+
- 2025-03-04 大模型 API 调用**只保留其 HTTP API 兼容 openAI API 结构的**平台和模型,不再兼容其他平台自己定义的 API 结构,具体如下:
99
- 对话模型:
10-
- [百度](https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Fm2vrveyu)
1110
- [阿里](https://help.aliyun.com/zh/model-studio/developer-reference/compatibility-of-openai-with-dashscope)
11+
- [百度](https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Fm2vrveyu)
1212
- [腾讯](https://console.cloud.tencent.com/hunyuan/start)
1313
- [智谱](https://open.bigmodel.cn/dev/api/normal-model/glm-4)
14+
- [深度求索(DeepSeek)](https://api-docs.deepseek.com/zh-cn/)
1415
- [零一万物](https://platform.lingyiwanwu.com/docs/api-reference)
1516
- [无问芯穹](https://docs.infini-ai.com/gen-studio/api/maas.html#/operations/chatCompletions)
1617
- [硅基流动](https://docs.siliconflow.cn/cn/api-reference/chat-completions/chat-completions)
@@ -65,7 +66,7 @@ AI 助手,就是调用各个平台中的语言大模型 API,进行聊天、
6566
- 实际实现是先调用讯飞的语音转写 API,把语音转为了文字,再调用大模型的 API
6667
- 直接发送语音就直接是转化后的文字,有可能会识别错,可以在页面中查看转化后的文本,发送文本
6768
- 有保存原语音文件在设备本地应用缓存,所以点击可以听原语音
68-
- 可以查看最近的对话,点击指定对话历史记录,可以继续交流
69+
- 可以查看最近的对话(点击对话主页面右上角的历史记录图标),点击指定对话历史记录,可以继续交流
6970
- 历史记录是存在设备本地的 sqlite 数据库中的
7071
- 如果平台有 DeepSeek R 系列深度思考(默认的)功能,返回中有`reasoning_content`字段,会显示在对话框中当作思考内容。
7172

@@ -101,28 +102,40 @@ AI 绘图/视频结构和操作类似,所以放在一起说。
101102
- 如果想使用本应用支持的平台中更加强劲的模型,可自行去各个平台充值、获取密钥,再导入密钥和模型 json 文件
102103
- **密钥只缓存在本地,事实上,除了调用 API 和加载图片、视频,都没有联网操作**
103104
- 想用哪个平台、哪个模型,全都自己导入
104-
- 平台密钥和模型规格的**固定 json 结构**如下:
105+
- 平台密钥和模型规格的**固定 json 结构**见下方
106+
107+
---
108+
109+
**_注意,平台密钥和平台模型规格要同时导入,否则无法正常使用。_**
105110

106111
#### 平台密钥 json 结构
107112

113+
导入平台的密钥的 key 一定要和这个文件中 key 一样,不然匹配不上:
114+
108115
```json
109116
{
110-
"USER_LINGYIWANWU_AK": "xxx",
111-
"USER_ZHIPU_AK": "xxx",
112-
"USER_SILICON_CLOUD_AK": "sk-xxx",
113-
"USER_INFINI_GEN_STUDIO_AK": "sk-xxx",
114117
"USER_ALIYUN_API_KEY": "sk-xxx",
115118
"USER_BAIDU_API_KEY_V2": "xxx",
116119
"USER_TENCENT_API_KEY": "xxx",
117120

121+
"USER_DEEPSEEK_API_KEY": "sk-xxx",
122+
"USER_LINGYIWANWU_API_KEY": "xxx",
123+
"USER_ZHIPU_API_KEY": "xxx",
124+
125+
"USER_SILICON_CLOUD_API_KEY": "sk-xxx",
126+
"USER_INFINI_GEN_STUDIO_API_KEY": "sk-xxx",
127+
118128
// 讯飞, 语音转写需要
119129
"USER_XFYUN_APP_ID": "xxx",
120-
"USER_XFYUN_API_SECRET": "xxx",
121130
"USER_XFYUN_API_KEY": "xxx",
131+
"USER_XFYUN_API_SECRET": "xxx",
122132

123133
// 生活工具中 NUTRITIONIX 食品数据查询需要
124134
"USER_NUTRITIONIX_APP_ID": "xxx",
125-
"USER_NUTRITIONIX_APP_KEY": "xxx"
135+
"USER_NUTRITIONIX_APP_KEY": "xxx",
136+
137+
// newsapi新闻需要
138+
"USER_NEWS_API_KEY": "xxx"
126139
}
127140
```
128141

@@ -173,12 +186,15 @@ AI 绘图/视频结构和操作类似,所以放在一起说。
173186

174187
```ts
175188
enum ApiPlatform {
189+
aliyun, // 阿里云百炼
176190
baidu, // 百度千帆
177191
tencent, // 腾讯混元
178-
aliyun, // 阿里云百炼
179-
siliconCloud, // 硅基流动
192+
193+
deepseek, // 深度求索
180194
lingyiwanwu, // 零一万物
181195
zhipu, // 智谱 AI
196+
197+
siliconCloud, // 硅基流动
182198
infini, // 无问芯穹的 genStudio
183199
}
184200
```
@@ -200,6 +216,24 @@ enum LLModelType {
200216

201217
后续我会放一些整理好的各个平台我常用的大模型规格 json 文件在项目的 **[\_cus_model_jsons](./_cus_model_jsons)** 文件夹中,可以参考使用。
202218

219+
### TODO
220+
221+
2025-03-04 时想到的:
222+
223+
- [ ] AI 工具部分:
224+
- [ ] 高级请求参数配置(temperature、max_tokens 等比较常用但暂没支持用户配置)
225+
- [ ] 测试低成本让少量模型可联网搜索
226+
- [ ] 对话消息展示的 Markdown 格式结合 LaTeX
227+
- [ ] AI 助手可编辑某个输入对话的消息,并记录对话分支
228+
- [ ] 静默继续流式输出(助手模块切换到其他页面时输出继续而不是终止)
229+
- [ ] 添加角色卡功能,可少量预设,支持用户自行导入
230+
- [ ] 一键保存整个对话为 Markdown 文件?
231+
- [ ] 多 Agent 的群聊、角色扮演?
232+
- [ ] 免费云端数据库用于数据存储?
233+
- [ ] 是否简单使用 Nodejs 编写一个后端?
234+
- [ ] 生活工具部分:
235+
- [ ] 一个简单的文本记事本(ToDo)?
236+
203237
## 生活日常工具
204238

205239
![生活工具](./_doc/screenshots/brief_version/生活工具.jpg)
@@ -295,6 +329,12 @@ _这个其实是之前(2024-04-09)就单独开发好的 app 了,功能融合
295329

296330
因为智能助手的对话记录、极简记账的账单条目、随机菜品的菜品列表等,都是本地 sqlite 存储的,所以备份就是把 db 中的数据导出成 json 文件并压缩,恢复就是把压缩包的 json 存入数据库中。
297331

332+
**注意**
333+
334+
- 恢复会清空当前数据库中的数据,请谨慎操作。
335+
- 更新或卸载前,推荐先全量备份。
336+
- 0.4.0 之前的版本数据库表结构和现在不一样,所以不能恢复。
337+
298338
# 其他说明
299339

300340
## 开发环境
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
[
2+
{
3+
"platform": "infini",
4+
"model": "deepseek-r1",
5+
"modelType": "cc",
6+
"name": "deepseek-r1",
7+
"contextLength": 64000,
8+
"isFree": false,
9+
"inputPrice": 4,
10+
"outputPrice": 16,
11+
"gmtRelease": "2025-02-06"
12+
},
13+
{
14+
"platform": "infini",
15+
"model": "deepseek-v3",
16+
"modelType": "cc",
17+
"name": "deepseek-v3",
18+
"contextLength": 64000,
19+
"isFree": false,
20+
"inputPrice": 2,
21+
"outputPrice": 8,
22+
"gmtRelease": "2025-02-07"
23+
},
24+
{
25+
"platform": "lingyiwanwu",
26+
"model": "deepseek-r1-distill-qwen-32b",
27+
"modelType": "cc",
28+
"name": "deepseek-r1-distill-qwen-32b",
29+
"contextLength": 32000,
30+
"isFree": false,
31+
"inputPrice": 0,
32+
"outputPrice": 0,
33+
"gmtRelease": "2025-01-21"
34+
},
35+
{
36+
"platform": "infini",
37+
"model": "qwq-32b-preview",
38+
"modelType": "cc",
39+
"name": "qwq-32b-preview",
40+
"contextLength": 32,
41+
"isFree": false,
42+
"inputPrice": 0,
43+
"outputPrice": 0,
44+
"gmtRelease": "2024-12-02"
45+
},
46+
{
47+
"platform": "infini",
48+
"model": "qwen2.5-72b-instruct",
49+
"modelType": "cc",
50+
"name": "qwen2.5-72b-instruct",
51+
"contextLength": 32000,
52+
"isFree": false,
53+
"inputPrice": 0,
54+
"outputPrice": 0,
55+
"gmtRelease": "2024-09-19"
56+
},
57+
{
58+
"platform": "infini",
59+
"model": "qwen2.5-32b-instruct",
60+
"modelType": "cc",
61+
"name": "qwen2.5-32b-instruct",
62+
"contextLength": 32000,
63+
"isFree": false,
64+
"inputPrice": 0,
65+
"outputPrice": 0,
66+
"gmtRelease": "2024-09-20"
67+
},
68+
{
69+
"platform": "infini",
70+
"model": "qwen2.5-14b-instruct",
71+
"modelType": "cc",
72+
"name": "qwen2.5-14b-instruct",
73+
"contextLength": 32000,
74+
"isFree": false,
75+
"inputPrice": 0,
76+
"outputPrice": 0,
77+
"gmtRelease": "2024-09-20"
78+
},
79+
{
80+
"platform": "infini",
81+
"model": "qwen2-72b-instruct",
82+
"modelType": "cc",
83+
"name": "qwen2-72b-instruct",
84+
"contextLength": 32000,
85+
"isFree": false,
86+
"inputPrice": 0,
87+
"outputPrice": 0,
88+
"gmtRelease": "2024-06-12"
89+
}
90+
]

_cus_model_jsons/model_智谱.json

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
[
2+
{
3+
"platform": "zhipu",
4+
"model": "glm-4-plus",
5+
"modelType": "cc",
6+
"name": "GLM-4-Plus",
7+
"contextLength": 128000,
8+
"isFree": false,
9+
"inputPrice": 50,
10+
"outputPrice": 50,
11+
"gmtRelease": "1970-01-01"
12+
},
13+
{
14+
"platform": "zhipu",
15+
"model": "glm-4-air",
16+
"modelType": "cc",
17+
"name": "GLM-4-Air",
18+
"contextLength": 128000,
19+
"isFree": false,
20+
"inputPrice": 0.5,
21+
"outputPrice": 0.5,
22+
"gmtRelease": "1970-01-01"
23+
},
24+
{
25+
"platform": "zhipu",
26+
"model": "glm-4-long",
27+
"modelType": "cc",
28+
"name": "GLM-4-Long",
29+
"contextLength": 1000000,
30+
"isFree": false,
31+
"inputPrice": 1,
32+
"outputPrice": 1,
33+
"gmtRelease": "1970-01-01"
34+
},
35+
{
36+
"platform": "zhipu",
37+
"model": "glm-zero-preview",
38+
"modelType": "cc",
39+
"name": "GLM-Zero-Preview",
40+
"contextLength": 16000,
41+
"isFree": false,
42+
"inputPrice": 10,
43+
"outputPrice": 10,
44+
"gmtRelease": "1970-01-01"
45+
},
46+
{
47+
"platform": "zhipu",
48+
"model": "glm-4-airx",
49+
"modelType": "cc",
50+
"name": "GLM-4-AirX",
51+
"contextLength": 8000,
52+
"isFree": false,
53+
"inputPrice": 10,
54+
"outputPrice": 10,
55+
"gmtRelease": "1970-01-01"
56+
},
57+
{
58+
"platform": "zhipu",
59+
"model": "glm-4-flashx",
60+
"modelType": "cc",
61+
"name": "GLM-4-FlashX",
62+
"contextLength": 128000,
63+
"isFree": false,
64+
"inputPrice": 0.1,
65+
"outputPrice": 0.1,
66+
"gmtRelease": "1970-01-01"
67+
},
68+
{
69+
"platform": "zhipu",
70+
"model": "glm-4v-plus-0111",
71+
"modelType": "vision",
72+
"name": "GLM-4V-Plus-0111",
73+
"contextLength": 8000,
74+
"isFree": false,
75+
"inputPrice": 4,
76+
"outputPrice": 4,
77+
"gmtRelease": "1970-01-01"
78+
},
79+
{
80+
"platform": "zhipu",
81+
"model": "cogview-4",
82+
"modelType": "image",
83+
"name": "CogView-4",
84+
"isFree": false,
85+
"costPer": 0.06,
86+
"gmtRelease": "1970-01-01"
87+
},
88+
{
89+
"platform": "zhipu",
90+
"model": "cogvideox-2",
91+
"modelType": "video",
92+
"name": "CogVideoX-2",
93+
"isFree": false,
94+
"costPer": 0.5,
95+
"gmtRelease": "1970-01-01"
96+
},
97+
98+
{
99+
"platform": "zhipu",
100+
"model": "glm-4-flash",
101+
"modelType": "cc",
102+
"name": "CGLM-4-Flash",
103+
"isFree": true,
104+
"inputPrice": 0.0,
105+
"outputPrice": 0.0,
106+
"gmtRelease": "1970-01-01"
107+
},
108+
{
109+
"platform": "zhipu",
110+
"model": "glm-4v-flash",
111+
"modelType": "vision",
112+
"name": "GLM-4V-Flash",
113+
"isFree": true,
114+
"inputPrice": 0.0,
115+
"outputPrice": 0.0,
116+
"gmtRelease": "1970-01-01"
117+
},
118+
{
119+
"platform": "zhipu",
120+
"model": "cogview-3-flash",
121+
"modelType": "image",
122+
"name": "CogView-3-Flash",
123+
"isFree": true,
124+
"costPer": 0.0,
125+
"gmtRelease": "1970-01-01"
126+
},
127+
{
128+
"platform": "zhipu",
129+
"model": "ccogvideox-flash",
130+
"modelType": "video",
131+
"name": "CogVideoX-Flash",
132+
"isFree": true,
133+
"costPer": 0.0,
134+
"gmtRelease": "1970-01-01"
135+
}
136+
]

0 commit comments

Comments
 (0)