update:优化插件加载的配置提示

This commit is contained in:
hrz 2025-03-15 11:03:47 +08:00
parent d0e3b0407e
commit 7d7bb00d92
4 changed files with 6 additions and 4 deletions

View file

@ -64,8 +64,11 @@ CMD_exit:
- "关闭" - "关闭"
# plugin下的模块,可以通过配置,选择加载哪个模块,加载后对话支持相应的function调用 # plugin下的模块,可以通过配置,选择加载哪个模块,加载后对话支持相应的function调用
# 系统默认已经记载“handle_exit_intent(退出识别)”、“play_music(音乐播放)”插件,请勿重复加载
# 下面是加载查天气、角色切换的插件示例
functions: functions:
- change_role - change_role
- get_weather
# 具体处理时选择的模块(The module selected for specific processing) # 具体处理时选择的模块(The module selected for specific processing)
selected_module: selected_module:

View file

@ -52,7 +52,6 @@ class FunctionHandler:
def register_config_functions(self): def register_config_functions(self):
"""注册配置中的函数,可以不同客户端使用不同的配置""" """注册配置中的函数,可以不同客户端使用不同的配置"""
self.function_registry.register_function("get_weather")
for func in self.config.get("functions", []): for func in self.config.get("functions", []):
self.function_registry.register_function(func) self.function_registry.register_function(func)

View file

@ -66,7 +66,7 @@ class WebSocketServer:
host = server_config["ip"] host = server_config["ip"]
port = server_config["port"] port = server_config["port"]
selected_module = self.config.get("selected_module") selected_module = self.config.get("selected_module")
self.logger.bind(tag=TAG).info(f"selected_module: {selected_module}") self.logger.bind(tag=TAG).info(f"selected_module values: {', '.join(selected_module.values())}")
self.logger.bind(tag=TAG).info("Server is running at ws://{}:{}", get_local_ip(), port) self.logger.bind(tag=TAG).info("Server is running at ws://{}:{}", get_local_ip(), port)
self.logger.bind(tag=TAG).info("=======上面的地址是websocket协议地址,请勿用浏览器访问=======") self.logger.bind(tag=TAG).info("=======上面的地址是websocket协议地址,请勿用浏览器访问=======")

View file

@ -7,7 +7,7 @@ get_weather_function_desc = {
"type": "function", "type": "function",
"function": { "function": {
"name": "get_weather", "name": "get_weather",
"description": "获取某个地点的天气,用户应先提供一个位置,比如用户说杭州天气,参数为:zhejiang/hangzhou,比如用户说北京天气怎么样,参数为:beijing/beijing", "description": "获取某个地点的天气,用户应先提供一个位置,比如用户说杭州天气,参数为:zhejiang/hangzhou,比如用户说北京天气怎么样,参数为:beijing/beijing。如果用户只问天气怎么样,参数是:guangdong/guangzhou",
"parameters": { "parameters": {
"type": "object", "type": "object",
"properties": { "properties": {