xiaozhi-sdk 0.0.4__tar.gz → 0.0.5__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.
- {xiaozhi_sdk-0.0.4/xiaozhi_sdk.egg-info → xiaozhi_sdk-0.0.5}/PKG-INFO +2 -2
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/pyproject.toml +1 -1
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/tests/test_iot.py +2 -2
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/xiaozhi_sdk/__init__.py +7 -3
- xiaozhi_sdk-0.0.5/xiaozhi_sdk/config.py +3 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/xiaozhi_sdk/iot.py +1 -1
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5/xiaozhi_sdk.egg-info}/PKG-INFO +2 -2
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/xiaozhi_sdk.egg-info/requires.txt +1 -1
- xiaozhi_sdk-0.0.4/xiaozhi_sdk/config.py +0 -3
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/LICENSE +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/MANIFEST.in +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/README.md +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/file/audio/greet.wav +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/file/audio/say_hello.wav +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/file/audio/take_photo.wav +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/file/image/leijun.jpg +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/file/opus/linux-arm64-libopus.so +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/file/opus/linux-x64-libopus.so +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/file/opus/macos-arm64-libopus.dylib +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/file/opus/macos-x64-libopus.dylib +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/file/opus/windows-x86_64-opus.dll +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/setup.cfg +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/tests/test_opus.py +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/tests/test_pic.py +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/tests/test_xiaozhi.py +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/xiaozhi_sdk/__main__.py +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/xiaozhi_sdk/data.py +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/xiaozhi_sdk/mcp.py +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/xiaozhi_sdk/opus.py +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/xiaozhi_sdk/utils.py +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/xiaozhi_sdk.egg-info/SOURCES.txt +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/xiaozhi_sdk.egg-info/dependency_links.txt +0 -0
- {xiaozhi_sdk-0.0.4 → xiaozhi_sdk-0.0.5}/xiaozhi_sdk.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xiaozhi-sdk
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: 一个用于连接和控制小智智能设备的Python SDK,支持实时音频通信、MCP工具集成和设备管理功能。
|
|
5
5
|
Author-email: dairoot <623815825@qq.com>
|
|
6
6
|
License: MIT
|
|
@@ -12,7 +12,7 @@ Requires-Python: >=3.8.1
|
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: numpy
|
|
15
|
-
Requires-Dist: websockets
|
|
15
|
+
Requires-Dist: websockets>=15.0.1
|
|
16
16
|
Requires-Dist: aiohttp
|
|
17
17
|
Requires-Dist: av
|
|
18
18
|
Requires-Dist: opuslib
|
|
@@ -13,9 +13,9 @@ from xiaozhi_sdk.iot import OtaDevice
|
|
|
13
13
|
async def test_main():
|
|
14
14
|
serial_number = ""
|
|
15
15
|
license_key = ""
|
|
16
|
-
mac_address = "
|
|
16
|
+
mac_address = ""
|
|
17
17
|
ota_url = "http://localhost:3080/api/ota"
|
|
18
|
-
|
|
18
|
+
ota_url = None
|
|
19
19
|
ota = OtaDevice(mac_addr=mac_address, client_id=str(uuid.uuid4()), serial_number=serial_number, ota_url=ota_url)
|
|
20
20
|
res = await ota.activate_device()
|
|
21
21
|
if not res.get("activation"):
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.5"
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
4
|
import json
|
|
@@ -166,11 +166,15 @@ class XiaoZhiWebsocket(McpTool):
|
|
|
166
166
|
|
|
167
167
|
self.ota = OtaDevice(self.mac_addr, self.client_id, self.ota_url, serial_number)
|
|
168
168
|
ota_info = await self.ota.activate_device()
|
|
169
|
-
ws_url = ota_info
|
|
169
|
+
ws_url = ota_info.get("websocket", {}).get("url")
|
|
170
170
|
self.url = self.url or ws_url
|
|
171
171
|
|
|
172
|
+
if not self.url:
|
|
173
|
+
logger.warning("[websocket] 未找到websocket链接地址")
|
|
174
|
+
return
|
|
175
|
+
|
|
172
176
|
if "tenclass.net" not in self.url and "xiaozhi.me" not in self.url:
|
|
173
|
-
logger.warning("[websocket]
|
|
177
|
+
logger.warning("[websocket] 检测到非官方服务器,当前链接地址: %s", self.url)
|
|
174
178
|
|
|
175
179
|
headers = {
|
|
176
180
|
"Authorization": "Bearer {}".format(ota_info["websocket"]["token"]),
|
|
@@ -56,7 +56,7 @@ class OtaDevice:
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
async with aiohttp.ClientSession() as session:
|
|
59
|
-
async with session.post(self.ota_url, headers=headers, data=json.dumps(payload)) as response:
|
|
59
|
+
async with session.post(self.ota_url + "/", headers=headers, data=json.dumps(payload)) as response:
|
|
60
60
|
response.raise_for_status()
|
|
61
61
|
return await response.json()
|
|
62
62
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xiaozhi-sdk
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: 一个用于连接和控制小智智能设备的Python SDK,支持实时音频通信、MCP工具集成和设备管理功能。
|
|
5
5
|
Author-email: dairoot <623815825@qq.com>
|
|
6
6
|
License: MIT
|
|
@@ -12,7 +12,7 @@ Requires-Python: >=3.8.1
|
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: numpy
|
|
15
|
-
Requires-Dist: websockets
|
|
15
|
+
Requires-Dist: websockets>=15.0.1
|
|
16
16
|
Requires-Dist: aiohttp
|
|
17
17
|
Requires-Dist: av
|
|
18
18
|
Requires-Dist: opuslib
|
|
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
|
|
File without changes
|