xiaogpt 3.4__py3-none-any.whl → 3.5__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 +3 -2
- xiaogpt/config.py +1 -1
- xiaogpt/tts/live.py +5 -0
- xiaogpt/xiaogpt.py +16 -7
- {xiaogpt-3.4.dist-info → xiaogpt-3.5.dist-info}/METADATA +1 -1
- {xiaogpt-3.4.dist-info → xiaogpt-3.5.dist-info}/RECORD +9 -9
- {xiaogpt-3.4.dist-info → xiaogpt-3.5.dist-info}/WHEEL +0 -0
- {xiaogpt-3.4.dist-info → xiaogpt-3.5.dist-info}/entry_points.txt +0 -0
- {xiaogpt-3.4.dist-info → xiaogpt-3.5.dist-info}/licenses/LICENSE +0 -0
xiaogpt/cli.py
CHANGED
xiaogpt/config.py
CHANGED
xiaogpt/tts/live.py
CHANGED
@@ -27,11 +27,15 @@ class HTTPRequestHandler(BaseHTTPRequestHandler):
|
|
27
27
|
self.end_headers()
|
28
28
|
key = self.path.split("/")[-1]
|
29
29
|
queue = get_queue(key)
|
30
|
+
chunks: list[bytes] = []
|
30
31
|
while True:
|
31
32
|
chunk = queue.get()
|
33
|
+
chunks.append(chunk)
|
32
34
|
if chunk == b"":
|
33
35
|
break
|
34
36
|
self.wfile.write(chunk)
|
37
|
+
for chunk in chunks:
|
38
|
+
queue.put_nowait(chunk)
|
35
39
|
|
36
40
|
def log_message(self, format, *args):
|
37
41
|
logger.debug(f"{self.address_string()} - {format}", *args)
|
@@ -76,6 +80,7 @@ class TetosLiveTTS(TTS):
|
|
76
80
|
|
77
81
|
while True:
|
78
82
|
if await self.get_if_xiaoai_is_playing():
|
83
|
+
logger.debug("Xiaoai is playing, waiting")
|
79
84
|
await asyncio.sleep(1)
|
80
85
|
else:
|
81
86
|
break
|
xiaogpt/xiaogpt.py
CHANGED
@@ -57,15 +57,20 @@ class MiGPT:
|
|
57
57
|
async def poll_latest_ask(self):
|
58
58
|
async with ClientSession() as session:
|
59
59
|
session._cookie_jar = self.cookie_jar
|
60
|
+
log_polling = int(self.config.verbose) > 1
|
60
61
|
while True:
|
61
|
-
|
62
|
-
|
63
|
-
|
62
|
+
if log_polling:
|
63
|
+
self.log.debug(
|
64
|
+
"Listening new message, timestamp: %s", self.last_timestamp
|
65
|
+
)
|
64
66
|
new_record = await self.get_latest_ask_from_xiaoai(session)
|
65
67
|
start = time.perf_counter()
|
66
|
-
|
67
|
-
|
68
|
-
|
68
|
+
if log_polling:
|
69
|
+
self.log.debug(
|
70
|
+
"Polling_event, timestamp: %s %s",
|
71
|
+
self.last_timestamp,
|
72
|
+
new_record,
|
73
|
+
)
|
69
74
|
await self.polling_event.wait()
|
70
75
|
if (
|
71
76
|
self.config.mute_xiaoai
|
@@ -75,7 +80,10 @@ class MiGPT:
|
|
75
80
|
await self.stop_if_xiaoai_is_playing()
|
76
81
|
if (d := time.perf_counter() - start) < 1:
|
77
82
|
# sleep to avoid too many request
|
78
|
-
|
83
|
+
if log_polling:
|
84
|
+
self.log.debug(
|
85
|
+
"Sleep %f, timestamp: %s", d, self.last_timestamp
|
86
|
+
)
|
79
87
|
# if you want force mute xiaoai, comment this line below.
|
80
88
|
await asyncio.sleep(1 - d)
|
81
89
|
|
@@ -334,6 +342,7 @@ class MiGPT:
|
|
334
342
|
async def stop_if_xiaoai_is_playing(self):
|
335
343
|
is_playing = await self.get_if_xiaoai_is_playing()
|
336
344
|
if is_playing:
|
345
|
+
self.log.debug("Muting xiaoai")
|
337
346
|
# stop it
|
338
347
|
await self.mina_service.player_pause(self.device_id)
|
339
348
|
|
@@ -1,7 +1,7 @@
|
|
1
|
-
xiaogpt-3.
|
2
|
-
xiaogpt-3.
|
3
|
-
xiaogpt-3.
|
4
|
-
xiaogpt-3.
|
1
|
+
xiaogpt-3.5.dist-info/METADATA,sha256=fqymHqLmsFnNBE2G332D8ZbdmEFJ0gI3q08OXn6M3j0,31516
|
2
|
+
xiaogpt-3.5.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
3
|
+
xiaogpt-3.5.dist-info/entry_points.txt,sha256=q4WRS7kS4kQ5kZX57Fq40VrhCi74NZcyRPRX4JP2veo,61
|
4
|
+
xiaogpt-3.5.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=rFCOz5uiUsuhePjPozdCecNv5HGiUTNEhHYNw3Exexs,3590
|
17
17
|
xiaogpt/bot/yi_bot.py,sha256=D7JEIh8KPVMvlOLaEVr9ahvyMaJLGToHP_gWU3RoYPc,784
|
18
|
-
xiaogpt/cli.py,sha256=
|
19
|
-
xiaogpt/config.py,sha256=
|
18
|
+
xiaogpt/cli.py,sha256=iUPQwiZqIpzu1HoinneijBEfVKV7F_f_YMgqPPZM5lA,5932
|
19
|
+
xiaogpt/config.py,sha256=GpK3RXJI_B5YBKMxErAh9wUH1FWqVbQppZM4f7B-EoI,7043
|
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
|
@@ -24,8 +24,8 @@ xiaogpt/langchain/examples/email/mail_summary_tools.py,sha256=6cWvBJUaA7iaywcHdb
|
|
24
24
|
xiaogpt/tts/__init__.py,sha256=75_W5ZhON87RSutiLhJB29Ub-634iI2IlTEZd0alao8,210
|
25
25
|
xiaogpt/tts/base.py,sha256=8vP8fIksSZttmrMaUT4vtiDbkfijkr9lbhyod1_5tc4,1440
|
26
26
|
xiaogpt/tts/file.py,sha256=pWzozktMAgJraPiANWQC5dB4EQcL9QCwJWbX_M4hqWE,3721
|
27
|
-
xiaogpt/tts/live.py,sha256=
|
27
|
+
xiaogpt/tts/live.py,sha256=7-NpuOU7E6GNht1PHjAA8_miXdFVDk8C7aL-sY1xqPE,3299
|
28
28
|
xiaogpt/tts/mi.py,sha256=1MzCB27DBohPQ_4Xz4W_FV9p-chJFDavOHB89NviLcM,1095
|
29
29
|
xiaogpt/utils.py,sha256=YYmRDNtccxqB9gyN_xhKZwgL1_PNYEp7So_-jt2tiVg,2668
|
30
|
-
xiaogpt/xiaogpt.py,sha256=
|
31
|
-
xiaogpt-3.
|
30
|
+
xiaogpt/xiaogpt.py,sha256=zHZFijx-tH6vi3roB1uluZUhqLUnhmYNUR367GXVixg,16696
|
31
|
+
xiaogpt-3.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|