From 06b90f6a7772551103516a460bb558592f781b31 Mon Sep 17 00:00:00 2001 From: Wentao Lyu <35-wentao.lyu@users.noreply.git.stereye.tech> Date: Sat, 8 Apr 2023 00:14:44 +0800 Subject: [PATCH] feat: add host params to bingAI. [but seems not work in China] --- api/.env.example | 5 +++++ api/app/clients/bingai.js | 1 + 2 files changed, 6 insertions(+) diff --git a/api/.env.example b/api/.env.example index c952ebe491..4fa5a432a1 100644 --- a/api/.env.example +++ b/api/.env.example @@ -41,6 +41,11 @@ OPENAI_KEY= # Leave it and BINGAI_USER_TOKEN blank to disable this endpoint. BINGAI_TOKEN= +# BingAI Host: +# Necessary for some people in different countries, e.g. China (https://cn.bing.com) +# Leave it blank to use default server. +# BINGAI_HOST="https://cn.bing.com" + # BingAI User defined Token # Allow user to set their own token by client # Uncomment this to enable this feature. diff --git a/api/app/clients/bingai.js b/api/app/clients/bingai.js index 015da79069..ca790ec43d 100644 --- a/api/app/clients/bingai.js +++ b/api/app/clients/bingai.js @@ -27,6 +27,7 @@ const askBing = async ({ // cookies: '', debug: false, cache: store, + host: process.env.BINGAI_HOST || null, proxy: process.env.PROXY || null });