From e287e443c9491f39a6ba6f521c6a5a7128f23239 Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Sun, 19 Mar 2023 13:23:17 +0800 Subject: [PATCH] update api menu --- public/locales/en/api.json | 3 ++- public/locales/zh-CN/api.json | 3 ++- public/locales/zh-HK/api.json | 3 ++- src/components/ApiMenu/ApiMenu.tsx | 13 +++++++++++++ src/constants/auth.ts | 5 ++--- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/public/locales/en/api.json b/public/locales/en/api.json index d71e0cf..0f2422f 100644 --- a/public/locales/en/api.json +++ b/public/locales/en/api.json @@ -10,5 +10,6 @@ "howTo": "Get your personal API key <0>here", "inputLabel": "API Key" }, - "customEndpoint": "Use custom API endpoint" + "customEndpoint": "Use custom API endpoint", + "shareGPT": "Checkout <0>ShareGPT, a API key sharing tool that powers https://sharegpt.churchless.tech/share/v1/chat" } diff --git a/public/locales/zh-CN/api.json b/public/locales/zh-CN/api.json index dfe1022..eee4e38 100644 --- a/public/locales/zh-CN/api.json +++ b/public/locales/zh-CN/api.json @@ -10,5 +10,6 @@ "howTo": "在<0>这里获取您的个人 API 密钥", "inputLabel": "API 密钥" }, - "customEndpoint": "使用自定义 API 端点" + "customEndpoint": "使用自定义 API 端点", + "shareGPT": "看看 <0>ShareGPT,一个 API key 共享工具,驱动 https://sharegpt.churchless.tech/share/v1/chat。" } diff --git a/public/locales/zh-HK/api.json b/public/locales/zh-HK/api.json index cc2ab74..224bb4d 100644 --- a/public/locales/zh-HK/api.json +++ b/public/locales/zh-HK/api.json @@ -10,5 +10,6 @@ "howTo": "喺<0>呢度獲取你嘅個人 API 金鑰", "inputLabel": "API 金鑰" }, - "customEndpoint": "使用自訂 API 端點" + "customEndpoint": "使用自訂 API 端點", + "shareGPT": "睇下 ShareGPT,一個 API key 共享工具,驅動 https://sharegpt.churchless.tech/share/v1/chat。" } diff --git a/src/components/ApiMenu/ApiMenu.tsx b/src/components/ApiMenu/ApiMenu.tsx index ba31a14..79ea27d 100644 --- a/src/components/ApiMenu/ApiMenu.tsx +++ b/src/components/ApiMenu/ApiMenu.tsx @@ -146,6 +146,19 @@ const ApiMenu = ({ ]} /> +
+ , + ]} + /> +
); diff --git a/src/constants/auth.ts b/src/constants/auth.ts index 13d889e..ba08a33 100644 --- a/src/constants/auth.ts +++ b/src/constants/auth.ts @@ -1,9 +1,8 @@ -export const defaultAPIEndpoint = - 'https://sharegpt.churchless.tech/share/v1/chat'; +export const defaultAPIEndpoint = 'https://chatgpt-api.shn.hk/v1/'; export const officialAPIEndpoint = 'https://api.openai.com/v1/chat/completions'; export const availableEndpoints = [ - 'https://sharegpt.churchless.tech/share/v1/chat', 'https://chatgpt-api.shn.hk/v1/', + 'https://sharegpt.churchless.tech/share/v1/chat', officialAPIEndpoint, ];