tanlie 1 рік тому
батько
коміт
57a5861292

+ 0 - 1
.gitignore

@@ -7,7 +7,6 @@
 __pycache__/
 venv*
 *.pyc
-config.json
 QR.png
 nohup.out
 tmp

+ 36 - 0
config-gpt-wx.json

@@ -0,0 +1,36 @@
+{
+  "channel_type": "wx",
+  "model": "gpt-4-turbo",
+  "open_ai_api_key": "sk-AxwhQsGyn30WOPil3623EbF30a2e448d8aDb940997Fb889a",
+  "open_ai_api_base": "https://api.pumpkinaigc.online/v1",
+  "text_to_image": "dall-e-2",
+  "voice_to_text": "openai",
+  "text_to_voice": "openai",
+  "proxy": "",
+  "hot_reload": true,
+  "single_chat_prefix": [
+    "小白",
+    "@小白"
+  ],
+  "single_chat_reply_prefix": "",
+  "group_chat_prefix": [
+    ""
+  ],
+  "group_name_white_list": [
+    "ALL_GROUP"
+  ],
+  "image_create_prefix": [
+    "画",",画",",画"
+  ],
+  "speech_recognition": true,
+  "group_speech_recognition": false,
+  "voice_reply_voice": false,
+  "conversation_max_tokens": 2500,
+  "expires_in_seconds": 3600,
+  "character_desc": "你是基于大语言模型的AI智能助手,旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。",
+  "temperature": 0.7,
+  "subscribe_msg": "感谢您的关注!\n这里是AI智能助手,可以自由对话。\n支持语音对话。\n支持图片输入。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持tool、角色扮演和文字冒险等丰富的插件。\n输入{trigger_prefix}#help 查看详细指令。",
+  "use_linkai": false,
+  "linkai_api_key": "",
+  "linkai_app_code": ""
+}

+ 46 - 0
config-wechatcom.json

@@ -0,0 +1,46 @@
+{
+  "channel_type": "wechatcom_app",
+  "wechatcom_corp_id": "ww360c91f6a29cf1a8",
+  "wechatcomapp_port": 9898,
+  "wechatcomapp_agent_id": "1000002",
+  "wechatcomapp_secret": "7j4oL7KPrx1x0N6JuPQ9E9mJUPjqfW9M2XzPgSBiL4w",
+  "wechatcomapp_token": "WgRWsbem",
+  "wechatcomapp_aes_key": "Vf8aOhTj4YWLPoGtyqvR2f2L8zIyP749o6heSWdMtsi",
+  "model": "gpt-4o",
+  "open_ai_api_key": "sk-AxwhQsGyn30WOPil3623EbF30a2e448d8aDb940997Fb889a",
+  "open_ai_api_base": "https://api.pumpkinaigc.online/v1",
+  "text_to_image": "dall-e-3",
+  "voice_to_text": "openai",
+  "text_to_voice": "openai",
+  "proxy": "",
+  "hot_reload": true,
+  "single_chat_prefix": [
+    "小白",
+    "xiaobai",
+    "四百",
+    "400"
+  ],
+  "single_chat_reply_prefix": "",
+  "group_chat_prefix": [
+    "小白",
+    "四百",
+    "400"
+  ],
+  "group_name_white_list": [
+    "ALL_GROUP"
+  ],
+  "image_create_prefix": [
+    "块"
+  ],
+  "speech_recognition": true,
+  "group_speech_recognition": false,
+  "voice_reply_voice": false,
+  "conversation_max_tokens": 2500,
+  "expires_in_seconds": 3600,
+  "character_desc": "你是基于大语言模型的AI智能助手,你的名字叫小白,最擅长文学和推理。旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。",
+  "temperature": 0.4,
+  "subscribe_msg": "感谢您的关注!\n这里是AI智能助手,可以自由对话。\n支持语音对话。\n支持图片输入。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持tool、角色扮演和文字冒险等丰富的插件。\n输入{trigger_prefix}#help 查看详细指令。",
+  "use_linkai": false,
+  "linkai_api_key": "",
+  "linkai_app_code": ""
+}

+ 45 - 0
config.json

