babaohuang / GeminiProChat

Minimal web UI for GeminiPro.
https://geminiprochat.com
MIT License
4.2k stars 12.33k forks source link

add safetySettings, set block_none #136

Closed ccoder64 closed 5 months ago

ccoder64 commented 6 months ago

Description

add safetySettings strategy, fix error

Error: [GoogleGenerativeAI Error]: Text not available. Response was blocked due to SAFETY
    at response.text (file:///usr/src/node_modules/.pnpm/@fuyun+generative-ai@0.1.3/node_modules/@fuyun/generative-ai/dist/index.mjs:259:19)
    at Object.start (file:///usr/src/dist/server/chunks/pages/generate.ts.2a0d54ba.mjs:47:34)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
sendMessageStream() was unsuccessful. Response was blocked due to SAFETY. Inspect response object for details.

test case 【讲个笑话】

Linked Issues

https://github.com/babaohuang/GeminiProChat/issues/130 https://github.com/babaohuang/GeminiProChat/issues/74

Additional context

netlify[bot] commented 6 months ago

Deploy request for heroic-yeot-d77ce3 pending review.

Visit the deploys page to approve it

Name Link
Latest commit 3d3447c408cd81ea69917f620915750c0a4cd3a1
netlify[bot] commented 6 months ago

Deploy request for clinquant-rugelach-6e6c15 pending review.

Visit the deploys page to approve it

Name Link
Latest commit 3d3447c408cd81ea69917f620915750c0a4cd3a1
vercel[bot] commented 6 months ago

@ccoder64 is attempting to deploy a commit to the My Team Team on Vercel.

A member of the Team first needs to authorize it.

babaohuang commented 5 months ago

不好意思,最近事情有点多,现在才看到PR消息,请问您这个加入以后有测试一下看看吗,我之前有尝试过加这些参数,但是报错了

ccoder64 commented 5 months ago

不好意思,最近事情有点多,现在才看到PR消息,请问您这个加入以后有测试一下看看吗,我之前有尝试过加这些参数,但是报错了

嗯,抱歉忘记看了,有验证过可以正常生效