临时提交

This commit is contained in:
2025-09-11 19:33:21 +08:00
parent 9775b1a063
commit a3019ffee4
4 changed files with 38 additions and 26 deletions

47
.idea/workspace.xml generated
View File

@@ -46,29 +46,30 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;, "ASKED_ADD_EXTERNAL_FILES": "true",
&quot;Python.123.executor&quot;: &quot;Run&quot;, "Python.12.executor": "Run",
&quot;Python.Main.executor&quot;: &quot;Run&quot;, "Python.123.executor": "Run",
&quot;Python.tidevice_entry.executor&quot;: &quot;Run&quot;, "Python.Main.executor": "Run",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "Python.tidevice_entry.executor": "Run",
&quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252&quot;: &quot;true&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;, "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;, "RunOnceActivity.git.unshallow": "true",
&quot;git-widget-placeholder&quot;: &quot;main&quot;, "SHARE_PROJECT_CONFIGURATION_FILES": "true",
&quot;javascript.nodejs.core.library.configured.version&quot;: &quot;20.17.0&quot;, "git-widget-placeholder": "main",
&quot;javascript.nodejs.core.library.typings.version&quot;: &quot;20.17.58&quot;, "javascript.nodejs.core.library.configured.version": "20.17.0",
&quot;last_opened_file_path&quot;: &quot;F:/company code/AI item/20250820/iOSAI&quot;, "javascript.nodejs.core.library.typings.version": "20.17.58",
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;, "last_opened_file_path": "F:/company code/AI item/20250820/iOSAI",
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;, "node.js.detected.package.eslint": "true",
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;, "node.js.detected.package.tslint": "true",
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.eslint": "(autodetect)",
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;, "node.js.selected.package.tslint": "(autodetect)",
&quot;settings.editor.selected.configurable&quot;: &quot;com.gitee.ui.GiteeSettingsConfigurable&quot;, "nodejs_package_manager_path": "npm",
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot; "settings.editor.selected.configurable": "preferences.editor.code.editing",
"vue.rearranger.settings.migration": "true"
} }
}</component> }]]></component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="E:\Code\python\iOSAI\resources" /> <recent name="E:\Code\python\iOSAI\resources" />
@@ -90,7 +91,7 @@
<visibility group="运行配置" flag="true" /> <visibility group="运行配置" flag="true" />
</myKeys> </myKeys>
</component> </component>
<component name="RunManager" selected="Python.12"> <component name="RunManager" selected="Python.Main">
<configuration name="12" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <configuration name="12" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="iOSAI" /> <module name="iOSAI" />
<option name="ENV_FILES" value="" /> <option name="ENV_FILES" value="" />

View File

@@ -19,6 +19,7 @@ from Utils.ThreadManager import ThreadManager
from script.ScriptManager import ScriptManager from script.ScriptManager import ScriptManager
from Entity.Variables import anchorList, prologueList, addModelToAnchorList, removeModelFromAnchorList from Entity.Variables import anchorList, prologueList, addModelToAnchorList, removeModelFromAnchorList
import Entity.Variables as ev import Entity.Variables as ev
from Utils.JsonUtils import JsonUtils
app = Flask(__name__) app = Flask(__name__)
CORS(app) CORS(app)
@@ -380,9 +381,7 @@ def aiConfig():
"contact": contact "contact": contact
} }
jsonData = json.dumps(dict) JsonUtils.write_json("aiConfig", dict)
print(jsonData)
return ResultData(data="").toJson() return ResultData(data="").toJson()
if __name__ == '__main__': if __name__ == '__main__':

View File

@@ -1,5 +1,6 @@
import requests import requests
from Entity.Variables import prologueList from Entity.Variables import prologueList
from Utils.JsonUtils import JsonUtils
from Utils.LogManager import LogManager from Utils.LogManager import LogManager
BaseUrl = "https://crawlclient.api.yolozs.com/api/common/" BaseUrl = "https://crawlclient.api.yolozs.com/api/common/"
@@ -44,6 +45,11 @@ class Requester():
# ai聊天 # ai聊天
@classmethod @classmethod
def chatToAi(cls, param): 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: try:
url = "https://ai.yolozs.com/chat" url = "https://ai.yolozs.com/chat"
result = requests.request(url=url, json=param, method="POST") result = requests.request(url=url, json=param, method="POST")

6
data/aiConfig.json Normal file
View File

@@ -0,0 +1,6 @@
{
"agentName": "小花",
"guildName": "牛逼工会",
"contactTool": "line",
"contact": "7788990"
}