diff --git a/.gitignore b/.gitignore index a25b34010..d0709f973 100644 --- a/.gitignore +++ b/.gitignore @@ -145,6 +145,7 @@ tmp .history .DS_Store main/xiaozhi-server/data +main/xiaozhi-server/config/assets/wakeup_words.* main/manager-web/node_modules .config.yaml .secrets.yaml diff --git a/README.md b/README.md index b59d9d459..191790bcf 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ - + 控制家电开关 @@ -95,6 +95,11 @@ + + + 播报新闻 + + @@ -185,7 +190,6 @@ server: | LLM | FastgptLLM | fastgpt 接口调用 | 免费/消耗 token | 本地化部署,注意配置提示词需在 Fastgpt 控制台设置 | | LLM | GeminiLLM | gemini 接口调用 | 免费 | [点击申请密钥](https://aistudio.google.com/apikey) | | LLM | CozeLLM | coze 接口调用 | 消耗 token | 需提供 bot_id、user_id 及个人令牌 | -| LLM | Home Assistant | homeassistant语音助手接口调用 | 免费 | 需提供home assistant令牌 | 实际上,任何支持 openai 接口调用的 LLM 均可接入使用。 @@ -370,7 +374,41 @@ VAD: ### 6、我想通过小智控制电灯、空调、远程开关机等操作 💡 -建议:在配置文件中将 `LLM` 设置为 `HomeAssistant`,通过 调用`HomeAssistant`接口实现相关控制。 +本项目,支持以工具调用的方式控制HomeAssistant设备 + +1、首先选择一款支持function call支持的LLM,例如`ChatGLMLLM`。 + +2、在配置文件中,将 `selected_module.Intent` 设置为 `function_call`。 + +3、登录`HomeAssistant`,点击`左下角个人`,切换`安全`导航栏,划到底部`长期访问令牌`生成api_key。 + +在配置文件中,配置好你的home assistant的`devices`(被控制的设备)和`api_key`和`base_url`等信息。例如: + +``` yaml +plugins + home_assistant: + devices: + - 客厅,玩具灯,switch.cuco_cn_460494544_cp1_on_p_2_1 + - 卧室,台灯,switch.iot_cn_831898993_socn1_on_p_2_1 + base_url: http://你的homeassistant地址:8123 + api_key: 你的home assistant api访问令牌 +``` + +最后,允许function_call 插件在配置文件中启用`hass_get_state`(必须)、`hass_set_state`(必须)、`hass_play_music`(不想用ha听音乐可以不启动),例如: + +``` yaml +Intent: + ... + function_call: + type: nointent + functions: + - change_role + - get_weather + - get_news + - hass_get_state + - hass_set_state + - hass_play_music +``` ### 7、更多问题,可联系我们反馈 💬 diff --git a/docs/images/demo0.png b/docs/images/demo0.png new file mode 100644 index 000000000..99592be68 Binary files /dev/null and b/docs/images/demo0.png differ diff --git a/docs/images/demo5.png b/docs/images/demo5.png index 8e03685bf..c6da29976 100644 Binary files a/docs/images/demo5.png and b/docs/images/demo5.png differ diff --git a/main/manager-web/src/components/EditVoiceDialog.vue b/main/manager-web/src/components/EditVoiceDialog.vue new file mode 100644 index 000000000..b7feb78d0 --- /dev/null +++ b/main/manager-web/src/components/EditVoiceDialog.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/main/manager-web/src/components/HeaderBar.vue b/main/manager-web/src/components/HeaderBar.vue index afd1e1bb8..53946ed65 100644 --- a/main/manager-web/src/components/HeaderBar.vue +++ b/main/manager-web/src/components/HeaderBar.vue @@ -8,13 +8,11 @@ 智能体管理 -
- - 控制台 +
+ 用户管理
-
- 设备管理 - +
+ 模型配置
@@ -64,6 +62,12 @@ export default { // 跳转到首页 this.$router.push('/') }, + goUserManagement() { + this.$router.push('/user-management') + }, + goModelConfig() { + this.$router.push('/model-config') + }, // 获取用户信息 fetchUserInfo() { userApi.getUserInfo(({data}) => { @@ -117,18 +121,24 @@ export default { } .equipment-management2 { - width: 87px; - height: 22px; - border-radius: 11px; + width: 82px; + height: 24px; + border-radius: 12px; background: #fff; display: flex; justify-content: center; - font-size: 9px; - font-weight: 400; + font-size: 10px; + font-weight: 500; gap: 7px; color: #3d4566; - margin-left: 2px; + margin-left: 1px; align-items: center; + transition: all 0.3s ease; +} + +.equipment-management2.active-tab { + background: #5778ff !important; + color: #fff !important; } .header { @@ -168,28 +178,4 @@ export default { color: #3d4566; } -.console { - width: 90px; - height: 22px; - border-radius: 11px; - background: radial-gradient(50% 50% at 50% 50%, #fff 0%, #e8f0ff 100%); - display: flex; - align-items: center; - justify-content: center; - font-size: 9px; - color: #979db1; - font-weight: 400; - gap: 7px; - margin-left: 15px; -} - -.el-dropdown-link { - cursor: pointer; - color: #5778ff; -} - -.el-icon-arrow-down { - font-size: 12px; -} - diff --git a/main/manager-web/src/components/ModelEditDialog.vue b/main/manager-web/src/components/ModelEditDialog.vue new file mode 100644 index 000000000..09e5570c5 --- /dev/null +++ b/main/manager-web/src/components/ModelEditDialog.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/main/manager-web/src/components/TtsModel.vue b/main/manager-web/src/components/TtsModel.vue new file mode 100644 index 000000000..92b107ed6 --- /dev/null +++ b/main/manager-web/src/components/TtsModel.vue @@ -0,0 +1,194 @@ + + + + + diff --git a/main/manager-web/src/router/index.js b/main/manager-web/src/router/index.js index d3add00ae..6bc588230 100644 --- a/main/manager-web/src/router/index.js +++ b/main/manager-web/src/router/index.js @@ -39,15 +39,30 @@ const routes = [ return import('../views/register.vue') } }, - // 新增设备管理页面路由 + // 设备管理页面路由 { path: '/device-management', name: 'DeviceManagement', component: function () { return import('../views/DeviceManagement.vue') } + }, + // 添加用户管理路由 + { + path: '/user-management', + name: 'UserManagement', + component: function () { + return import('../views/UserManagement.vue') + } + }, + { + path: '/model-config', + name: 'ModelConfig', + component: function () { + return import('../views/ModelConfig.vue') + } + }, - } ] const router = new VueRouter({ diff --git a/main/manager-web/src/views/DeviceManagement.vue b/main/manager-web/src/views/DeviceManagement.vue index 06c4317c6..03939a283 100644 --- a/main/manager-web/src/views/DeviceManagement.vue +++ b/main/manager-web/src/views/DeviceManagement.vue @@ -9,11 +9,11 @@ - - - - - + + + + +