/************************************* 项目名称:SiriAI 更新日期:2024-11-20 脚本作者:@Sheepfj 使用声明:⚠️仅供参考,🈲转载与售卖! 脚本说明:利用Siri与圈x的httpbackend功能去调用gpt接口实现问答与AI绘画 使用方法: 1.导入脚本重写:https://raw.githubusercontent.com/SheepFJ/Sheep/refs/heads/main/SiriAI/SiriAiall.js 2.圈x设置开启进入HTTP Backend开启该功能,并设置Backend监听地址:127.0.0.1与端口:9999 3.在HTTP Backend里面右上角点➕填入backend路径及处理请求路径: Backend路径: ^/sheep/(wenti|daan|url)/ 处理请求路径: https://raw.githubusercontent.com/SheepFJ/Sheep/refs/heads/main/SiriAI/SiriAiall.js 4.配置好后重启圈x,引入苹果快捷指令即可使用:https://www.icloud.com/shortcuts/62cecddaaf5c4baf99da63009d80e237 ************************************** [rewrite_local] ^https:\/\/chatme-backend-d5f358e587a4\.herokuapp\.com\/chatme\/api\/v1\/ask\/text url script-response-body https://raw.githubusercontent.com/SheepFJ/Sheep/refs/heads/main/SiriAI/chatPath.js ^https:\/\/chatme-backend-d5f358e587a4\.herokuapp\.com\/chatme\/api\/v1\/ask\/text url script-request-body https://raw.githubusercontent.com/SheepFJ/Sheep/refs/heads/main/SiriAI/chatPath.js ^https:\/\/securetoken\.googleapis\.com\/v1\/token url script-response-body https://raw.githubusercontent.com/SheepFJ/Sheep/refs/heads/main/SiriAI/tokenPath.js ^https:\/\/genie-production-yfvxbm4e6q-uc\.a\.run\.app\/chats\/local\/completions url script-request-header https://raw.githubusercontent.com/SheepFJ/Sheep/refs/heads/main/SiriAI/chatPathrequest.js ^https:\/\/genie-production-yfvxbm4e6q-uc\.a\.run\.app\/chats\/local\/completions url script-response-body https://raw.githubusercontent.com/SheepFJ/Sheep/refs/heads/main/SiriAI/chatPathresponse.js [mitm] hostname = chatme-backend-d5f358e587a4.herokuapp.com,securetoken.googleapis.com,genie-production-yfvxbm4e6q-uc.a.run.app *************************************/ const backendPathUrl = "/sheep/url/"; const basePathWenti = "/sheep/wenti/"; const basePathDaan = "/sheep/daan/"; if ($request && $request.path.startsWith(basePathDaan)) { let baseKey = "combined_content_response"; let index = 0; let latestResponseContent = ""; while (true) { let storageKey = baseKey + (index === 0 ? "" : index); let storedValue = $prefs.valueForKey(storageKey); if (!storedValue) { break; } latestResponseContent = storedValue; index++; } if (latestResponseContent) { $done({ status: "HTTP/1.1 200 OK", headers: { "Content-Type": "text/html; charset=utf-8", "Connection": "Close" }, body: latestResponseContent }); } else { $done({ status: "HTTP/1.1 404 Not Found", headers: { "Content-Type": "application/json; charset=utf-8", "Connection": "Close" }, body: "
没有获取到URL链接(对话功能可用的情况下,可能是服务器压力过大,晚些尝试)
`; $done({ status: "HTTP/1.1 404 Not Found", headers: { "Content-Type": "text/html" }, body: errorContent }); } }else { $done({ status: "HTTP/1.1 404 Not Found", headers: { "Content-Type": "text/html; charset=utf-8", "Connection": "Close" }, body: "