Skip to content

Commit

Permalink
💄 style: update some gemini deployment restrictions (lobehub#2149)
Browse files Browse the repository at this point in the history
* Removing Some Restrictions

* Update route.ts

* update route.ts

* Update route.test.ts
  • Loading branch information
RubuJam committed Apr 23, 2024
1 parent 78a17e7 commit 6d36863
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/app/api/chat/google/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});
});

Expand Down
22 changes: 20 additions & 2 deletions src/app/api/chat/google/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' } });

0 comments on commit 6d36863

Please sign in to comment.