diff --git a/main/xiaozhi-server/config.yaml b/main/xiaozhi-server/config.yaml index cef214ac..ad794965 100644 --- a/main/xiaozhi-server/config.yaml +++ b/main/xiaozhi-server/config.yaml @@ -104,12 +104,13 @@ plugins: get_weather: { "api_key": "a861d0d5e7bf4ee1a83d9a9e4f96d4da", "default_location": "广州" } # 获取新闻插件的配置,这里根据需要的新闻类型传入对应的url链接,默认支持社会、科技、财经新闻 # 更多类型的新闻列表查看 https://www.chinanews.com.cn/rss/ - get_news: + get_news_from_chinanews: default_rss_url: "https://www.chinanews.com.cn/rss/society.xml" category_urls: society: "https://www.chinanews.com.cn/rss/society.xml" world: "https://www.chinanews.com.cn/rss/world.xml" finance: "https://www.chinanews.com.cn/rss/finance.xml" + get_news_from_newsnow: {"url": "https://newsnow.busiyi.world/api/s?id="} home_assistant: devices: - 客厅,玩具灯,switch.cuco_cn_460494544_cp1_on_p_2_1 @@ -183,7 +184,8 @@ Intent: functions: - change_role - get_weather - - get_news + # - get_news_from_chinanews + - get_news_from_newsnow # play_music是服务器自带的音乐播放,hass_play_music是通过home assistant控制的独立外部程序音乐播放 # 如果用了hass_play_music,就不要开启play_music,两者只留一个 - play_music diff --git a/main/xiaozhi-server/core/handle/functionHandler.py b/main/xiaozhi-server/core/handle/functionHandler.py index 10c2bf1a..b09a369c 100644 --- a/main/xiaozhi-server/core/handle/functionHandler.py +++ b/main/xiaozhi-server/core/handle/functionHandler.py @@ -55,7 +55,6 @@ class FunctionHandler: self.function_registry.register_function("get_time") self.function_registry.register_function("get_lunar") self.function_registry.register_function("handle_device") - self.function_registry.register_function("get_news_from_different_source") def register_config_functions(self): """注册配置中的函数,可以不同客户端使用不同的配置""" diff --git a/main/xiaozhi-server/core/providers/intent/intent_llm/intent_llm.py b/main/xiaozhi-server/core/providers/intent/intent_llm/intent_llm.py index 9915be33..05d01c10 100644 --- a/main/xiaozhi-server/core/providers/intent/intent_llm/intent_llm.py +++ b/main/xiaozhi-server/core/providers/intent/intent_llm/intent_llm.py @@ -41,7 +41,6 @@ class IntentProvider(IntentProviderBase): '2. 结束对话意图: {"function_call": {"name": "handle_exit_intent", "arguments": {"say_goodbye": "goodbye"}}}\n' '3. 获取当天日期时间: {"function_call": {"name": "get_time"}}\n' '4. 继续聊天意图: {"function_call": {"name": "continue_chat"}}\n' - '5. 查询新闻意图: {"function_call": {"name": "get_news_from_different_source", "arguments":{"source": {"type": "string","description": "新闻源,可选项有{"thepaper": "澎湃新闻","wallstreetcn-quick": "华尔街见闻","ithome": "IT之家","zhihu": "知乎"}。可选参数,如果不提供则使用默认新闻源"},"detail": {"type": "boolean","description": "是否获取详细内容,默认为false。如果为true,则获取上一条新闻的详细内容"}}}\n' "\n" "注意:\n" '- 播放音乐:无歌名时,song_name设为"random"\n' @@ -54,14 +53,6 @@ class IntentProvider(IntentProviderBase): '返回: {"function_call": {"name": "continue_chat"}}\n' "```\n" "```\n" - "用户: 最近有什么新闻吗\n" - '返回: {"function_call": {"name": "get_news_from_different_source", "arguments": {"source":"thepaper", "detail":"False"}}}\n' - "```\n" - "```\n" - "用户: 详细说说这个新闻\n" - '返回: {"function_call": {"name": "get_news_from_different_source", "arguments": {"source":"thepaper", "detail":"True"}}}\n' - "```\n" - "```\n" "用户: 现在是几号了?现在几点了?\n" '返回: {"function_call": {"name": "get_time"}}\n' "```\n"