20250904-初步功能已完成

This commit is contained in:
2025-09-09 20:45:02 +08:00
parent 71e9bf9045
commit e2e9e0b348
8 changed files with 171 additions and 66 deletions

View File

@@ -1,5 +1,6 @@
import requests
from Entity.Variables import prologueList
from Utils.LogManager import LogManager
BaseUrl = "https://crawlclient.api.yolozs.com/api/common/"
@@ -23,16 +24,19 @@ class Requester():
# 翻译
@classmethod
def translation(cls, msg, country="英国"):
parame = {
"msg": msg,
"country": country,
}
url = "http://ai.zhukeping.com/translation"
result = requests.request(url=url, json=parame, method="POST")
json = result.json()
data = json.get("data")
print(data)
return data
try:
parame = {
"msg": msg,
"country": country,
}
url = "http://ai.zhukeping.com/translation"
result = requests.request(url=url, json=parame, method="POST")
json = result.json()
data = json.get("data")
print(data)
return data
except Exception as e:
LogManager.method_error(f"翻译失败,报错的原因:{e}","翻译失败")
# ai聊天
@classmethod