Skip to main content

一个用于连接和控制小智智能设备的Python SDK,支持实时音频通信、MCP工具集成和设备管理功能。

Project description

小智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 地址
## --wake_word 指定唤醒词
xiaozhi 00:22:44:66:88:00 \
  --url ws://127.0.0.1:8180 \
  --wake_word "你好啊"

2. 编程使用 (高阶用法)

参考 examples 文件中的示例代码,可以快速开始使用 SDK。


✅ 运行测试

# 安装开发依赖
uv sync --group dev

# 运行测试
uv run pytest

🫡 致敬

Project details


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.0.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.0-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xiaozhi_sdk-0.5.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for xiaozhi_sdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 c5dfc2e8ec4af29efac67c2372ff277d761a09d65b424a8a5e429ccaabc34ace
MD5 aafd07254b4b4424b7d435247356ba9b
BLAKE2b-256 d40a5fd8592831bd4cbc29fafcec0a990669b81294a0e31ba1191c9f2ccf83e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xiaozhi_sdk-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for xiaozhi_sdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 230bde0f2eea702458b6ff325737b83f02791fafad27cc6fc256c1e91154d405
MD5 19e034ca3895098da47a1bf8009a494c
BLAKE2b-256 167ab71ae7868daed5003a522876158af18e2b861bba15241947a2f2a32be02e

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 Pingdom Monitoring Sentry Error logging StatusPage Status page