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' } });