Skip to main content

小智SDK | 一句话命令

Python Version License PyPI

基于虾哥的 小智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

🫡 致敬

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xiaozhi_sdk-0.5.1.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xiaozhi_sdk-0.5.1-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file xiaozhi_sdk-0.5.1.tar.gz.

File metadata

  • Download URL: xiaozhi_sdk-0.5.1.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for xiaozhi_sdk-0.5.1.tar.gz
Algorithm Hash digest
SHA256 560380db8b574f4726f968e075315fb241e3e1d58e460086b29c5e1e1bee12b5
MD5 511034fbf122c84884db9f8ee6aecf15
BLAKE2b-256 7fd9aff72a4d56cc40f5a524e35401ace7f0802f35e197ce617b33933d018ae7

See more details on using hashes here.

File details

Details for the file xiaozhi_sdk-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: xiaozhi_sdk-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for xiaozhi_sdk-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba69d01cba17ab8d092d3f1b92ea179d3445f78e4c5807b37340b819d0bce0ad
MD5 44c98e85487c3a2f8307081554c03b45
BLAKE2b-256 59b857a906af9e0d251cd9ded32b1ec4c712570347abf67c83845727f57da868

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page