优化交互,体验更佳
This commit is contained in:
@@ -6,8 +6,7 @@ base-url = "http://192.168.2.240/v1" #Dify API接口base url
|
||||
|
||||
commands = ["ai", "dify", "聊天", "AI"]
|
||||
command-tip = """
|
||||
-----Bot-----
|
||||
💬AI聊天指令:
|
||||
💬AI聊天指令:["ai", "dify", "聊天", "AI"]
|
||||
聊天 请求内容
|
||||
"""
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ from typing import Dict, Any, List, Optional, Tuple
|
||||
|
||||
from wcferry import Wcf
|
||||
|
||||
from message_util import MessageUtil
|
||||
from plugin_common.message_plugin_interface import MessagePluginInterface
|
||||
from plugin_common.plugin_interface import PluginStatus
|
||||
from plugins.stats_collector.decorators import plugin_stats_decorator
|
||||
@@ -61,7 +62,7 @@ class DifyPlugin(MessagePluginInterface):
|
||||
# 保存上下文对象
|
||||
self.wcf = context.get("wcf")
|
||||
self.event_system = context.get("event_system")
|
||||
self.message_util = context.get("message_util")
|
||||
self.message_util: MessageUtil = context.get("message_util")
|
||||
self.gbm = context.get("gbm")
|
||||
|
||||
# 从配置中获取参数
|
||||
@@ -123,6 +124,7 @@ class DifyPlugin(MessagePluginInterface):
|
||||
if roomid and gbm.get_group_permission(roomid, Feature.AI_CAPABILITY) == PermissionStatus.DISABLED:
|
||||
return False, "没有权限"
|
||||
|
||||
self.message_util.send_text_msg("⏳AI 正在加油,请稍候… 😊", (roomid if roomid else sender), sender)
|
||||
# 获取查询内容
|
||||
query = parts[1].strip()
|
||||
|
||||
@@ -375,4 +377,4 @@ class DifyPlugin(MessagePluginInterface):
|
||||
def reset_all_conversations(self) -> None:
|
||||
"""重置所有会话上下文"""
|
||||
self.conversations.clear()
|
||||
self.last_activity.clear()
|
||||
self.last_activity.clear()
|
||||
|
||||
Reference in New Issue
Block a user