EvanZhouDev / gemini-ai

The simpler JavaScript Gemini SDK
https://www.npmjs.com/package/gemini-ai
GNU General Public License v3.0
95 stars 16 forks source link

What about Safety settings? #8

Closed DisboardTetta closed 4 weeks ago

DisboardTetta commented 3 months ago

How can I set the safety settings, which are described here https://ai.google.dev/docs/safety_setting_gemini? I need this because Gemini mistakenly marks some texts as harassment, although they are just a description of a scene from a book.

EvanZhouDev commented 3 months ago

Hello! Simply give format: Gemini.JSON into the config for (nearly) any Gemini method, and in the output, (which you'll have to filter through yourself 😅) you can find the safety settings.

For the sake of not overcomplicating the library, all of the "advanced" outputs are hidden under Gemini.JSON and not built-in parseable.

EvanZhouDev commented 1 month ago

@DisboardTetta I completely misunderstood this request. I will be sure to add this feature later.

XInTheDark commented 1 month ago

Thank you! This is a really useful feature for me as well :-)

EvanZhouDev commented 4 weeks ago

This has been implemented in Gemini AI v2.2, which is now available on NPM.