ESP-Brookesia Xiaozhi Agent
Overview
brookesia_agent_xiaozhi is a XiaoZhi AI agent implementation for the ESP-Brookesia ecosystem, providing:
- XiaoZhi Platform Integration: Communication with XiaoZhi AI platform based on
esp_xiaozhiSDK - Real-time Voice Interaction: OPUS audio codec support at 16kHz sample rate and 24kbps bitrate
- Rich Event Support: Speaking/listening status changes, agent/user text, emote events
- Manual Listening Control: Manual start/stop listening for Manual chat mode
- Interrupt Speaking: Support for interrupting agent speech
- Unified Lifecycle Management: Unified agent lifecycle management based on
brookesia_agent_managerframework
Features
Supported General Functions
| Function | Description |
|---|---|
InterruptSpeaking |
Interrupt agent speaking |
Supported General Events
| Event | Description |
|---|---|
SpeakingStatusChanged |
Speaking status changed |
ListeningStatusChanged |
Listening status changed |
AgentSpeakingTextGot |
Agent speaking text received |
UserSpeakingTextGot |
User speaking text received |
EmoteGot |
Emote event |
How to Use
Development Environment Requirements
Before using this library, please ensure the following SDK development environment is installed:
- ESP-IDF:
>=5.5,<6
Adding to Project
brookesia_agent_xiaozhi has been uploaded to the Espressif Component Registry. You can add it to your project in the following ways:
-
Using Command Line
Run the following command in your project directory:
idf.py add-dependency "espressif/brookesia_agent_xiaozhi" -
Modify Configuration File
Create or modify the idf_component.yml file in your project directory:
dependencies: espressif/brookesia_agent_xiaozhi: "*"
Kconfig Options
| Option | Description | Default |
|---|---|---|
BROOKESIA_AGENT_XIAOZHI_ENABLE_AUTO_REGISTER |
Enable automatic plugin registration | y |
BROOKESIA_AGENT_XIAOZHI_ENABLE_DEBUG_LOG |
Enable debug logs | n |
BROOKESIA_AGENT_XIAOZHI_GET_HTTP_INFO_INTERVAL_MS |
Activation check interval (ms) | 30000 |
BROOKESIA_AGENT_XIAOZHI_WAKE_WORD |
Wake word | "Hi,ESP" |