|
|
@@ -20,7 +20,8 @@ wechat.open(smart=True) |
|
|
|
wechat.wait_login() |
|
|
|
rooms = wechat.get_rooms() |
|
|
|
|
|
|
|
nickname = '' |
|
|
|
nickname = wechat.get_self_info()['nickname'] |
|
|
|
master_wxid = config.config['master_wxid'] |
|
|
|
|
|
|
|
indirect_num = 0 |
|
|
|
for indirect_list in rooms: |
|
|
@@ -31,8 +32,6 @@ direct_num = len(wechat.get_contacts()) |
|
|
|
print('直接用户:%d人' % direct_num, '间接用户:%d人' % indirect_num, |
|
|
|
'群聊数量:%d' % len(rooms)) |
|
|
|
|
|
|
|
master_wxid = config.config['master_wxid'] |
|
|
|
|
|
|
|
|
|
|
|
def yuan_1_0(text_prompt): |
|
|
|
model_name = 'yuan' |
|
|
@@ -292,8 +291,8 @@ def on_recv_text_msg(wechat_instance: ntchat.WeChat, message): |
|
|
|
wechat_instance.send_room_at_msg(to_wxid=room_wxid, |
|
|
|
content="{$@} 好哦~请您稍等~!", |
|
|
|
at_list=member) |
|
|
|
style_input = data['msg'].split(' ')[1] |
|
|
|
text_prompt = data["msg"].split(' ')[2] |
|
|
|
style_input = base_prompt.split(' ')[1] |
|
|
|
text_prompt = base_prompt.split(' ')[2] |
|
|
|
|
|
|
|
try: |
|
|
|
file_path = config.config['file_path'] |
|
|
@@ -372,8 +371,7 @@ def on_recv_text_msg(wechat_instance: ntchat.WeChat, message): |
|
|
|
|
|
|
|
elif base_prompt.split(' ')[0] == '源': |
|
|
|
text_prompt = base_prompt.replace('源 ', '') |
|
|
|
response = yuan_1_0(text_prompt=text_prompt, |
|
|
|
from_wxid=from_wxid) |
|
|
|
response = yuan_1_0(text_prompt=text_prompt) |
|
|
|
wechat_instance.send_room_at_msg( |
|
|
|
to_wxid=room_wxid, |
|
|
|
content="{$@} " + "【浪潮源1.0大模型回复】" + '\n' + response, |
|
|
@@ -382,8 +380,7 @@ def on_recv_text_msg(wechat_instance: ntchat.WeChat, message): |
|
|
|
elif base_prompt.split(' ')[0] == '元语': |
|
|
|
|
|
|
|
text_prompt = base_prompt.replace('元语 ', '') |
|
|
|
response = ChatYuan(text_prompt=text_prompt, |
|
|
|
from_wxid=from_wxid) |
|
|
|
response = ChatYuan(text_prompt=text_prompt) |
|
|
|
|
|
|
|
wechat_instance.send_room_at_msg( |
|
|
|
to_wxid=room_wxid, |
|
|
@@ -392,8 +389,7 @@ def on_recv_text_msg(wechat_instance: ntchat.WeChat, message): |
|
|
|
|
|
|
|
elif base_prompt.split(' ')[0] == '盘古': |
|
|
|
text_prompt = base_prompt.replace('盘古 ', '') |
|
|
|
response = ChatPanGu(text_prompt=text_prompt, |
|
|
|
from_wxid=from_wxid) |
|
|
|
response = ChatPanGu(text_prompt=text_prompt) |
|
|
|
|
|
|
|
wechat_instance.send_room_at_msg( |
|
|
|
to_wxid=room_wxid, |
|
|
@@ -401,8 +397,8 @@ def on_recv_text_msg(wechat_instance: ntchat.WeChat, message): |
|
|
|
at_list=member) |
|
|
|
|
|
|
|
else: |
|
|
|
response = ChatPanGu(text_prompt=text_prompt, |
|
|
|
from_wxid=from_wxid) |
|
|
|
text_prompt = base_prompt |
|
|
|
response = ChatPanGu(text_prompt=text_prompt) |
|
|
|
wechat_instance.send_room_at_msg( |
|
|
|
to_wxid=room_wxid, |
|
|
|
content="{$@} " + "【鹏程·盘古对话模型回复】" + '\n' + response, |
|
|
|