xiaogpt 2.92__py3-none-any.whl → 3.0__py3-none-any.whl

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/cli.py CHANGED
@@ -104,6 +104,11 @@ def main():
104
104
  parser.add_argument(
105
105
  "--volc_secret_key", dest="volc_secret_key", help="Volcengine secret key"
106
106
  )
107
+ # for fish tts
108
+ parser.add_argument("--fish_api_key", dest="fish_api_key", help="fish api key")
109
+ parser.add_argument(
110
+ "--fish_voice_key", dest="fish_voice_key", help="fish voice key"
111
+ )
107
112
  parser.add_argument(
108
113
  "--verbose",
109
114
  dest="verbose",
@@ -114,7 +119,7 @@ def main():
114
119
  parser.add_argument(
115
120
  "--tts",
116
121
  help="TTS provider",
117
- choices=["mi", "edge", "openai", "azure", "google", "baidu", "volc"],
122
+ choices=["mi", "edge", "openai", "azure", "google", "baidu", "volc", "fish"],
118
123
  )
119
124
  bot_group = parser.add_mutually_exclusive_group()
120
125
  bot_group.add_argument(
xiaogpt/config.py CHANGED
@@ -82,7 +82,7 @@ class Config:
82
82
  end_conversation: str = "结束持续对话"
83
83
  stream: bool = False
84
84
  tts: Literal[
85
- "mi", "edge", "azure", "openai", "baidu", "google", "volc", "minimax"
85
+ "mi", "edge", "azure", "openai", "baidu", "google", "volc", "minimax", "fish"
86
86
  ] = "mi"
87
87
  tts_options: dict[str, Any] = field(default_factory=dict)
88
88
  gpt_options: dict[str, Any] = field(default_factory=dict)
@@ -128,6 +128,15 @@ class Config:
128
128
  config.setdefault("tts_options", {}).setdefault(
129
129
  "secret_key", config.get("volc_secret_key")
130
130
  )
131
+ elif config.get("tts") == "fish":
132
+ print("fish")
133
+ config.setdefault("tts_options", {}).setdefault(
134
+ "api_key", config.get("fish_api_key")
135
+ )
136
+ if voice := config.get("fish_voice_key"):
137
+ print("fish voice")
138
+ config.setdefault("tts_options", {}).setdefault("voice", voice)
139
+
131
140
  return cls(**config)
132
141
 
133
142
  @classmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xiaogpt
3
- Version: 2.92
3
+ Version: 3.0
4
4
  Summary: Play ChatGPT or other LLM with xiaomi AI speaker
5
5
  Author-Email: yihong0618 <zouzou0208@gmail.com>
6
6
  License: MIT
@@ -26,7 +26,8 @@ Requires-Dist: groq>=0.5.0
26
26
  Requires-Dist: pyyaml>=6.0.1
27
27
  Requires-Dist: langchain-community>=0.0.38
28
28
  Requires-Dist: lingua-language-detector>=2.0.2; python_version < "3.13"
29
- Requires-Dist: aiohttp==3.9.5; extra == "locked"
29
+ Requires-Dist: aiohappyeyeballs==2.4.0; extra == "locked"
30
+ Requires-Dist: aiohttp==3.10.5; extra == "locked"
30
31
  Requires-Dist: aiosignal==1.3.1; extra == "locked"
31
32
  Requires-Dist: annotated-types==0.6.0; extra == "locked"
32
33
  Requires-Dist: anyio==4.3.0; extra == "locked"
@@ -39,72 +40,69 @@ Requires-Dist: certifi==2024.2.2; extra == "locked"
39
40
  Requires-Dist: charset-normalizer==3.3.2; extra == "locked"
40
41
  Requires-Dist: click==8.1.7; extra == "locked"
41
42
  Requires-Dist: colorama==0.4.6; platform_system == "Windows" and extra == "locked"
42
- Requires-Dist: dashscope==1.20.3; extra == "locked"
43
+ Requires-Dist: dashscope==1.20.10; extra == "locked"
43
44
  Requires-Dist: dataclasses-json==0.6.3; extra == "locked"
44
45
  Requires-Dist: distro==1.9.0; extra == "locked"
45
46
  Requires-Dist: edge-tts==6.1.10; extra == "locked"
46
- Requires-Dist: et-xmlfile==1.1.0; python_version ~= "3.8" and python_full_version != "3.9.7" and extra == "locked"
47
47
  Requires-Dist: exceptiongroup==1.2.0; python_version < "3.11" and extra == "locked"
48
48
  Requires-Dist: frozenlist==1.4.1; extra == "locked"
49
- Requires-Dist: google-ai-generativelanguage==0.6.6; extra == "locked"
49
+ Requires-Dist: google-ai-generativelanguage==0.6.9; extra == "locked"
50
50
  Requires-Dist: google-api-core==2.15.0; extra == "locked"
51
51
  Requires-Dist: google-api-core[grpc]==2.15.0; extra == "locked"
52
52
  Requires-Dist: google-api-python-client==2.125.0; extra == "locked"
53
53
  Requires-Dist: google-auth==2.26.1; extra == "locked"
54
54
  Requires-Dist: google-auth-httplib2==0.2.0; extra == "locked"
55
55
  Requires-Dist: google-cloud-texttospeech==2.16.3; extra == "locked"
56
- Requires-Dist: google-generativeai==0.7.2; extra == "locked"
56
+ Requires-Dist: google-generativeai==0.8.1; extra == "locked"
57
57
  Requires-Dist: google-search-results==2.4.2; extra == "locked"
58
58
  Requires-Dist: googleapis-common-protos==1.62.0; extra == "locked"
59
59
  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"
60
- Requires-Dist: groq==0.9.0; extra == "locked"
60
+ Requires-Dist: groq==0.11.0; extra == "locked"
61
61
  Requires-Dist: grpcio==1.60.0; extra == "locked"
62
62
  Requires-Dist: grpcio-status==1.60.0; extra == "locked"
63
63
  Requires-Dist: h11==0.14.0; extra == "locked"
64
64
  Requires-Dist: httpcore==1.0.5; extra == "locked"
65
65
  Requires-Dist: httplib2==0.22.0; extra == "locked"
66
- Requires-Dist: httpx==0.27.0; extra == "locked"
67
- Requires-Dist: httpx[socks]==0.27.0; extra == "locked"
66
+ Requires-Dist: httpx==0.27.2; extra == "locked"
67
+ Requires-Dist: httpx[socks]==0.27.2; extra == "locked"
68
68
  Requires-Dist: idna==3.7; extra == "locked"
69
+ Requires-Dist: jiter==0.5.0; extra == "locked"
69
70
  Requires-Dist: jsonpatch==1.33; extra == "locked"
70
71
  Requires-Dist: jsonpointer==2.4; extra == "locked"
71
- Requires-Dist: langchain==0.2.10; extra == "locked"
72
- Requires-Dist: langchain-community==0.2.9; extra == "locked"
73
- Requires-Dist: langchain-core==0.2.22; extra == "locked"
74
- Requires-Dist: langchain-text-splitters==0.2.0; extra == "locked"
75
- Requires-Dist: langsmith==0.1.84; extra == "locked"
72
+ Requires-Dist: langchain==0.3.0; extra == "locked"
73
+ Requires-Dist: langchain-community==0.3.0; extra == "locked"
74
+ Requires-Dist: langchain-core==0.3.0; extra == "locked"
75
+ Requires-Dist: langchain-text-splitters==0.3.0; extra == "locked"
76
+ Requires-Dist: langsmith==0.1.120; extra == "locked"
76
77
  Requires-Dist: lingua-language-detector==2.0.2; python_version < "3.13" and extra == "locked"
77
78
  Requires-Dist: markdown-it-py==3.0.0; extra == "locked"
78
79
  Requires-Dist: marshmallow==3.20.1; extra == "locked"
79
80
  Requires-Dist: mdurl==0.1.2; extra == "locked"
80
- Requires-Dist: miservice-fork==2.7.0; extra == "locked"
81
+ Requires-Dist: miservice-fork==2.7.1; extra == "locked"
81
82
  Requires-Dist: multidict==6.0.5; extra == "locked"
82
83
  Requires-Dist: mutagen==1.47.0; extra == "locked"
83
84
  Requires-Dist: mypy-extensions==1.0.0; extra == "locked"
84
85
  Requires-Dist: numexpr==2.10.1; extra == "locked"
85
86
  Requires-Dist: numpy==1.26.3; extra == "locked"
86
- Requires-Dist: openai==1.36.1; extra == "locked"
87
- Requires-Dist: openpyxl==3.1.5; python_version ~= "3.8" and python_full_version != "3.9.7" and extra == "locked"
87
+ Requires-Dist: openai==1.45.0; extra == "locked"
88
88
  Requires-Dist: orjson==3.10.0; extra == "locked"
89
89
  Requires-Dist: ormsgpack==1.5.0; extra == "locked"
90
90
  Requires-Dist: packaging==23.2; extra == "locked"
91
- Requires-Dist: pandas==2.2.2; python_version ~= "3.8" and python_full_version != "3.9.7" and extra == "locked"
92
91
  Requires-Dist: proto-plus==1.23.0; extra == "locked"
93
92
  Requires-Dist: protobuf==4.25.1; extra == "locked"
94
93
  Requires-Dist: pyasn1==0.5.1; extra == "locked"
95
94
  Requires-Dist: pyasn1-modules==0.3.0; extra == "locked"
96
95
  Requires-Dist: pydantic==2.8.2; extra == "locked"
97
96
  Requires-Dist: pydantic-core==2.20.1; extra == "locked"
97
+ Requires-Dist: pydantic-settings==2.5.2; extra == "locked"
98
98
  Requires-Dist: pygments==2.17.2; extra == "locked"
99
99
  Requires-Dist: pyjwt==2.8.0; extra == "locked"
100
100
  Requires-Dist: pyparsing==3.1.2; python_version > "3.0" and extra == "locked"
101
- Requires-Dist: python-dateutil==2.9.0.post0; python_version ~= "3.8" and python_full_version != "3.9.7" and extra == "locked"
102
- Requires-Dist: pytz==2024.1; python_version ~= "3.8" and python_full_version != "3.9.7" and extra == "locked"
103
- Requires-Dist: pyyaml==6.0.1; extra == "locked"
101
+ Requires-Dist: python-dotenv==1.0.1; extra == "locked"
102
+ Requires-Dist: pyyaml==6.0.2; extra == "locked"
104
103
  Requires-Dist: requests==2.31.0; extra == "locked"
105
- Requires-Dist: rich==13.7.1; extra == "locked"
104
+ Requires-Dist: rich==13.8.1; extra == "locked"
106
105
  Requires-Dist: rsa==4.9; extra == "locked"
107
- Requires-Dist: six==1.16.0; python_version ~= "3.8" and python_full_version != "3.9.7" and extra == "locked"
108
106
  Requires-Dist: sniffio==1.3.0; extra == "locked"
109
107
  Requires-Dist: socksio==1.0.0; extra == "locked"
110
108
  Requires-Dist: soupsieve==2.5; extra == "locked"
@@ -114,13 +112,12 @@ Requires-Dist: tetos==0.3.1; extra == "locked"
114
112
  Requires-Dist: tqdm==4.66.1; extra == "locked"
115
113
  Requires-Dist: typing-extensions==4.12.2; extra == "locked"
116
114
  Requires-Dist: typing-inspect==0.9.0; extra == "locked"
117
- Requires-Dist: tzdata==2024.1; python_version ~= "3.8" and python_full_version != "3.9.7" and extra == "locked"
118
115
  Requires-Dist: uritemplate==4.1.1; extra == "locked"
119
116
  Requires-Dist: urllib3==2.1.0; extra == "locked"
120
117
  Requires-Dist: websocket-client==1.8.0; extra == "locked"
121
118
  Requires-Dist: websockets==12.0; extra == "locked"
122
119
  Requires-Dist: yarl==1.9.4; extra == "locked"
123
- Requires-Dist: zhipuai==2.1.2; extra == "locked"
120
+ Requires-Dist: zhipuai==2.1.5.20230904; extra == "locked"
124
121
  Provides-Extra: locked
125
122
  Description-Content-Type: text/markdown
126
123
 
@@ -187,6 +184,7 @@ Play ChatGPT and other LLM with Xiaomi AI Speaker
187
184
  - `--use_moonshot_api` and other models please refer below
188
185
  - 可以跟小爱说 `开始持续对话` 自动进入持续对话状态,`结束持续对话` 结束持续对话状态。
189
186
  - 可以使用 `--tts edge` 来获取更好的 tts 能力
187
+ - 可以使用 `--tts fish --fish_api_key <your-fish-key> --fish_voice_key <fish-voice>` 来获取 [fish-audio](https://fish.audio/) 能力(如何获取 fish voice 见下)
190
188
  - 可以使用 `--tts openai` 来获取 openai tts 能力
191
189
  - 可以使用 `--tts azure --azure_tts_speech_key <your-speech-key>` 来获取 Azure TTS 能力
192
190
  - 可以使用 `--use_langchain` 替代 `--use_chatgpt_api` 来调用 LangChain(默认 chatgpt)服务,实现上网检索、数学运算..
@@ -216,11 +214,7 @@ xiaogpt --hardware LX06 --mute_xiaoai --use_moonshot_api --moonshot_api_key ${m
216
214
  xiaogpt --hardware LX06 --mute_xiaoai --use_llama --llama_api_key ${llama_api_key}
217
215
  # 如果你想使用 01
218
216
  xiaogpt --hardware LX06 --mute_xiaoai --use_yi_api --ti_api_key ${yi_api_key}
219
- # 如果你想使用豆包
220
-
221
-
222
-
223
-
217
+ # 如果你想使用 LangChain+SerpApi 实现上网检索或其他本地服务(目前仅支持 stream 模式)
224
218
  export OPENAI_API_KEY=${your_api_key}
225
219
  export SERPAPI_API_KEY=${your_serpapi_key}
226
220
  xiaogpt --hardware Lx06 --use_langchain --mute_xiaoai --stream --openai_key ${your_api_key} --serpapi_api_key ${your_serpapi_key}
@@ -407,6 +401,7 @@ docker build --build-arg PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
407
401
  [edge-tts](https://github.com/rany2/edge-tts) 提供了类似微软tts的能力
408
402
  [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 的能力
409
403
  [openai-tts](https://platform.openai.com/docs/guides/text-to-speech) 提供了类似 openai tts 的能力
404
+ [fish-tts](https://fish.audio/) 提供了 fish tts 的能力
410
405
 
411
406
  #### Usage
412
407
 
@@ -422,7 +417,24 @@ For edge 查看更多语言支持, 从中选择一个
422
417
  edge-tts --list-voices
423
418
  ```
424
419
 
425
- #### 在容器中使用 edge-tts/azure-tts/openai-tts/volc/google/baidu
420
+ #### 如果你想使用 [fish-tts](https://fish.audio/)
421
+
422
+ 1. 注册 https://fish.audio/zh-CN/go-api/ 拿到 api key
423
+ 2. 选择你想要的声音自建声音或者使用热门声音 https://fish.audio/zh-CN/text-to-speech/?modelId=e80ea225770f42f79d50aa98be3cedfc 其中 `e80ea225770f42f79d50aa98be3cedfc` 就声音的 key id
424
+ 3. python3 xiaogpt.py --hardware LX06 --account xxxx --password xxxxx --use_chatgpt_api --mute_xiaoai --stream --tts fish --fish_api_key xxxxx --fish_voice_key xxxxx
425
+ 4. 或者在 xiao_config.yaml 中配置
426
+
427
+ ```yaml
428
+ tts: fish
429
+ # TTS 参数字典,参考 https://github.com/frostming/tetos 获取可用参数
430
+ tts_options: {
431
+ "api_key": "xxxxx",
432
+ "voice": "xxxxxx"
433
+ }
434
+
435
+ ```
436
+
437
+ #### 在容器中使用 edge-tts/azure-tts/openai-tts/volc/google/baidu/fish
426
438
 
427
439
  由于 Edge TTS 启动了一个本地的 HTTP 服务,所以需要将容器的端口映射到宿主机上,并且指定本地机器的 hostname:
428
440
 
@@ -1,7 +1,7 @@
1
- xiaogpt-2.92.dist-info/METADATA,sha256=p0IjnCgmXIO0qEHUJXlQp9MlOX32XwSFQgjCSF3hyUI,30898
2
- xiaogpt-2.92.dist-info/WHEEL,sha256=rSwsxJWe3vzyR5HCwjWXQruDgschpei4h_giTm0dJVE,90
3
- xiaogpt-2.92.dist-info/entry_points.txt,sha256=zLFzA72qQ_eWBepdA2YU5vdXFqORH8wXhv2Ox1vnYP8,46
4
- xiaogpt-2.92.dist-info/licenses/LICENSE,sha256=XdClh516MvlnOf9749JZHCxSB7y6_fyXcWmLDz6IkZY,1063
1
+ xiaogpt-3.0.dist-info/METADATA,sha256=Oy_RL1Klnu1BgL2WIIqkJ2PHVg-1SnO_Mdng3QV2OMU,31354
2
+ xiaogpt-3.0.dist-info/WHEEL,sha256=rSwsxJWe3vzyR5HCwjWXQruDgschpei4h_giTm0dJVE,90
3
+ xiaogpt-3.0.dist-info/entry_points.txt,sha256=zLFzA72qQ_eWBepdA2YU5vdXFqORH8wXhv2Ox1vnYP8,46
4
+ xiaogpt-3.0.dist-info/licenses/LICENSE,sha256=XdClh516MvlnOf9749JZHCxSB7y6_fyXcWmLDz6IkZY,1063
5
5
  xiaogpt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  xiaogpt/__main__.py,sha256=MSmt_5Xg84uHqzTN38JwgseJK8rsJn_11A8WD99VtEo,61
7
7
  xiaogpt/bot/__init__.py,sha256=BDGvj1JuWVw47qfREWGKnSXeiFg6DVJJAz2rHVryqmc,1160
@@ -15,8 +15,8 @@ xiaogpt/bot/llama_bot.py,sha256=HRR_ycuC6DY5MQTKauXEayQ0o_JKk9t-ea3mblscm8E,708
15
15
  xiaogpt/bot/moonshot_bot.py,sha256=PrVRBskZx-U0lH_3RVe89QJa7WKHYqhpft0089pYQz0,822
16
16
  xiaogpt/bot/qwen_bot.py,sha256=325lMa4Z38rRh47HDa3J4XjvSs4SWOqMVhrMWzkGNo4,3657
17
17
  xiaogpt/bot/yi_bot.py,sha256=D7JEIh8KPVMvlOLaEVr9ahvyMaJLGToHP_gWU3RoYPc,784
18
- xiaogpt/cli.py,sha256=w7LZoxOAJQRFqydPx4qNYqsMVW8oQpzHp0vCB4sQUNo,5711
19
- xiaogpt/config.py,sha256=etGv23JNhangov6jMUVZw52C9yiEMgsqscG9_N2b8mE,6734
18
+ xiaogpt/cli.py,sha256=HXKkW5yg2q8qCruzjMjNTgcjsvs-qoZWPg6mNC_XSB8,5926
19
+ xiaogpt/config.py,sha256=TpIFw3IxUcowwBlQeiB_b4Xv6xU017oTfya7BphZfUI,7110
20
20
  xiaogpt/langchain/callbacks.py,sha256=yR9AXQt9OHVYBWC47Q1I_BUT4Xg9iM44vnW2vv0BLpE,2616
21
21
  xiaogpt/langchain/chain.py,sha256=z0cqRlL0ElWnf31ByxZBN7AKOT-svXQDt5_NDft_nYc,1495
22
22
  xiaogpt/langchain/examples/email/mail_box.py,sha256=xauqrjE4-G4XPQnokUPE-MZgAaHQ_VrUDLlbfYTdCoo,6372
@@ -27,4 +27,4 @@ xiaogpt/tts/mi.py,sha256=1MzCB27DBohPQ_4Xz4W_FV9p-chJFDavOHB89NviLcM,1095
27
27
  xiaogpt/tts/tetos.py,sha256=fkuOSYGqAfJyyPEXbsiOS--CewGf1JUiahoN33nzOAA,1058
28
28
  xiaogpt/utils.py,sha256=YYmRDNtccxqB9gyN_xhKZwgL1_PNYEp7So_-jt2tiVg,2668
29
29
  xiaogpt/xiaogpt.py,sha256=3Q8Au9QcJy1fRGrMd0XKYbUn9_uKvVPce8PE-DA6heg,16153
30
- xiaogpt-2.92.dist-info/RECORD,,
30
+ xiaogpt-3.0.dist-info/RECORD,,
File without changes