xiaogpt 2.50__tar.gz → 2.61__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.
- {xiaogpt-2.50 → xiaogpt-2.61}/PKG-INFO +55 -63
- {xiaogpt-2.50 → xiaogpt-2.61}/README.md +44 -44
- {xiaogpt-2.50 → xiaogpt-2.61}/pyproject.toml +11 -19
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/bot/__init__.py +6 -3
- xiaogpt-2.61/xiaogpt/bot/doubao_bot.py +76 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/bot/gemini_bot.py +24 -6
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/cli.py +17 -22
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/config.py +14 -25
- xiaogpt-2.61/xiaogpt/tts/__init__.py +5 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/tts/base.py +4 -4
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/tts/mi.py +1 -1
- xiaogpt-2.61/xiaogpt/tts/tetos.py +56 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/xiaogpt.py +31 -19
- xiaogpt-2.50/xiaogpt/tts/__init__.py +0 -7
- xiaogpt-2.50/xiaogpt/tts/azure.py +0 -98
- xiaogpt-2.50/xiaogpt/tts/edge.py +0 -32
- xiaogpt-2.50/xiaogpt/tts/openai.py +0 -46
- xiaogpt-2.50/xiaogpt/tts/volc.py +0 -130
- {xiaogpt-2.50 → xiaogpt-2.61}/LICENSE +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/__init__.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/__main__.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/bot/base_bot.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/bot/chatgptapi_bot.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/bot/glm_bot.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/bot/langchain_bot.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/bot/newbing_bot.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/bot/qwen_bot.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/langchain/callbacks.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/langchain/chain.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/langchain/examples/email/mail_box.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/langchain/examples/email/mail_summary_tools.py +0 -0
- {xiaogpt-2.50 → xiaogpt-2.61}/xiaogpt/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: xiaogpt
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.61
|
4
4
|
Summary: Play ChatGPT or other LLM with xiaomi AI speaker
|
5
5
|
Author-Email: yihong0618 <zouzou0208@gmail.com>
|
6
6
|
License: MIT
|
@@ -15,7 +15,6 @@ Requires-Dist: aiohttp
|
|
15
15
|
Requires-Dist: rich
|
16
16
|
Requires-Dist: zhipuai>=2.0.1
|
17
17
|
Requires-Dist: httpx[socks]
|
18
|
-
Requires-Dist: edge-tts>=6.1.3
|
19
18
|
Requires-Dist: EdgeGPT==0.1.26
|
20
19
|
Requires-Dist: langchain>=0.0.343
|
21
20
|
Requires-Dist: beautifulsoup4>=4.12.0
|
@@ -23,13 +22,11 @@ Requires-Dist: google-search-results>=2.4.2
|
|
23
22
|
Requires-Dist: google-generativeai
|
24
23
|
Requires-Dist: numexpr>=2.8.6
|
25
24
|
Requires-Dist: dashscope>=1.10.0
|
26
|
-
Requires-Dist:
|
27
|
-
Requires-Dist:
|
28
|
-
Requires-Dist: volcengine>=1.0.136
|
29
|
-
Requires-Dist: aiohttp==3.9.4; extra == "locked"
|
25
|
+
Requires-Dist: tetos>=0.1.1
|
26
|
+
Requires-Dist: aiohttp==3.9.5; extra == "locked"
|
30
27
|
Requires-Dist: aiosignal==1.3.1; extra == "locked"
|
31
28
|
Requires-Dist: annotated-types==0.6.0; extra == "locked"
|
32
|
-
Requires-Dist: anyio==3.
|
29
|
+
Requires-Dist: anyio==4.3.0; extra == "locked"
|
33
30
|
Requires-Dist: async-timeout==4.0.3; python_version < "3.11" and extra == "locked"
|
34
31
|
Requires-Dist: attrs==23.2.0; extra == "locked"
|
35
32
|
Requires-Dist: azure-cognitiveservices-speech==1.37.0; extra == "locked"
|
@@ -38,23 +35,23 @@ Requires-Dist: bingimagecreator==0.5.0; extra == "locked"
|
|
38
35
|
Requires-Dist: cachetools==5.3.2; extra == "locked"
|
39
36
|
Requires-Dist: certifi==2024.2.2; extra == "locked"
|
40
37
|
Requires-Dist: charset-normalizer==3.3.2; extra == "locked"
|
38
|
+
Requires-Dist: click==8.1.7; extra == "locked"
|
41
39
|
Requires-Dist: colorama==0.4.6; platform_system == "Windows" and extra == "locked"
|
42
|
-
Requires-Dist: dashscope==1.
|
40
|
+
Requires-Dist: dashscope==1.17.0; extra == "locked"
|
43
41
|
Requires-Dist: dataclasses-json==0.6.3; extra == "locked"
|
44
|
-
Requires-Dist: decorator==5.1.1; extra == "locked"
|
45
42
|
Requires-Dist: distro==1.9.0; extra == "locked"
|
46
43
|
Requires-Dist: edge-tts==6.1.10; extra == "locked"
|
47
44
|
Requires-Dist: edgegpt==0.1.26; extra == "locked"
|
48
45
|
Requires-Dist: exceptiongroup==1.2.0; python_version < "3.11" and extra == "locked"
|
49
46
|
Requires-Dist: frozenlist==1.4.1; extra == "locked"
|
50
|
-
Requires-Dist: google==
|
51
|
-
Requires-Dist: google-ai-generativelanguage==0.6.1; extra == "locked"
|
47
|
+
Requires-Dist: google-ai-generativelanguage==0.6.2; extra == "locked"
|
52
48
|
Requires-Dist: google-api-core==2.15.0; extra == "locked"
|
53
49
|
Requires-Dist: google-api-core[grpc]==2.15.0; extra == "locked"
|
54
50
|
Requires-Dist: google-api-python-client==2.125.0; extra == "locked"
|
55
51
|
Requires-Dist: google-auth==2.26.1; extra == "locked"
|
56
52
|
Requires-Dist: google-auth-httplib2==0.2.0; extra == "locked"
|
57
|
-
Requires-Dist: google-
|
53
|
+
Requires-Dist: google-cloud-texttospeech==2.16.3; extra == "locked"
|
54
|
+
Requires-Dist: google-generativeai==0.5.1; extra == "locked"
|
58
55
|
Requires-Dist: google-search-results==2.4.2; extra == "locked"
|
59
56
|
Requires-Dist: googleapis-common-protos==1.62.0; extra == "locked"
|
60
57
|
Requires-Dist: greenlet==3.0.3; (platform_machine == "win32" or platform_machine == "WIN32" or platform_machine == "AMD64" or platform_machine == "amd64" or platform_machine == "x86_64" or platform_machine == "ppc64le" or platform_machine == "aarch64") and extra == "locked"
|
@@ -82,40 +79,35 @@ Requires-Dist: mutagen==1.47.0; extra == "locked"
|
|
82
79
|
Requires-Dist: mypy-extensions==1.0.0; extra == "locked"
|
83
80
|
Requires-Dist: numexpr==2.10.0; extra == "locked"
|
84
81
|
Requires-Dist: numpy==1.26.3; extra == "locked"
|
85
|
-
Requires-Dist: openai==1.
|
82
|
+
Requires-Dist: openai==1.21.2; extra == "locked"
|
86
83
|
Requires-Dist: orjson==3.10.0; extra == "locked"
|
87
84
|
Requires-Dist: packaging==23.2; extra == "locked"
|
88
85
|
Requires-Dist: prompt-toolkit==3.0.43; extra == "locked"
|
89
86
|
Requires-Dist: proto-plus==1.23.0; extra == "locked"
|
90
87
|
Requires-Dist: protobuf==4.25.1; extra == "locked"
|
91
|
-
Requires-Dist: py==1.11.0; extra == "locked"
|
92
88
|
Requires-Dist: pyasn1==0.5.1; extra == "locked"
|
93
89
|
Requires-Dist: pyasn1-modules==0.3.0; extra == "locked"
|
94
|
-
Requires-Dist: pycryptodome==3.9.9; extra == "locked"
|
95
90
|
Requires-Dist: pydantic==2.5.3; extra == "locked"
|
96
91
|
Requires-Dist: pydantic-core==2.14.6; extra == "locked"
|
97
92
|
Requires-Dist: pygments==2.17.2; extra == "locked"
|
98
93
|
Requires-Dist: pyjwt==2.8.0; extra == "locked"
|
99
94
|
Requires-Dist: pyparsing==3.1.2; python_version > "3.0" and extra == "locked"
|
100
|
-
Requires-Dist: pytz==2020.5; extra == "locked"
|
101
95
|
Requires-Dist: pyyaml==6.0.1; extra == "locked"
|
102
96
|
Requires-Dist: regex==2023.12.25; extra == "locked"
|
103
97
|
Requires-Dist: requests==2.31.0; extra == "locked"
|
104
|
-
Requires-Dist: retry==0.9.2; extra == "locked"
|
105
98
|
Requires-Dist: rich==13.7.1; extra == "locked"
|
106
99
|
Requires-Dist: rsa==4.9; extra == "locked"
|
107
|
-
Requires-Dist: six==1.16.0; extra == "locked"
|
108
100
|
Requires-Dist: sniffio==1.3.0; extra == "locked"
|
109
101
|
Requires-Dist: socksio==1.0.0; extra == "locked"
|
110
102
|
Requires-Dist: soupsieve==2.5; extra == "locked"
|
111
103
|
Requires-Dist: sqlalchemy==2.0.25; extra == "locked"
|
112
104
|
Requires-Dist: tenacity==8.2.3; extra == "locked"
|
105
|
+
Requires-Dist: tetos==0.1.1; extra == "locked"
|
113
106
|
Requires-Dist: tqdm==4.66.1; extra == "locked"
|
114
107
|
Requires-Dist: typing-extensions==4.9.0; extra == "locked"
|
115
108
|
Requires-Dist: typing-inspect==0.9.0; extra == "locked"
|
116
109
|
Requires-Dist: uritemplate==4.1.1; extra == "locked"
|
117
110
|
Requires-Dist: urllib3==2.1.0; extra == "locked"
|
118
|
-
Requires-Dist: volcengine==1.0.136; extra == "locked"
|
119
111
|
Requires-Dist: wcwidth==0.2.13; extra == "locked"
|
120
112
|
Requires-Dist: websockets==12.0; extra == "locked"
|
121
113
|
Requires-Dist: yarl==1.9.4; extra == "locked"
|
@@ -144,12 +136,12 @@ Play ChatGPT and other LLM with Xiaomi AI Speaker
|
|
144
136
|
- [通义千问](https://help.aliyun.com/zh/dashscope/developer-reference/api-details)
|
145
137
|
|
146
138
|
## 获取小米音响DID
|
147
|
-
系统和Shell|Linux *sh|Windows CMD
|
148
|
-
|
149
|
-
1
|
150
|
-
2
|
151
|
-
3、取得MI_DID
|
152
|
-
4、设置MI_DID
|
139
|
+
| 系统和Shell | Linux *sh | Windows CMD用户 | Windows PowerShell用户 |
|
140
|
+
| ------------- | ---------------------------------------------- | -------------------------------------- | ---------------------------------------------- |
|
141
|
+
| 1、安装包 | `pip install miservice_fork` | `pip install miservice_fork` | `pip install miservice_fork` |
|
142
|
+
| 2、设置变量 | `export MI_USER=xxx` <br> `export MI_PASS=xxx` | `set MI_USER=xxx`<br>`set MI_PASS=xxx` | `$env:MI_USER="xxx"` <br> `$env:MI_PASS="xxx"` |
|
143
|
+
| 3、取得MI_DID | `micli list` | `micli list` | `micli list` |
|
144
|
+
| 4、设置MI_DID | `export MI_DID=xxx` | `set MI_DID=xxx` | `$env:MI_DID="xxx"` |
|
153
145
|
|
154
146
|
- 注意不同shell 对环境变量的处理是不同的,尤其是powershell赋值时,可能需要双引号来包括值。
|
155
147
|
- 如果获取did报错时,请更换一下无线网络,有很大概率解决问题。
|
@@ -199,6 +191,8 @@ xiaogpt --hardware LX06 --mute_xiaoai --use_chatgpt_api
|
|
199
191
|
xiaogpt --hardware LX06 --mute_xiaoai --stream
|
200
192
|
# 如果你想使用 google 的 gemini
|
201
193
|
xiaogpt --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${gemini_key}
|
194
|
+
# 如果你想使用自己的 google gemini 服务
|
195
|
+
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${gemini_key} --gemini_api_domain ${gemini_api_domain}
|
202
196
|
# 如果你想使用阿里的通义千问
|
203
197
|
xiaogpt --hardware LX06 --mute_xiaoai --use_qwen --qen_key ${qwen_key}
|
204
198
|
# 如果你想用 edge-tts
|
@@ -226,6 +220,8 @@ python3 xiaogpt.py --hardware LX06 --mute_xiaoai --stream
|
|
226
220
|
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_glm --glm_key ${glm_key}
|
227
221
|
# 如果你想使用 google 的 gemini
|
228
222
|
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${gemini_key}
|
223
|
+
# 如果你想使用自己的 google gemini 服务
|
224
|
+
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${gemini_key} --gemini_api_domain ${gemini_api_domain}
|
229
225
|
# 如果你想使用阿里的通义千问
|
230
226
|
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_qwen --qen_key ${qwen_key}
|
231
227
|
# 如果你想使用 LangChain+SerpApi 实现上网检索或其他本地服务(目前仅支持 stream 模式)
|
@@ -271,44 +267,39 @@ ChatGLM [文档](http://open.bigmodel.cn/doc/api#chatglm_130b)
|
|
271
267
|
|
272
268
|
## 配置项说明
|
273
269
|
|
274
|
-
| 参数
|
275
|
-
|
|
276
|
-
| hardware
|
277
|
-
| account
|
278
|
-
| password
|
279
|
-
| openai_key
|
280
|
-
| serpapi_api_key
|
281
|
-
| glm_key
|
282
|
-
| gemini_key
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
| volc_secretkey | 火山引擎secretkey [参考](https://console.volcengine.com/iam/keymanage/) | | |
|
308
|
-
| volc_tts_app | 火山引擎 TTS app 服务 [参考]( https://console.volcengine.com/sami/) | | |
|
309
|
-
| volc_tts_speaker | 火山引擎 TTS speaker [参考]( https://www.volcengine.com/docs/6489/93478) | `zh_female_qingxin` | |
|
310
|
-
|
311
|
-
|
270
|
+
| 参数 | 说明 | 默认值 | 可选值 |
|
271
|
+
| --------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
272
|
+
| hardware | 设备型号 | | |
|
273
|
+
| account | 小爱账户 | | |
|
274
|
+
| password | 小爱账户密码 | | |
|
275
|
+
| openai_key | openai的apikey | | |
|
276
|
+
| serpapi_api_key | serpapi的key 参考 [SerpAPI](https://serpapi.com/) | | |
|
277
|
+
| glm_key | chatglm 的 apikey | | |
|
278
|
+
| gemini_key | gemini 的 apikey [参考](https://makersuite.google.com/app/apikey) | | |
|
279
|
+
| gemini_api_domain | gemini 的自定义域名 [参考](https://github.com/antergone/palm-netlify-proxy) | |
|
280
|
+
| qwen_key | qwen 的 apikey [参考](https://help.aliyun.com/zh/dashscope/developer-reference/api-details) | | |
|
281
|
+
| cookie | 小爱账户cookie (如果用上面密码登录可以不填) | | |
|
282
|
+
| mi_did | 设备did | | |
|
283
|
+
| use_command | 使用 MI command 与小爱交互 | `false` | |
|
284
|
+
| mute_xiaoai | 快速停掉小爱自己的回答 | `true` | |
|
285
|
+
| verbose | 是否打印详细日志 | `false` | |
|
286
|
+
| bot | 使用的 bot 类型,目前支持 chatgptapi,newbing, qwen, gemini | `chatgptapi` | |
|
287
|
+
| tts | 使用的 TTS 类型 | `mi` | `edge`、 `openai`、`azure`、`volc`、`baidu`、`google` |
|
288
|
+
| tts_options | TTS 参数字典,参考 [tetos](https://github.com/frostming/tetos) 获取可用参数 | | |
|
289
|
+
| prompt | 自定义prompt | `请用100字以内回答` | |
|
290
|
+
| keyword | 自定义请求词列表 | `["请"]` | |
|
291
|
+
| change_prompt_keyword | 更改提示词触发列表 | `["更改提示词"]` | |
|
292
|
+
| start_conversation | 开始持续对话关键词 | `开始持续对话` | |
|
293
|
+
| end_conversation | 结束持续对话关键词 | `结束持续对话` | |
|
294
|
+
| stream | 使用流式响应,获得更快的响应 | `false` | |
|
295
|
+
| proxy | 支持 HTTP 代理,传入 http proxy URL | "" | |
|
296
|
+
| gpt_options | OpenAI API 的参数字典 | `{}` | |
|
297
|
+
| bing_cookie_path | NewBing使用的cookie路径,参考[这里]获取 | 也可通过环境变量 `COOKIE_FILE` 设置 | |
|
298
|
+
| bing_cookies | NewBing使用的cookie字典,参考[这里]获取 | | |
|
299
|
+
| deployment_id | Azure OpenAI 服务的 deployment ID | 参考这个[如何找到deployment_id](https://github.com/yihong0618/xiaogpt/issues/347#issuecomment-1784410784) | |
|
300
|
+
| api_base | 如果需要替换默认的api,或者使用Azure OpenAI 服务 | 例如:`https://abc-def.openai.azure.com/` |
|
301
|
+
| volc_access_key | 火山引擎的 access key 请在[这里](https://console.volcengine.com/iam/keymanage/)获取 | | |
|
302
|
+
| volc_secret_key | 火山引擎的 secret key 请在[这里](https://console.volcengine.com/iam/keymanage/)获取 | | |
|
312
303
|
[这里]: https://github.com/acheong08/EdgeGPT#getting-authentication-required
|
313
304
|
|
314
305
|
## 注意
|
@@ -425,6 +416,7 @@ docker run -v <your-config-dir>:/config -p 9527:9527 -e XIAOGPT_HOSTNAME=<your i
|
|
425
416
|
|
426
417
|
- [xiaomi](https://www.mi.com/)
|
427
418
|
- [PDM](https://pdm.fming.dev/latest/)
|
419
|
+
- [Tetos](https://github.com/frostming/tetos) TTS 云服务支持
|
428
420
|
- @[Yonsm](https://github.com/Yonsm) 的 [MiService](https://github.com/Yonsm/MiService)
|
429
421
|
- @[pjq](https://github.com/pjq) 给了这个项目非常多的帮助
|
430
422
|
- @[frostming](https://github.com/frostming) 重构了一些代码,支持了`持续会话功能`
|
@@ -19,12 +19,12 @@ Play ChatGPT and other LLM with Xiaomi AI Speaker
|
|
19
19
|
- [通义千问](https://help.aliyun.com/zh/dashscope/developer-reference/api-details)
|
20
20
|
|
21
21
|
## 获取小米音响DID
|
22
|
-
系统和Shell|Linux *sh|Windows CMD
|
23
|
-
|
24
|
-
1
|
25
|
-
2
|
26
|
-
3、取得MI_DID
|
27
|
-
4、设置MI_DID
|
22
|
+
| 系统和Shell | Linux *sh | Windows CMD用户 | Windows PowerShell用户 |
|
23
|
+
| ------------- | ---------------------------------------------- | -------------------------------------- | ---------------------------------------------- |
|
24
|
+
| 1、安装包 | `pip install miservice_fork` | `pip install miservice_fork` | `pip install miservice_fork` |
|
25
|
+
| 2、设置变量 | `export MI_USER=xxx` <br> `export MI_PASS=xxx` | `set MI_USER=xxx`<br>`set MI_PASS=xxx` | `$env:MI_USER="xxx"` <br> `$env:MI_PASS="xxx"` |
|
26
|
+
| 3、取得MI_DID | `micli list` | `micli list` | `micli list` |
|
27
|
+
| 4、设置MI_DID | `export MI_DID=xxx` | `set MI_DID=xxx` | `$env:MI_DID="xxx"` |
|
28
28
|
|
29
29
|
- 注意不同shell 对环境变量的处理是不同的,尤其是powershell赋值时,可能需要双引号来包括值。
|
30
30
|
- 如果获取did报错时,请更换一下无线网络,有很大概率解决问题。
|
@@ -74,6 +74,8 @@ xiaogpt --hardware LX06 --mute_xiaoai --use_chatgpt_api
|
|
74
74
|
xiaogpt --hardware LX06 --mute_xiaoai --stream
|
75
75
|
# 如果你想使用 google 的 gemini
|
76
76
|
xiaogpt --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${gemini_key}
|
77
|
+
# 如果你想使用自己的 google gemini 服务
|
78
|
+
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${gemini_key} --gemini_api_domain ${gemini_api_domain}
|
77
79
|
# 如果你想使用阿里的通义千问
|
78
80
|
xiaogpt --hardware LX06 --mute_xiaoai --use_qwen --qen_key ${qwen_key}
|
79
81
|
# 如果你想用 edge-tts
|
@@ -101,6 +103,8 @@ python3 xiaogpt.py --hardware LX06 --mute_xiaoai --stream
|
|
101
103
|
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_glm --glm_key ${glm_key}
|
102
104
|
# 如果你想使用 google 的 gemini
|
103
105
|
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${gemini_key}
|
106
|
+
# 如果你想使用自己的 google gemini 服务
|
107
|
+
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${gemini_key} --gemini_api_domain ${gemini_api_domain}
|
104
108
|
# 如果你想使用阿里的通义千问
|
105
109
|
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_qwen --qen_key ${qwen_key}
|
106
110
|
# 如果你想使用 LangChain+SerpApi 实现上网检索或其他本地服务(目前仅支持 stream 模式)
|
@@ -146,44 +150,39 @@ ChatGLM [文档](http://open.bigmodel.cn/doc/api#chatglm_130b)
|
|
146
150
|
|
147
151
|
## 配置项说明
|
148
152
|
|
149
|
-
| 参数
|
150
|
-
|
|
151
|
-
| hardware
|
152
|
-
| account
|
153
|
-
| password
|
154
|
-
| openai_key
|
155
|
-
| serpapi_api_key
|
156
|
-
| glm_key
|
157
|
-
| gemini_key
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
| volc_secretkey | 火山引擎secretkey [参考](https://console.volcengine.com/iam/keymanage/) | | |
|
183
|
-
| volc_tts_app | 火山引擎 TTS app 服务 [参考]( https://console.volcengine.com/sami/) | | |
|
184
|
-
| volc_tts_speaker | 火山引擎 TTS speaker [参考]( https://www.volcengine.com/docs/6489/93478) | `zh_female_qingxin` | |
|
185
|
-
|
186
|
-
|
153
|
+
| 参数 | 说明 | 默认值 | 可选值 |
|
154
|
+
| --------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
155
|
+
| hardware | 设备型号 | | |
|
156
|
+
| account | 小爱账户 | | |
|
157
|
+
| password | 小爱账户密码 | | |
|
158
|
+
| openai_key | openai的apikey | | |
|
159
|
+
| serpapi_api_key | serpapi的key 参考 [SerpAPI](https://serpapi.com/) | | |
|
160
|
+
| glm_key | chatglm 的 apikey | | |
|
161
|
+
| gemini_key | gemini 的 apikey [参考](https://makersuite.google.com/app/apikey) | | |
|
162
|
+
| gemini_api_domain | gemini 的自定义域名 [参考](https://github.com/antergone/palm-netlify-proxy) | |
|
163
|
+
| qwen_key | qwen 的 apikey [参考](https://help.aliyun.com/zh/dashscope/developer-reference/api-details) | | |
|
164
|
+
| cookie | 小爱账户cookie (如果用上面密码登录可以不填) | | |
|
165
|
+
| mi_did | 设备did | | |
|
166
|
+
| use_command | 使用 MI command 与小爱交互 | `false` | |
|
167
|
+
| mute_xiaoai | 快速停掉小爱自己的回答 | `true` | |
|
168
|
+
| verbose | 是否打印详细日志 | `false` | |
|
169
|
+
| bot | 使用的 bot 类型,目前支持 chatgptapi,newbing, qwen, gemini | `chatgptapi` | |
|
170
|
+
| tts | 使用的 TTS 类型 | `mi` | `edge`、 `openai`、`azure`、`volc`、`baidu`、`google` |
|
171
|
+
| tts_options | TTS 参数字典,参考 [tetos](https://github.com/frostming/tetos) 获取可用参数 | | |
|
172
|
+
| prompt | 自定义prompt | `请用100字以内回答` | |
|
173
|
+
| keyword | 自定义请求词列表 | `["请"]` | |
|
174
|
+
| change_prompt_keyword | 更改提示词触发列表 | `["更改提示词"]` | |
|
175
|
+
| start_conversation | 开始持续对话关键词 | `开始持续对话` | |
|
176
|
+
| end_conversation | 结束持续对话关键词 | `结束持续对话` | |
|
177
|
+
| stream | 使用流式响应,获得更快的响应 | `false` | |
|
178
|
+
| proxy | 支持 HTTP 代理,传入 http proxy URL | "" | |
|
179
|
+
| gpt_options | OpenAI API 的参数字典 | `{}` | |
|
180
|
+
| bing_cookie_path | NewBing使用的cookie路径,参考[这里]获取 | 也可通过环境变量 `COOKIE_FILE` 设置 | |
|
181
|
+
| bing_cookies | NewBing使用的cookie字典,参考[这里]获取 | | |
|
182
|
+
| deployment_id | Azure OpenAI 服务的 deployment ID | 参考这个[如何找到deployment_id](https://github.com/yihong0618/xiaogpt/issues/347#issuecomment-1784410784) | |
|
183
|
+
| api_base | 如果需要替换默认的api,或者使用Azure OpenAI 服务 | 例如:`https://abc-def.openai.azure.com/` |
|
184
|
+
| volc_access_key | 火山引擎的 access key 请在[这里](https://console.volcengine.com/iam/keymanage/)获取 | | |
|
185
|
+
| volc_secret_key | 火山引擎的 secret key 请在[这里](https://console.volcengine.com/iam/keymanage/)获取 | | |
|
187
186
|
[这里]: https://github.com/acheong08/EdgeGPT#getting-authentication-required
|
188
187
|
|
189
188
|
## 注意
|
@@ -300,6 +299,7 @@ docker run -v <your-config-dir>:/config -p 9527:9527 -e XIAOGPT_HOSTNAME=<your i
|
|
300
299
|
|
301
300
|
- [xiaomi](https://www.mi.com/)
|
302
301
|
- [PDM](https://pdm.fming.dev/latest/)
|
302
|
+
- [Tetos](https://github.com/frostming/tetos) TTS 云服务支持
|
303
303
|
- @[Yonsm](https://github.com/Yonsm) 的 [MiService](https://github.com/Yonsm/MiService)
|
304
304
|
- @[pjq](https://github.com/pjq) 给了这个项目非常多的帮助
|
305
305
|
- @[frostming](https://github.com/frostming) 重构了一些代码,支持了`持续会话功能`
|
@@ -18,7 +18,6 @@ dependencies = [
|
|
18
18
|
"rich",
|
19
19
|
"zhipuai>=2.0.1",
|
20
20
|
"httpx[socks]",
|
21
|
-
"edge-tts>=6.1.3",
|
22
21
|
"EdgeGPT==0.1.26",
|
23
22
|
"langchain>=0.0.343",
|
24
23
|
"beautifulsoup4>=4.12.0",
|
@@ -26,12 +25,10 @@ dependencies = [
|
|
26
25
|
"google-generativeai",
|
27
26
|
"numexpr>=2.8.6",
|
28
27
|
"dashscope>=1.10.0",
|
29
|
-
"
|
30
|
-
"multidict>=6.0.5",
|
31
|
-
"volcengine>=1.0.136",
|
28
|
+
"tetos>=0.1.1",
|
32
29
|
]
|
33
30
|
dynamic = []
|
34
|
-
version = "2.
|
31
|
+
version = "2.61"
|
35
32
|
|
36
33
|
[project.license]
|
37
34
|
text = "MIT"
|
@@ -44,10 +41,10 @@ xiaogpt = "xiaogpt.cli:main"
|
|
44
41
|
|
45
42
|
[project.optional-dependencies]
|
46
43
|
locked = [
|
47
|
-
"aiohttp==3.9.
|
44
|
+
"aiohttp==3.9.5",
|
48
45
|
"aiosignal==1.3.1",
|
49
46
|
"annotated-types==0.6.0",
|
50
|
-
"anyio==3.
|
47
|
+
"anyio==4.3.0",
|
51
48
|
"async-timeout==4.0.3 ; python_version < \"3.11\"",
|
52
49
|
"attrs==23.2.0",
|
53
50
|
"azure-cognitiveservices-speech==1.37.0",
|
@@ -56,23 +53,23 @@ locked = [
|
|
56
53
|
"cachetools==5.3.2",
|
57
54
|
"certifi==2024.2.2",
|
58
55
|
"charset-normalizer==3.3.2",
|
56
|
+
"click==8.1.7",
|
59
57
|
"colorama==0.4.6 ; platform_system == \"Windows\"",
|
60
|
-
"dashscope==1.
|
58
|
+
"dashscope==1.17.0",
|
61
59
|
"dataclasses-json==0.6.3",
|
62
|
-
"decorator==5.1.1",
|
63
60
|
"distro==1.9.0",
|
64
61
|
"edge-tts==6.1.10",
|
65
62
|
"edgegpt==0.1.26",
|
66
63
|
"exceptiongroup==1.2.0 ; python_version < \"3.11\"",
|
67
64
|
"frozenlist==1.4.1",
|
68
|
-
"google==
|
69
|
-
"google-ai-generativelanguage==0.6.1",
|
65
|
+
"google-ai-generativelanguage==0.6.2",
|
70
66
|
"google-api-core==2.15.0",
|
71
67
|
"google-api-core[grpc]==2.15.0",
|
72
68
|
"google-api-python-client==2.125.0",
|
73
69
|
"google-auth==2.26.1",
|
74
70
|
"google-auth-httplib2==0.2.0",
|
75
|
-
"google-
|
71
|
+
"google-cloud-texttospeech==2.16.3",
|
72
|
+
"google-generativeai==0.5.1",
|
76
73
|
"google-search-results==2.4.2",
|
77
74
|
"googleapis-common-protos==1.62.0",
|
78
75
|
"greenlet==3.0.3 ; platform_machine == \"win32\" or platform_machine == \"WIN32\" or platform_machine == \"AMD64\" or platform_machine == \"amd64\" or platform_machine == \"x86_64\" or platform_machine == \"ppc64le\" or platform_machine == \"aarch64\"",
|
@@ -100,40 +97,35 @@ locked = [
|
|
100
97
|
"mypy-extensions==1.0.0",
|
101
98
|
"numexpr==2.10.0",
|
102
99
|
"numpy==1.26.3",
|
103
|
-
"openai==1.
|
100
|
+
"openai==1.21.2",
|
104
101
|
"orjson==3.10.0",
|
105
102
|
"packaging==23.2",
|
106
103
|
"prompt-toolkit==3.0.43",
|
107
104
|
"proto-plus==1.23.0",
|
108
105
|
"protobuf==4.25.1",
|
109
|
-
"py==1.11.0",
|
110
106
|
"pyasn1==0.5.1",
|
111
107
|
"pyasn1-modules==0.3.0",
|
112
|
-
"pycryptodome==3.9.9",
|
113
108
|
"pydantic==2.5.3",
|
114
109
|
"pydantic-core==2.14.6",
|
115
110
|
"pygments==2.17.2",
|
116
111
|
"pyjwt==2.8.0",
|
117
112
|
"pyparsing==3.1.2 ; python_version > \"3.0\"",
|
118
|
-
"pytz==2020.5",
|
119
113
|
"pyyaml==6.0.1",
|
120
114
|
"regex==2023.12.25",
|
121
115
|
"requests==2.31.0",
|
122
|
-
"retry==0.9.2",
|
123
116
|
"rich==13.7.1",
|
124
117
|
"rsa==4.9",
|
125
|
-
"six==1.16.0",
|
126
118
|
"sniffio==1.3.0",
|
127
119
|
"socksio==1.0.0",
|
128
120
|
"soupsieve==2.5",
|
129
121
|
"sqlalchemy==2.0.25",
|
130
122
|
"tenacity==8.2.3",
|
123
|
+
"tetos==0.1.1",
|
131
124
|
"tqdm==4.66.1",
|
132
125
|
"typing-extensions==4.9.0",
|
133
126
|
"typing-inspect==0.9.0",
|
134
127
|
"uritemplate==4.1.1",
|
135
128
|
"urllib3==2.1.0",
|
136
|
-
"volcengine==1.0.136",
|
137
129
|
"wcwidth==0.2.13",
|
138
130
|
"websockets==12.0",
|
139
131
|
"yarl==1.9.4",
|
@@ -2,11 +2,12 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
from xiaogpt.bot.base_bot import BaseBot
|
4
4
|
from xiaogpt.bot.chatgptapi_bot import ChatGPTBot
|
5
|
-
from xiaogpt.bot.
|
6
|
-
from xiaogpt.bot.glm_bot import GLMBot
|
5
|
+
from xiaogpt.bot.doubao_bot import DoubaoBot
|
7
6
|
from xiaogpt.bot.gemini_bot import GeminiBot
|
8
|
-
from xiaogpt.bot.
|
7
|
+
from xiaogpt.bot.glm_bot import GLMBot
|
9
8
|
from xiaogpt.bot.langchain_bot import LangChainBot
|
9
|
+
from xiaogpt.bot.newbing_bot import NewBingBot
|
10
|
+
from xiaogpt.bot.qwen_bot import QwenBot
|
10
11
|
from xiaogpt.config import Config
|
11
12
|
|
12
13
|
BOTS: dict[str, type[BaseBot]] = {
|
@@ -16,6 +17,7 @@ BOTS: dict[str, type[BaseBot]] = {
|
|
16
17
|
"gemini": GeminiBot,
|
17
18
|
"qwen": QwenBot,
|
18
19
|
"langchain": LangChainBot,
|
20
|
+
"doubao": DoubaoBot,
|
19
21
|
}
|
20
22
|
|
21
23
|
|
@@ -34,4 +36,5 @@ __all__ = [
|
|
34
36
|
"QwenBot",
|
35
37
|
"get_bot",
|
36
38
|
"LangChainBot",
|
39
|
+
"DoubaoBot",
|
37
40
|
]
|