From 541ed355e019358a2391983387bfd5a217e2ea9f Mon Sep 17 00:00:00 2001 From: liuhuapiaoyuan <278780765@qq.com> Date: Fri, 24 May 2024 19:29:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=96=B0UI=E9=80=82?= =?UTF-8?q?=E9=85=8D=EF=BC=8C=E5=A2=9E=E5=8A=A0ARKOSE=5FPROXY=5FURL?= =?UTF-8?q?=E7=9A=84=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api.go | 1 + arkose/proxyarkose.go | 3 +- backend-api/prompt_library.go | 78 +++++++++---------- config.yaml | 2 +- config/config.go | 35 +++++---- .../template/-wRE4Obkm_QOW7PLn1x21/chat.html | 1 + .../-wRE4Obkm_QOW7PLn1x21/discovery.html | 1 + .../-wRE4Obkm_QOW7PLn1x21/editor.html | 1 + .../template/-wRE4Obkm_QOW7PLn1x21/g.html | 64 +++++++++++++++ .../template/-wRE4Obkm_QOW7PLn1x21/gc.html | 64 +++++++++++++++ .../template/-wRE4Obkm_QOW7PLn1x21/gpts.html | 1 + .../template/-wRE4Obkm_QOW7PLn1x21/mine.html | 1 + .../template/-wRE4Obkm_QOW7PLn1x21/slug.html | 1 + 13 files changed, 195 insertions(+), 58 deletions(-) create mode 100644 resource/template/-wRE4Obkm_QOW7PLn1x21/chat.html create mode 100644 resource/template/-wRE4Obkm_QOW7PLn1x21/discovery.html create mode 100644 resource/template/-wRE4Obkm_QOW7PLn1x21/editor.html create mode 100644 resource/template/-wRE4Obkm_QOW7PLn1x21/g.html create mode 100644 resource/template/-wRE4Obkm_QOW7PLn1x21/gc.html create mode 100644 resource/template/-wRE4Obkm_QOW7PLn1x21/gpts.html create mode 100644 resource/template/-wRE4Obkm_QOW7PLn1x21/mine.html create mode 100644 resource/template/-wRE4Obkm_QOW7PLn1x21/slug.html diff --git a/api/api.go b/api/api.go index 12c6168..4410a2b 100644 --- a/api/api.go +++ b/api/api.go @@ -40,6 +40,7 @@ func init() { group.GET("/auth/logout", Logout) group.GET("/api/auth/session", Session) group.GET("/public-api/conversation_limit", backendapi.ProxyAll) + group.GET("/public-api/gizmos/discovery/recent", backendapi.ProxyAll) group.POST("/api/accounts/data_export", NotFound) // 禁用导出 group.POST("/api/payments/checkout", NotFound) // 禁用支付 diff --git a/arkose/proxyarkose.go b/arkose/proxyarkose.go index 4d576a3..f973a7e 100644 --- a/arkose/proxyarkose.go +++ b/arkose/proxyarkose.go @@ -10,7 +10,7 @@ import ( ) var ( - UpStream = config.CHATPROXY + UpStream = config.ARKOSE_PROXY_URL proxy *httputil.ReverseProxy Remote *url.URL ) @@ -19,6 +19,7 @@ func init() { remote, _ := url.Parse(UpStream) Remote = remote proxy = httputil.NewSingleHostReverseProxy(remote) + } func ProxyArkose(r *ghttp.Request) { diff --git a/backend-api/prompt_library.go b/backend-api/prompt_library.go index 4d54b56..9c484cb 100644 --- a/backend-api/prompt_library.go +++ b/backend-api/prompt_library.go @@ -7,44 +7,44 @@ import ( func Prompt_library(r *ghttp.Request) { - resJson := gjson.New(` - { - "items": [ - { - "id": "195cfe2a3", - "title": "开题报告:", - "description": "一个软件工程的毕业开题报告", - "prompt": "请生成一份软件工程的开题报告,主题聚焦于‘基于云计算的敏捷软件开发流程优化’。报告应包含以下关键部分:\r\n\r\n引言:\r\n\r\n简述软件工程的当前挑战,特别是在敏捷开发领域。\r\n解释云计算在现代软件开发中的作用和潜力。\r\n研究目的和动机:\r\n\r\n明确研究的目的,即如何利用云计算优化敏捷软件开发流程。\r\n讨论此研究对软件工程领域的重要性和潜在贡献。\r\n文献综述:\r\n\r\n回顾相关领域的文献,包括敏捷开发方法、云计算技术及其在软件工程中的应用。\r\n识别并讨论现有研究的空白和限制。\r\n研究问题和假设:\r\n\r\n明确要解决的具体研究问题或要验证的假设。\r\n方法论:\r\n\r\n描述将采用的研究方法,包括数据收集和分析技术。\r\n如有可能,提出初步的研究设计和实施计划。\r\n预期结果:\r\n\r\n预测研究可能得出的结果和发现。\r\n讨论这些结果如何帮助解决敏捷软件开发中的实际问题。\r\n研究的局限性和挑战:\r\n\r\n识别可能影响研究结果的潜在局限性和挑战。\r\n时间表和里程碑:\r\n\r\n提供一个详细的研究时间表,列出重要的里程碑和预期完成日期。\r\n报告的语言应清晰、专业,确保内容全面且逻辑连贯。" - }, - { - "id": "195cfe2a", - "title": "构思概念", - "description": "一个复古风格的街机游戏", - "prompt": "为一个复古风格的街机游戏构思5个概念。" - }, - { - "id": "c25a3687", - "title": "展示一个网站粘性导航的代码片段", - "description": "使用CSS和JavaScript展示一个网站的粘性导航的代码片段", - "prompt": "展示一个网站的粘性导航的CSS和JavaScript代码片段。" - }, - { - "id": "9fa376de", - "title": "推荐一道菜", - "description": "以迎合挑食的约会对象", - "prompt": "我要为一个自称挑食的约会对象烹饪。你能推荐一道易于做的菜吗?" - }, - { - "id": "b1935e1a", - "title": "解释这段代码:", - "description": "\"cat config.yaml | awk NF\"", - "prompt": "解释这个bash命令的作用:\"cat config.yaml | awk NF\"" - } - ], - "total": 4, - "limit": 4, - "offset": 0 -} -`) + resJson := gjson.New(`{ + "items": [ + { + "id": "e3c32040", + "title": "为我创建个人网页", + "description": "先问我 3 个问题", + "oneliner": "为我创建个人网页", + "prompt": "为我创建个人网页,需要全部包含在一个文件中。先就你想知道的内容问我 3 个问题。", + "category": "code" + }, + { + "id": "38034ee7", + "title": "解释超导体", + "description": "就好比我是一个五岁小孩", + "oneliner": "解释超导体", + "prompt": "把我当做五岁小朋友一样,向我解释超导体。", + "category": "teach-or-explain" + }, + { + "id": "f2251c8d", + "title": "给我提供一些主意", + "description": "关于如何处理孩子们的艺术作品", + "oneliner": "如何处理孩子们的艺术作品", + "prompt": "我可以用孩子们的艺术作品做哪五种富有创意的事?我不想把它们扔掉,但也太乱了。", + "category": "idea" + }, + { + "id": "a477416b", + "title": "告诉我一个趣事", + "description": "关于罗马帝国", + "oneliner": "关于罗马帝国的趣事", + "prompt": "随便告诉我一个关于罗马帝国的趣事", + "category": "misc" + } + ], + "total": 4, + "limit": 4, + "offset": 0 + }`) r.Response.WriteJson(resJson) } diff --git a/config.yaml b/config.yaml index 5faf7dc..1f739de 100644 --- a/config.yaml +++ b/config.yaml @@ -59,7 +59,7 @@ CHATPROXY: "https://chat.openai.com" JA3_PROXY: "http://a:b@host.docker.internal:9988" #CHATPROXY: "http://host.docker.internal:7999" #CHATPROXY: "https://chatgpt.ggss.club/gateway" -#ARKOSE_URL: "https://chatgpt.ggss.club/arkose/v2/" +ARKOSE_PROXY_URL: "https://chatgpt1.ggss.club" # 接入网关的authkey AUTHKEY: "maidou" ONLYTOKEN: false diff --git a/config/config.go b/config/config.go index 764f8df..1d93bfb 100644 --- a/config/config.go +++ b/config/config.go @@ -33,19 +33,20 @@ func USERTOKENLOCK(ctx g.Ctx) bool { } var ( - CHATPROXY = "https://chatproxy-dev.closeai.biz" - DefaultModel = "text-davinci-002-render-sha" - FreeModels = garray.NewStrArray() - Ja3Proxy *url.URL // ja3代理 - PlusModels = garray.NewStrArray() - ArkoseUrl = "/v2/" - BuildId = "MCkVH1jJi3yNLkMToVDdU" - CacheBuildId = "MCkVH1jJi3yNLkMToVDdU" - AssetPrefix = "https://oaistatic-cdn.closeai.biz" - PK40 = "35536E1E-65B4-4D96-9D97-6ADB7EFF8147" - ProxyClient *gclient.Client - PK35 = "3D86FBBA-9D22-402A-B512-3420086BA6CC" - envScriptTpl = ` + CHATPROXY = "https://chatproxy-dev.closeai.biz" + DefaultModel = "text-davinci-002-render-sha" + FreeModels = garray.NewStrArray() + Ja3Proxy *url.URL // ja3代理 + PlusModels = garray.NewStrArray() + ArkoseUrl = "/v2/" + ARKOSE_PROXY_URL = "https://chatproxy-dev.closeai.biz" + BuildId = "MCkVH1jJi3yNLkMToVDdU" + CacheBuildId = "MCkVH1jJi3yNLkMToVDdU" + AssetPrefix = "https://oaistatic-cdn.closeai.biz" + PK40 = "35536E1E-65B4-4D96-9D97-6ADB7EFF8147" + ProxyClient *gclient.Client + PK35 = "3D86FBBA-9D22-402A-B512-3420086BA6CC" + envScriptTpl = `
\ No newline at end of file diff --git a/resource/template/-wRE4Obkm_QOW7PLn1x21/discovery.html b/resource/template/-wRE4Obkm_QOW7PLn1x21/discovery.html new file mode 100644 index 0000000..948b99f --- /dev/null +++ b/resource/template/-wRE4Obkm_QOW7PLn1x21/discovery.html @@ -0,0 +1 @@ +{{.envScript}}Explore GPTs
\ No newline at end of file diff --git a/resource/template/-wRE4Obkm_QOW7PLn1x21/editor.html b/resource/template/-wRE4Obkm_QOW7PLn1x21/editor.html new file mode 100644 index 0000000..2db2cd9 --- /dev/null +++ b/resource/template/-wRE4Obkm_QOW7PLn1x21/editor.html @@ -0,0 +1 @@ +{{.envScript}}ChatGPT
\ No newline at end of file diff --git a/resource/template/-wRE4Obkm_QOW7PLn1x21/g.html b/resource/template/-wRE4Obkm_QOW7PLn1x21/g.html new file mode 100644 index 0000000..78b0958 --- /dev/null +++ b/resource/template/-wRE4Obkm_QOW7PLn1x21/g.html @@ -0,0 +1,64 @@ + + + +{{.envScript}} + + + + + +ChatGPT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/resource/template/-wRE4Obkm_QOW7PLn1x21/gc.html b/resource/template/-wRE4Obkm_QOW7PLn1x21/gc.html new file mode 100644 index 0000000..4f4a99c --- /dev/null +++ b/resource/template/-wRE4Obkm_QOW7PLn1x21/gc.html @@ -0,0 +1,64 @@ + + + +{{.envScript}} + + + + + +ChatGPT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/resource/template/-wRE4Obkm_QOW7PLn1x21/gpts.html b/resource/template/-wRE4Obkm_QOW7PLn1x21/gpts.html new file mode 100644 index 0000000..948b99f --- /dev/null +++ b/resource/template/-wRE4Obkm_QOW7PLn1x21/gpts.html @@ -0,0 +1 @@ +{{.envScript}}Explore GPTs
\ No newline at end of file diff --git a/resource/template/-wRE4Obkm_QOW7PLn1x21/mine.html b/resource/template/-wRE4Obkm_QOW7PLn1x21/mine.html new file mode 100644 index 0000000..05c8d2c --- /dev/null +++ b/resource/template/-wRE4Obkm_QOW7PLn1x21/mine.html @@ -0,0 +1 @@ +{{.envScript}}ChatGPT
\ No newline at end of file diff --git a/resource/template/-wRE4Obkm_QOW7PLn1x21/slug.html b/resource/template/-wRE4Obkm_QOW7PLn1x21/slug.html new file mode 100644 index 0000000..ec0c459 --- /dev/null +++ b/resource/template/-wRE4Obkm_QOW7PLn1x21/slug.html @@ -0,0 +1 @@ +{{.envScript}}ChatGPT
\ No newline at end of file