xiaozhi-sdk 0.0.10__py3-none-any.whl → 0.1.1__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.

Potentially problematic release.


This version of xiaozhi-sdk might be problematic. Click here for more details.

xiaozhi_sdk/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
- __version__ = "0.0.10"
1
+ __version__ = "0.1.1"
2
2
 
3
3
  from xiaozhi_sdk.core import XiaoZhiWebsocket # noqa
xiaozhi_sdk/cli.py CHANGED
@@ -48,7 +48,7 @@ handler.setFormatter(
48
48
  datefmt="%Y-%m-%d %H:%M:%S",
49
49
  log_colors={
50
50
  "DEBUG": "white",
51
- "INFO": "green",
51
+ "INFO": "white",
52
52
  "INFO1": "green",
53
53
  "INFO2": "cyan",
54
54
  "INFO3": "blue",
@@ -72,14 +72,19 @@ is_end = False
72
72
  async def handle_message(message):
73
73
  """处理接收到的消息"""
74
74
  global is_end
75
- if message["type"] == "stt":
76
- logger.info1("message received: %s", message)
77
- elif message["type"] == "tts":
78
- logger.info2("message received: %s", message)
79
- elif message["type"] == "llm":
80
- logger.info3("message received: %s", message)
81
- else:
82
- logger.info("message received: %s", message)
75
+ if message["type"] == "stt": # 人类语音
76
+ logger.info1("human: %s", message["text"])
77
+ elif message["type"] == "tts" and message["state"] == "sentence_start": # AI语音
78
+ logger.info2("AI: %s", message["text"])
79
+ elif message["type"] == "tts" and message["state"] == "stop":
80
+ pass
81
+ # logger.info2("播放结束")
82
+ # logger.info("聆听中...")
83
+ elif message["type"] == "llm": # 表情
84
+ logger.info3("emotion: %s", message["text"])
85
+ else: # 其他消息
86
+ pass
87
+ # logger.info("other: %s", message)
83
88
 
84
89
  if message["type"] == "websocket" and message["state"] == "close":
85
90
  is_end = True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xiaozhi-sdk
3
- Version: 0.0.10
3
+ Version: 0.1.1
4
4
  Summary: 一个用于连接和控制小智智能设备的Python SDK,支持实时音频通信、MCP工具集成和设备管理功能。
5
5
  Author-email: dairoot <623815825@qq.com>
6
6
  License-Expression: MIT
@@ -8,9 +8,9 @@ file/opus/linux-x64-libopus.so,sha256=FmXJqkxLpDzNFOHYkmOzmsp1hP0eIS5b6x_XfOs-IQ
8
8
  file/opus/macos-arm64-libopus.dylib,sha256=H7wXwkrGwb-hesMMZGFxWb0Ri1Y4m5GWiKsd8CfOhE8,357584
9
9
  file/opus/macos-x64-libopus.dylib,sha256=MqyL_OjwSACF4Xs_-KrGbcScy4IEprr5Rlkk3ddZye8,550856
10
10
  file/opus/windows-opus.dll,sha256=kLfhioMvbJhOgNMAldpWk3DCZqC5Xd70LRbHnACvAnw,463360
11
- xiaozhi_sdk/__init__.py,sha256=4-2cLsMk3Bq03wsMvSLb-DzFWsOqPFUKgKf4oeheg2Y,78
11
+ xiaozhi_sdk/__init__.py,sha256=-YmHE_cFBLemiK3AzbQAjKlaQON5TZsWKNig3atyyJQ,77
12
12
  xiaozhi_sdk/__main__.py,sha256=i0ZJdHUqAKg9vwZrK_w0TJkzdotTYTK8aUeSPcJc1ks,210
13
- xiaozhi_sdk/cli.py,sha256=9BiFlGy_2wFES_4dpan8iFEnwuwTyg4vjxwWitLpO5U,5621
13
+ xiaozhi_sdk/cli.py,sha256=86if9OjconMPdvtK_904ga8FDYWzVtH6E2FQI-tGrRA,5862
14
14
  xiaozhi_sdk/config.py,sha256=h4mpMeBf2vT9qYAqCCbGVGmMemkgk98pcXP2Rh4TEFc,89
15
15
  xiaozhi_sdk/core.py,sha256=564SefCBus6qNRApWqwI113aIN1p4eYpci1mLeMExIs,10007
16
16
  xiaozhi_sdk/iot.py,sha256=VVAheynp1iV4GCaoPywQWpKtlyoACDLswH8yfV_JZgI,2699
@@ -19,8 +19,8 @@ xiaozhi_sdk/opus.py,sha256=r3nnYg0ZKAJTreb_3nKgfHJh06MJiMvnNMPO1SWdoMM,2224
19
19
  xiaozhi_sdk/utils/__init__.py,sha256=XKSHWoFmuSkpwaIr308HybRzfFIXoT1Fd-eUKo_im6Y,1705
20
20
  xiaozhi_sdk/utils/mcp_data.py,sha256=r_GLjFpvUKeV8IhlkT7Pfb4c9bDO9q4k3f4iPZBBcKI,3892
21
21
  xiaozhi_sdk/utils/mcp_tool.py,sha256=imwehfUlENjelYmGbGYgb6C82-ijs53XCxrtCpqrJps,3152
22
- xiaozhi_sdk-0.0.10.dist-info/licenses/LICENSE,sha256=Vwgps1iODKl43cAtME_0dawTjAzNW-O2BWiN5BHggww,1085
23
- xiaozhi_sdk-0.0.10.dist-info/METADATA,sha256=uaSfv6gxD9hEvaKFWPSLasJVecL-BTk8Dhv-7lniDzk,2092
24
- xiaozhi_sdk-0.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
- xiaozhi_sdk-0.0.10.dist-info/top_level.txt,sha256=nBpue4hU5Ykm5CtYPsAdxSa_yqbtZsIT_gF_EkBaJPM,12
26
- xiaozhi_sdk-0.0.10.dist-info/RECORD,,
22
+ xiaozhi_sdk-0.1.1.dist-info/licenses/LICENSE,sha256=Vwgps1iODKl43cAtME_0dawTjAzNW-O2BWiN5BHggww,1085
23
+ xiaozhi_sdk-0.1.1.dist-info/METADATA,sha256=j__sITpWYwcvM_7qYTb-gE4ZKrpMudbuiO35nuvBh6c,2091
24
+ xiaozhi_sdk-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ xiaozhi_sdk-0.1.1.dist-info/top_level.txt,sha256=nBpue4hU5Ykm5CtYPsAdxSa_yqbtZsIT_gF_EkBaJPM,12
26
+ xiaozhi_sdk-0.1.1.dist-info/RECORD,,