xiaogpt 3.0__tar.gz → 3.2__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-3.0 → xiaogpt-3.2}/PKG-INFO +2 -2
- {xiaogpt-3.0 → xiaogpt-3.2}/pyproject.toml +1 -1
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/bot/glm_bot.py +1 -5
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/bot/qwen_bot.py +0 -1
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/config.py +0 -2
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/xiaogpt.py +1 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/LICENSE +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/README.md +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/__init__.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/__main__.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/bot/__init__.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/bot/base_bot.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/bot/chatgptapi_bot.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/bot/doubao_bot.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/bot/gemini_bot.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/bot/langchain_bot.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/bot/llama_bot.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/bot/moonshot_bot.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/bot/yi_bot.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/cli.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/langchain/callbacks.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/langchain/chain.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/langchain/examples/email/mail_box.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/langchain/examples/email/mail_summary_tools.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/tts/__init__.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/tts/base.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/tts/mi.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/tts/tetos.py +0 -0
- {xiaogpt-3.0 → xiaogpt-3.2}/xiaogpt/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: xiaogpt
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.2
|
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,6 +26,7 @@ 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
|
+
Provides-Extra: locked
|
29
30
|
Requires-Dist: aiohappyeyeballs==2.4.0; extra == "locked"
|
30
31
|
Requires-Dist: aiohttp==3.10.5; extra == "locked"
|
31
32
|
Requires-Dist: aiosignal==1.3.1; extra == "locked"
|
@@ -118,7 +119,6 @@ Requires-Dist: websocket-client==1.8.0; extra == "locked"
|
|
118
119
|
Requires-Dist: websockets==12.0; extra == "locked"
|
119
120
|
Requires-Dist: yarl==1.9.4; extra == "locked"
|
120
121
|
Requires-Dist: zhipuai==2.1.5.20230904; extra == "locked"
|
121
|
-
Provides-Extra: locked
|
122
122
|
Description-Content-Type: text/markdown
|
123
123
|
|
124
124
|
# xiaogpt
|
@@ -11,13 +11,11 @@ from xiaogpt.bot.base_bot import BaseBot, ChatHistoryMixin
|
|
11
11
|
|
12
12
|
class GLMBot(ChatHistoryMixin, BaseBot):
|
13
13
|
name = "Chat GLM"
|
14
|
-
default_options = {"model": "
|
14
|
+
default_options = {"model": "glm-4"} # Change glm model here
|
15
15
|
|
16
16
|
def __init__(self, glm_key: str) -> None:
|
17
17
|
from zhipuai import ZhipuAI
|
18
18
|
|
19
|
-
self.model = "glm-4" # Change glm model here
|
20
|
-
|
21
19
|
self.history = []
|
22
20
|
self.client = ZhipuAI(api_key=glm_key)
|
23
21
|
|
@@ -28,7 +26,6 @@ class GLMBot(ChatHistoryMixin, BaseBot):
|
|
28
26
|
def ask(self, query, **options):
|
29
27
|
ms = self.get_messages()
|
30
28
|
kwargs = {**self.default_options, **options}
|
31
|
-
kwargs["model"] = self.model
|
32
29
|
ms.append({"role": "user", "content": f"{query}"})
|
33
30
|
kwargs["messages"] = ms
|
34
31
|
try:
|
@@ -45,7 +42,6 @@ class GLMBot(ChatHistoryMixin, BaseBot):
|
|
45
42
|
async def ask_stream(self, query: str, **options: Any):
|
46
43
|
ms = self.get_messages()
|
47
44
|
kwargs = {**self.default_options, **options}
|
48
|
-
kwargs["model"] = self.model
|
49
45
|
ms.append({"role": "user", "content": f"{query}"})
|
50
46
|
kwargs["messages"] = ms
|
51
47
|
kwargs["stream"] = True
|
@@ -129,12 +129,10 @@ class Config:
|
|
129
129
|
"secret_key", config.get("volc_secret_key")
|
130
130
|
)
|
131
131
|
elif config.get("tts") == "fish":
|
132
|
-
print("fish")
|
133
132
|
config.setdefault("tts_options", {}).setdefault(
|
134
133
|
"api_key", config.get("fish_api_key")
|
135
134
|
)
|
136
135
|
if voice := config.get("fish_voice_key"):
|
137
|
-
print("fish voice")
|
138
136
|
config.setdefault("tts_options", {}).setdefault("voice", voice)
|
139
137
|
|
140
138
|
return cls(**config)
|
@@ -274,6 +274,7 @@ class MiGPT:
|
|
274
274
|
message = message.strip().replace(" ", "--")
|
275
275
|
message = message.replace("\n", ",")
|
276
276
|
message = message.replace('"', ",")
|
277
|
+
message = message.replace('*', "")
|
277
278
|
return message
|
278
279
|
|
279
280
|
async def ask_gpt(self, query: str) -> AsyncIterator[str]:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|