Skip to content

Commit 9a2487c

Browse files
committed
♻️ refactor: improve code
1 parent d22e92b commit 9a2487c

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

src/app/(backend)/webapi/chat/anthropic/route.ts

-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
import { POST as UniverseRoute } from '../[provider]/route';
22

3-
// due to the Chinese region does not support accessing Google
4-
// we need to use proxy to access it
5-
// refs: https://github.com/google/generative-ai-js/issues/29#issuecomment-1866246513
6-
// if (process.env.HTTP_PROXY_URL) {
7-
// const { setGlobalDispatcher, ProxyAgent } = require('undici');
8-
//
9-
// console.log(process.env.HTTP_PROXY_URL)
10-
// setGlobalDispatcher(new ProxyAgent({ uri: process.env.HTTP_PROXY_URL }));
11-
// }
12-
13-
// but undici only can be used in NodeJS
14-
// so if you want to use with proxy, you need comment the code below
153
export const runtime = 'edge';
164

175
export const preferredRegion = [

src/app/(backend)/webapi/chat/google/route.ts

-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
import { POST as UniverseRoute } from '../[provider]/route';
22

3-
// due to the Chinese region does not support accessing Google
4-
// we need to use proxy to access it
5-
// refs: https://github.com/google/generative-ai-js/issues/29#issuecomment-1866246513
6-
// if (process.env.HTTP_PROXY_URL) {
7-
// const { setGlobalDispatcher, ProxyAgent } = require('undici');
8-
//
9-
// setGlobalDispatcher(new ProxyAgent({ uri: process.env.HTTP_PROXY_URL }));
10-
// }
11-
12-
// but undici only can be used in NodeJS
13-
// so if you want to use with proxy, you need comment the code below
143
export const runtime = 'edge';
154

165
// due to Gemini-1.5-pro is not available in Hong Kong, we need to set the preferred region to exclude "Hong Kong (hkg1)".

0 commit comments

Comments
 (0)