小智SDK | 一句话命令
基于虾哥的 小智esp32 websocket 通讯协议 实现的 Python SDK。
一个用于连接和控制小智设备的 Python SDK。支持以下功能:
- 实时音频通信
- MCP 工具集成
- 设备管理与控制
- 跨平台支持(Windows、macOS、Linux、树莓派,支持 x64 和 ARM64 架构)
📦 安装
pip install uv
uv pip install xiaozhi-sdk -U
🚀 快速开始
1. 终端使用
最简单的方式是通过终端直接连接设备:
查看帮助信息
xiaozhi --help
连接设备
# 默认本机 mac 地址
xiaozhi
# 指定 mac 地址
xiaozhi 00:22:44:66:88:00
# 更多常用操作
## --url 指定服务端 websocket 地址
## --send_text 指定连接后发送的文本
xiaozhi 00:22:44:66:88:00 \
--url ws://127.0.0.1:8180 \
--send_text "你好啊"
2. 编程使用 (高阶用法)
参考 examples 文件中的示例代码,可以快速开始使用 SDK。
✅ 运行测试
# 安装开发依赖
uv sync --group dev
# 运行测试
uv run pytest
🫡 致敬
- 🫡 虾哥的 xiaozhi-esp32 项目
Metadata
Release files for xiaozhi-sdk 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xiaozhi_sdk-0.5.1.tar.gz | 1.8 MB | Without provenance | Details for xiaozhi_sdk-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xiaozhi_sdk-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for xiaozhi_sdk-0.5.1-py3-none-any.whl |
Total release size: 3.6 MB
Release files / xiaozhi_sdk-0.5.1.tar.gz
| Download URL | xiaozhi_sdk-0.5.1.tar.gz |
|---|---|
| Size | 1.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
560380db8b574f4726f968e075315fb241e3e1d58e460086b29c5e1e1bee12b5
|
|
BLAKE2b-256 checksum How to use checksums |
7fd9aff72a4d56cc40f5a524e35401ace7f0802f35e197ce617b33933d018ae7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / xiaozhi_sdk-0.5.1-py3-none-any.whl
| Download URL | xiaozhi_sdk-0.5.1-py3-none-any.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba69d01cba17ab8d092d3f1b92ea179d3445f78e4c5807b37340b819d0bce0ad
|
|
BLAKE2b-256 checksum How to use checksums |
59b857a906af9e0d251cd9ded32b1ec4c712570347abf67c83845727f57da868
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for xiaozhi-sdk 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.