xuzhiyang

Results 2 comments of xuzhiyang

我知道了,有这个错误的应该都是在中国吧。谷歌代码能力不行fetch没用到代理。 也就是说虽然电脑科学上网了,但fetch科学不了。 虽然知道这个问题,但不知道怎么解决,总不能去修改“node_modules/@google/generative-ai/dist/index.js:195”这文件吧,npm install就被覆盖了。 就是要解决GoogleGenerativeAI使用HttpsProxyAgent方法问题。谁解决了告诉我一声[email protected]谢了。 ============= Hello, GoogleGenerativeAI module how to use HttpsProxyAgent? thx.

楼主问题还没解决?下面是**解决方法** **google api:** `const { setGlobalDispatcher, ProxyAgent } = require("undici");` `const dispatcher = new ProxyAgent({ uri: new URL(process.env.https_proxy).toString() });` `//全局fetch调用启用代理` `setGlobalDispatcher(dispatcher);` **随便跟你说下openai的** `const { HttpsProxyAgent } = require('https-proxy-agent');` `const openai...