From 6d36863c0defb8764d45fa49c7040b90787187c3 Mon Sep 17 00:00:00 2001 From: Rubu Jam Date: Tue, 23 Apr 2024 13:11:56 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20=20update=20some=20`gem?= =?UTF-8?q?ini`=20deployment=20restrictions=20(#2149)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Removing Some Restrictions * Update route.ts * update route.ts * Update route.test.ts --- src/app/api/chat/google/route.test.ts | 3 ++- src/app/api/chat/google/route.ts | 22 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/app/api/chat/google/route.test.ts b/src/app/api/chat/google/route.test.ts index c9927bb32ad8..5748cad27bee 100644 --- a/src/app/api/chat/google/route.test.ts +++ b/src/app/api/chat/google/route.test.ts @@ -15,7 +15,8 @@ describe('Configuration tests', () => { }); it('should contain specific regions in preferredRegion', () => { - expect(preferredRegion).not.contain(['hk1']); + expect(preferredRegion).not.contain(['hkg1']); + expect(preferredRegion).not.contain(['dub1']); }); }); diff --git a/src/app/api/chat/google/route.ts b/src/app/api/chat/google/route.ts index 6b75b94ff85b..dc49f3e4d45f 100644 --- a/src/app/api/chat/google/route.ts +++ b/src/app/api/chat/google/route.ts @@ -13,7 +13,25 @@ import { POST as UniverseRoute } from '../[provider]/route'; // so if you want to use with proxy, you need comment the code below export const runtime = 'edge'; -// due to gemini-1.5-pro only can be used in us, so we need to set the preferred region only in US -export const preferredRegion = ['cle1', 'iad1', 'pdx1', 'sfo1']; +// due to Gemini-1.5-pro is not available in Hong Kong and Ireland, we need to set the preferred region to exclude "Hong Kong" or "Ireland". +// refs: https://github.com/lobehub/lobe-chat/pull/2149 +export const preferredRegion = [ + 'icn1', + 'sin1', + 'hnd1', + 'kix1', + 'bom1', + 'cdg1', + 'lhr1', + 'cpt1', + 'pdx1', + 'arn1', + 'cle1', + 'syd1', + 'iad1', + 'fra1', + 'sfo1', + 'gru1' +]; export const POST = async (req: Request) => UniverseRoute(req, { params: { provider: 'google' } });