(node:20538) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
warning:65
TypeError: fetch failed
at /Users/me/Code/GeminiProChat/lib/internal/deps/undici/undici.js:12442:11
at process.processTicksAndRejections (/Users/me/Code/GeminiProChat/lib/internal/process/task_queues.js:95:5)
at async makeRequest (/Users/me/Code/GeminiProChat/node_modules/.pnpm/@fuyun+generative-ai@0.1.3/node_modules/@fuyun/generative-ai/dist/index.mjs:194:20)
at async generateContentStream (file:///Users/me/Code/GeminiProChat/node_modules/.pnpm/@fuyun+generative-ai@0.1.3/node_modules/@fuyun/generative-ai/dist/index.mjs:518:22) {stack: 'TypeError: fetch failed
at node:internal/…s/@fuyun/generative-ai/dist/index.mjs:518:22)', message: '[GoogleGenerativeAI Error]: Error fetching f…:streamGenerateContent?alt=sse: fetch failed'}
Participation
[ ] I am willing to submit a pull request for this issue.
How is Gemini Pro Chat deployed?
Vercel
Describe the bug
6天前在Vercel上部署过两个repo并修改了BASE_URL,工作要一切正常,今天sync后所有请求都返回:
[GoogleGenerativeAI Error]: Error fetching from [405 Method Not Allowed]
然后我做了如下测试(提供apikey和api_base_url)请问是不是我配置的有什么问题?我发现我只有把key放进query参数请求streamGenerateContent才能返回正确内容,apikey放进header一直在返回405,但是generate-ai的包里面似乎都是放在header里请求的。 刚刚又试了一下,直接对generativelanguage.googleapis.com发起请求,apikey放在header的x-goog-api-key里面的话,也可以返回正确内容.
Console Logs
(node:20538) [DEP0040] DeprecationWarning: The
punycode
module is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ...
to show where the warning was created) warning:65 TypeError: fetch failed at /Users/me/Code/GeminiProChat/lib/internal/deps/undici/undici.js:12442:11 at process.processTicksAndRejections (/Users/me/Code/GeminiProChat/lib/internal/process/task_queues.js:95:5) at async makeRequest (/Users/me/Code/GeminiProChat/node_modules/.pnpm/@fuyun+generative-ai@0.1.3/node_modules/@fuyun/generative-ai/dist/index.mjs:194:20) at async generateContentStream (file:///Users/me/Code/GeminiProChat/node_modules/.pnpm/@fuyun+generative-ai@0.1.3/node_modules/@fuyun/generative-ai/dist/index.mjs:518:22) {stack: 'TypeError: fetch failed at node:internal/…s/@fuyun/generative-ai/dist/index.mjs:518:22)', message: '[GoogleGenerativeAI Error]: Error fetching f…:streamGenerateContent?alt=sse: fetch failed'}Participation