@@ -0,0 +1,45 @@
+{
+  "channel_type": "wechatcom_app",
+  "wechatcom_corp_id": "ww360c91f6a29cf1a8",
+  "wechatcomapp_port": 9898,
+  "wechatcomapp_agent_id": "1000002",
+  "wechatcomapp_secret": "7j4oL7KPrx1x0N6JuPQ9E9mJUPjqfW9M2XzPgSBiL4w",
+  "wechatcomapp_token": "WgRWsbem",
+  "wechatcomapp_aes_key": "Vf8aOhTj4YWLPoGtyqvR2f2L8zIyP749o6heSWdMtsi",
+  "model": "moonshot-v1-128k",
+  "moonshot_api_key": "sk-71RyBMlhwTDKC5jABYdYkN0e6QAiFGJ01RW5oAKBTrIKRQGd",
+  "text_to_image": "dall-e-3",
+  "voice_to_text": "openai",
+  "text_to_voice": "openai",
+  "proxy": "",
+  "hot_reload": true,
+  "single_chat_prefix": [
+    "小白",
+    "xiaobai",
+    "四百",
+    "400"
+  ],
+  "single_chat_reply_prefix": "",
+  "group_chat_prefix": [
+    "小白",
+    "四百",
+    "400"
+  ],
+  "group_name_white_list": [
+    "ALL_GROUP"
+  ],
+  "image_create_prefix": [
+    "块"
+  ],
+  "speech_recognition": true,
+  "group_speech_recognition": false,
+  "voice_reply_voice": false,
+  "conversation_max_tokens": 2500,
+  "expires_in_seconds": 3600,
+  "character_desc": "你是基于大语言模型的AI智能助手,你的名字叫小白,最擅长文学和推理。旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。",
+  "temperature": 0.4,
+  "subscribe_msg": "感谢您的关注!\n这里是AI智能助手,可以自由对话。\n支持语音对话。\n支持图片输入。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持tool、角色扮演和文字冒险等丰富的插件。\n输入{trigger_prefix}#help 查看详细指令。",
+  "use_linkai": false,
+  "linkai_api_key": "",
+  "linkai_app_code": ""
+}

+ 3 - 0
plugins/banwords/config.json

@@ -0,0 +1,3 @@
+{
+    "action": "ignore"
+}

+ 4 - 0
plugins/godcmd/config.json

@@ -0,0 +1,4 @@
+{
+    "password": "",
+    "admin_users": []
+}

+ 3 - 0
plugins/keyword/config.json

@@ -0,0 +1,3 @@
+{
+    "keyword": {}
+}

+ 60 - 0
test/wework_test.py

@@ -0,0 +1,60 @@
+import win32clipboard as w
+import win32con
+import win32api
+import win32gui
+import time
+
+
+# 把文字放入剪贴板
+def setText(aString):
+    w.OpenClipboard()
+    w.EmptyClipboard()
+    w.SetClipboardData(win32con.CF_UNICODETEXT, aString)
+    w.CloseClipboard()
+
+
+# 模拟ctrl+V
+def ctrlV():
+    win32api.keybd_event(17, 0, 0, 0)  # 按下ctrl
+    win32api.keybd_event(86, 0, 0, 0)  # 按下V
+    win32api.keybd_event(86, 0, win32con.KEYEVENTF_KEYUP, 0)  # 释放V
+    win32api.keybd_event(17, 0, win32con.KEYEVENTF_KEYUP, 0)  # 释放ctrl
+
+
+# 模拟alt+s
+def altS():
+    win32api.keybd_event(18, 0, 0, 0)
+    win32api.keybd_event(83, 0, 0, 0)
+    win32api.keybd_event(83, 0, win32con.KEYEVENTF_KEYUP, 0)
+    win32api.keybd_event(18, 0, win32con.KEYEVENTF_KEYUP, 0)
+
+
+# 模拟enter
+def enter():
+    win32api.keybd_event(13, 0, 0, 0)
+    win32api.keybd_event(13, 0, win32con.KEYEVENTF_KEYUP, 0)
+
+
+# 模拟鼠标单击
+def click():
+    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
+    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
+
+
+# 移动鼠标的位置
+def movePos(x, y):
+    win32api.SetCursorPos((x, y))
+
+
+if __name__ == "__main__":
+    hwnd = win32gui.FindWindow("WeWorkWindow", '企业微信')  # 返回微信窗口的句柄信息
+    win32gui.ShowWindow(hwnd, win32con.SW_SHOW)  # 激活并显示微信窗口
+    win32gui.MoveWindow(hwnd, 0, 0, 1000, 700, True)  # 将微信窗口移动到指定位置和大小
+    movePos(30, 90)
+    click()
+    movePos(110, 40)
+    click()
+    setText("檀烈")
+    ctrlV()
+    time.sleep(1)  # 等待联系人搜索成功
+    #enter()