From 9775b1a0630dce22efc22e410da57dd4edeb6af2 Mon Sep 17 00:00:00 2001
From: milk <53408947@qq.com>
Date: Thu, 11 Sep 2025 19:02:00 +0800
Subject: [PATCH 1/3] temp
---
.idea/iOSAI.iml | 2 +-
.idea/misc.xml | 2 +-
.idea/workspace.xml | 3 +--
Module/FlaskService.py | 20 +++++++++++++++++++-
Utils/LogManager.py | 2 +-
5 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/.idea/iOSAI.iml b/.idea/iOSAI.iml
index df5cbff..f571432 100644
--- a/.idea/iOSAI.iml
+++ b/.idea/iOSAI.iml
@@ -2,7 +2,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index c27b771..db8786c 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -3,5 +3,5 @@
-
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8481fb9..3de4e5b 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -170,8 +170,7 @@
-
-
+
diff --git a/Module/FlaskService.py b/Module/FlaskService.py
index bd1c41c..942e7ba 100644
--- a/Module/FlaskService.py
+++ b/Module/FlaskService.py
@@ -357,7 +357,6 @@ def queryAnchorList():
data = []
return ResultData(data=data).toJson()
-
# 删除主播
@app.route("/deleteAnchorWithIds", methods=['POST'])
def deleteAnchorWithIds():
@@ -366,6 +365,25 @@ def deleteAnchorWithIds():
deleted = AiUtils.delete_anchors_by_ids(ids)
return ResultData(data={"deleted": deleted}).toJson()
+@app.route("/aiConfig", methods=['POST'])
+def aiConfig():
+ data = request.get_json()
+ agentName = data.get("agentName")
+ guildName = data.get("guildName")
+ contactTool = data.get("contactTool")
+ contact = data.get("contact")
+
+ dict = {
+ "agentName": agentName,
+ "guildName": guildName,
+ "contactTool": contactTool,
+ "contact": contact
+ }
+
+ jsonData = json.dumps(dict)
+ print(jsonData)
+
+ return ResultData(data="").toJson()
if __name__ == '__main__':
app.run("0.0.0.0", port=5000, debug=True, use_reloader=False)
diff --git a/Utils/LogManager.py b/Utils/LogManager.py
index a39050c..67e8a24 100644
--- a/Utils/LogManager.py
+++ b/Utils/LogManager.py
@@ -240,7 +240,7 @@ def _force_utf8_everywhere():
except Exception:
pass
-_force_utf8_everywhere()
+# _force_utf8_everywhere()
# ========= 全局:强制 UTF-8 + 关闭缓冲(运行期立刻生效) =========
From a3019ffee4067ff0f63e09ae37deae3af50eea83 Mon Sep 17 00:00:00 2001
From: milk <53408947@qq.com>
Date: Thu, 11 Sep 2025 19:33:21 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/workspace.xml | 47 +++++++++++++++++++++---------------------
Module/FlaskService.py | 5 ++---
Utils/Requester.py | 6 ++++++
data/aiConfig.json | 6 ++++++
4 files changed, 38 insertions(+), 26 deletions(-)
create mode 100644 data/aiConfig.json
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 3de4e5b..cea6f89 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -46,29 +46,30 @@
- {
- "keyToString": {
- "ASKED_ADD_EXTERNAL_FILES": "true",
- "Python.123.executor": "Run",
- "Python.Main.executor": "Run",
- "Python.tidevice_entry.executor": "Run",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
- "RunOnceActivity.git.unshallow": "true",
- "SHARE_PROJECT_CONFIGURATION_FILES": "true",
- "git-widget-placeholder": "main",
- "javascript.nodejs.core.library.configured.version": "20.17.0",
- "javascript.nodejs.core.library.typings.version": "20.17.58",
- "last_opened_file_path": "F:/company code/AI item/20250820/iOSAI",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "com.gitee.ui.GiteeSettingsConfigurable",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
@@ -90,7 +91,7 @@
-
+
diff --git a/Module/FlaskService.py b/Module/FlaskService.py
index 942e7ba..73c6c60 100644
--- a/Module/FlaskService.py
+++ b/Module/FlaskService.py
@@ -19,6 +19,7 @@ from Utils.ThreadManager import ThreadManager
from script.ScriptManager import ScriptManager
from Entity.Variables import anchorList, prologueList, addModelToAnchorList, removeModelFromAnchorList
import Entity.Variables as ev
+from Utils.JsonUtils import JsonUtils
app = Flask(__name__)
CORS(app)
@@ -380,9 +381,7 @@ def aiConfig():
"contact": contact
}
- jsonData = json.dumps(dict)
- print(jsonData)
-
+ JsonUtils.write_json("aiConfig", dict)
return ResultData(data="").toJson()
if __name__ == '__main__':
diff --git a/Utils/Requester.py b/Utils/Requester.py
index 6545167..1eead24 100644
--- a/Utils/Requester.py
+++ b/Utils/Requester.py
@@ -1,5 +1,6 @@
import requests
from Entity.Variables import prologueList
+from Utils.JsonUtils import JsonUtils
from Utils.LogManager import LogManager
BaseUrl = "https://crawlclient.api.yolozs.com/api/common/"
@@ -44,6 +45,11 @@ class Requester():
# ai聊天
@classmethod
def chatToAi(cls, param):
+ aiConfig = JsonUtils.read_json("aiConfig")
+ agentName = aiConfig.get("agentName")
+ guildName = aiConfig.get("guildName")
+ contactTool = aiConfig.get("contactTool", "")
+ contact = aiConfig.get("contact", "")
try:
url = "https://ai.yolozs.com/chat"
result = requests.request(url=url, json=param, method="POST")
diff --git a/data/aiConfig.json b/data/aiConfig.json
new file mode 100644
index 0000000..07dd0e9
--- /dev/null
+++ b/data/aiConfig.json
@@ -0,0 +1,6 @@
+{
+ "agentName": "小花",
+ "guildName": "牛逼工会",
+ "contactTool": "line",
+ "contact": "7788990"
+}
\ No newline at end of file
From 2b3fb6871f92e1cda3bf85bed0e4564d935c1f81 Mon Sep 17 00:00:00 2001
From: milk <53408947@qq.com>
Date: Thu, 11 Sep 2025 20:32:08 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=91=E6=B6=88?=
=?UTF-8?q?=E6=81=AF=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/workspace.xml | 51 ++++++++++++++++++++++++---------------------
Utils/Requester.py | 6 ++++++
2 files changed, 33 insertions(+), 24 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index cea6f89..00341f0 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,10 @@
-
+
+
+
+
@@ -46,30 +49,30 @@
- {
+ "keyToString": {
+ "ASKED_ADD_EXTERNAL_FILES": "true",
+ "Python.12.executor": "Run",
+ "Python.123.executor": "Run",
+ "Python.Main.executor": "Run",
+ "Python.tidevice_entry.executor": "Run",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
+ "RunOnceActivity.git.unshallow": "true",
+ "SHARE_PROJECT_CONFIGURATION_FILES": "true",
+ "git-widget-placeholder": "main",
+ "javascript.nodejs.core.library.configured.version": "20.17.0",
+ "javascript.nodejs.core.library.typings.version": "20.17.58",
+ "last_opened_file_path": "F:/company code/AI item/20250820/iOSAI",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "settings.editor.selected.configurable": "preferences.editor.code.editing",
+ "vue.rearranger.settings.migration": "true"
}
-}]]>
+}
diff --git a/Utils/Requester.py b/Utils/Requester.py
index 1eead24..a45dac4 100644
--- a/Utils/Requester.py
+++ b/Utils/Requester.py
@@ -50,6 +50,12 @@ class Requester():
guildName = aiConfig.get("guildName")
contactTool = aiConfig.get("contactTool", "")
contact = aiConfig.get("contact", "")
+
+ param["agentName"] = agentName
+ param["guildName"] = guildName
+ param["contactTool"] = contactTool
+ param["contact"] = contact
+
try:
url = "https://ai.yolozs.com/chat"
result = requests.request(url=url, json=param, method="POST")