mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-21 06:07:13 +08:00
fix: role,dungeon,godcmd support azure bot
This commit is contained in:
@@ -64,7 +64,7 @@ class Dungeon(Plugin):
|
|||||||
if e_context["context"].type != ContextType.TEXT:
|
if e_context["context"].type != ContextType.TEXT:
|
||||||
return
|
return
|
||||||
bottype = Bridge().get_bot_type("chat")
|
bottype = Bridge().get_bot_type("chat")
|
||||||
if bottype not in (const.CHATGPT, const.OPEN_AI):
|
if bottype not in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE]:
|
||||||
return
|
return
|
||||||
bot = Bridge().get_bot("chat")
|
bot = Bridge().get_bot("chat")
|
||||||
content = e_context["context"].content[:]
|
content = e_context["context"].content[:]
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ class Godcmd(Plugin):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
ok, result = False, "你没有设置私有api_key"
|
ok, result = False, "你没有设置私有api_key"
|
||||||
elif cmd == "reset":
|
elif cmd == "reset":
|
||||||
if bottype in (const.CHATGPT, const.OPEN_AI):
|
if bottype in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE]:
|
||||||
bot.sessions.clear_session(session_id)
|
bot.sessions.clear_session(session_id)
|
||||||
channel.cancel_session(session_id)
|
channel.cancel_session(session_id)
|
||||||
ok, result = True, "会话已重置"
|
ok, result = True, "会话已重置"
|
||||||
@@ -288,7 +288,7 @@ class Godcmd(Plugin):
|
|||||||
load_config()
|
load_config()
|
||||||
ok, result = True, "配置已重载"
|
ok, result = True, "配置已重载"
|
||||||
elif cmd == "resetall":
|
elif cmd == "resetall":
|
||||||
if bottype in (const.CHATGPT, const.OPEN_AI):
|
if bottype in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE]:
|
||||||
channel.cancel_all_session()
|
channel.cancel_all_session()
|
||||||
bot.sessions.clear_all_session()
|
bot.sessions.clear_all_session()
|
||||||
ok, result = True, "重置所有会话成功"
|
ok, result = True, "重置所有会话成功"
|
||||||
|
|||||||
@@ -98,8 +98,8 @@ class Role(Plugin):
|
|||||||
def on_handle_context(self, e_context: EventContext):
|
def on_handle_context(self, e_context: EventContext):
|
||||||
if e_context["context"].type != ContextType.TEXT:
|
if e_context["context"].type != ContextType.TEXT:
|
||||||
return
|
return
|
||||||
bottype = Bridge().get_bot_type("chat")
|
btype = Bridge().get_bot_type("chat")
|
||||||
if bottype not in (const.CHATGPT, const.OPEN_AI):
|
if btype not in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE]:
|
||||||
return
|
return
|
||||||
bot = Bridge().get_bot("chat")
|
bot = Bridge().get_bot("chat")
|
||||||
content = e_context["context"].content[:]
|
content = e_context["context"].content[:]
|
||||||
|
|||||||
Reference in New Issue
Block a user