Skip to content

Commit 7a915f1

Browse files
committed
fix: doubao doc and doubao cli
Signed-off-by: yihong0618 <[email protected]>
1 parent e0bdf4c commit 7a915f1

File tree

5 files changed

+33
-14
lines changed

5 files changed

+33
-14
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,5 @@ config/
135135
*.mp3
136136
.pdm-python
137137
.pdm-build/
138-
chatgpt.sh
138+
chatgpt.sh
139+
nohup.out

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Play ChatGPT and other LLM with Xiaomi AI Speaker
1616
- New Bing
1717
- [ChatGLM](http://open.bigmodel.cn/)
1818
- [Gemini](https://makersuite.google.com/app/apikey)
19+
- [Doubao](https://console.volcengine.com/iam/keymanage/)
1920
- [通义千问](https://help.aliyun.com/zh/dashscope/developer-reference/api-details)
2021

2122
## 获取小米音响DID
@@ -78,6 +79,8 @@ xiaogpt --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${gemini_key}
7879
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${gemini_key} --gemini_api_domain ${gemini_api_domain}
7980
# 如果你想使用阿里的通义千问
8081
xiaogpt --hardware LX06 --mute_xiaoai --use_qwen --qen_key ${qwen_key}
82+
# 如果你想使用豆包
83+
xiaogpt --hardware LX06 --mute_xiaoai --use_doubao --stream --volc_access_key xxxx --volc_secret_key xxx
8184
# 如果你想用 edge-tts
8285
xiaogpt --hardware LX06 --cookie ${cookie} --use_chatgpt_api --tts edge
8386
# 如果你想使用 LangChain + SerpApi 实现上网检索或其他本地服务(目前仅支持 stream 模式)
@@ -107,6 +110,8 @@ python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${ge
107110
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_gemini --gemini_key ${gemini_key} --gemini_api_domain ${gemini_api_domain}
108111
# 如果你想使用阿里的通义千问
109112
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_qwen --qen_key ${qwen_key}
113+
# 如果你想使用豆包
114+
python3 xiaogpt.py --hardware LX06 --mute_xiaoai --use_doubao --stream --volc_access_key xxxx --volc_secret_key xxx
110115
# 如果你想使用 LangChain+SerpApi 实现上网检索或其他本地服务(目前仅支持 stream 模式)
111116
export OPENAI_API_KEY=${your_api_key}
112117
export SERPAPI_API_KEY=${your_serpapi_key}
@@ -258,7 +263,7 @@ docker build --build-arg PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
258263

259264
### 第三方 TTS
260265

261-
我们目前支持是三种第三方 TTS:edge/openai/azure
266+
我们目前支持是三种第三方 TTS:edge/openai/azure/volc/baidu/google
262267

263268
[edge-tts](https://github.com/rany2/edge-tts) 提供了类似微软tts的能力
264269
[azure-tts](https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/9-more-realistic-ai-voices-for-conversations-now-generally/ba-p/4099471) 提供了微软 azure tts 的能力
@@ -271,17 +276,16 @@ docker build --build-arg PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
271276
```json
272277
{
273278
"tts": "edge",
274-
"tts_voice": "zh-CN-XiaoxiaoNeural"
275279
}
276280
```
277281

278-
查看更多语言支持, 从中选择一个
282+
For edge 查看更多语言支持, 从中选择一个
279283

280284
```shell
281285
edge-tts --list-voices
282286
```
283287

284-
#### 在容器中使用 edge-tts/azure-tts/openai-tts
288+
#### 在容器中使用 edge-tts/azure-tts/openai-tts/volc/google/baidu
285289

286290
由于 Edge TTS 启动了一个本地的 HTTP 服务,所以需要将容器的端口映射到宿主机上,并且指定本地机器的 hostname:
287291

pdm.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

xiaogpt/cli.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ def main():
8383
default=None,
8484
help="try to mute xiaoai answer",
8585
)
86-
parser.add_argument("--volc-access-key", help="Volcengine access key")
87-
parser.add_argument("--volc-secret-key", help="Volcengine secret key")
86+
parser.add_argument(
87+
"--volc_access_key", dest="volc_access_key", help="Volcengine access key"
88+
)
89+
parser.add_argument(
90+
"--volc_secret_key", dest="volc_secret_key", help="Volcengine secret key"
91+
)
8892
parser.add_argument(
8993
"--verbose",
9094
dest="verbose",
@@ -140,6 +144,13 @@ def main():
140144
const="gemini",
141145
help="if use gemini",
142146
)
147+
bot_group.add_argument(
148+
"--use_doubao",
149+
dest="bot",
150+
action="store_const",
151+
const="doubao",
152+
help="if use doubao",
153+
)
143154
parser.add_argument(
144155
"--bing_cookie_path",
145156
dest="bing_cookie_path",
@@ -156,6 +167,7 @@ def main():
156167
"gemini",
157168
"langchain",
158169
"qwen",
170+
"doubao",
159171
],
160172
)
161173
parser.add_argument(

xiaogpt/config.py

+2
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ def read_from_file(cls, config_path: str) -> dict:
153153
key, value = "bot", "gemini"
154154
elif key == "use_qwen":
155155
key, value = "bot", "qwen"
156+
elif key == "use_doubao":
157+
key, value = "bot", "doubao"
156158
elif key == "use_langchain":
157159
key, value = "bot", "langchain"
158160
elif key == "enable_edge_tts":

0 commit comments

Comments
 (0)