Closed doggy8088 closed 5 months ago
Yes, this is due to the backwards compatibility with the PaLM 2 models. I'm going to add a region to the enum to make it easier to read. Plus, going to add it to the Xmldoc of each value.
Thanks for your time to point it out. Really appreciate it.
The default safety settings are the ones used when you pass null
or don't specify them at all.
I added Obsolete
attribute to the PaLM2 values. That should help to clear context and usage a bit.
New version 0.9.1 should make it clearer.
Plus, there is the official documentation about Safety settings in Gemini that apply.
default safety settings
Where is the default safety settings
? I didn't see it on your https://github.com/mscraftsman/generative-ai/compare/v0.9.0...v0.9.1
Do you mean you wont send safetySettings
JSON fragment in the request payload?
Yes, it's an optional element of the request. If you don't send the SafetySettings, the API's default settings are used.
Similarly, you can check the default GenerationConfig
values from the model information using the GetModel()
method.
{
"name": "models/gemini-1.0-pro-001",
"version": "001",
"displayName": "Gemini 1.0 Pro 001 (Tuning)",
"description": "The best model for scaling across a wide range of tasks. This is a stable model that supports tuning.",
"inputTokenLimit": 30720,
"outputTokenLimit": 2048,
"supportedGenerationMethods": [
"generateContent",
"countTokens",
"createTunedModel"
],
"temperature": 0.9,
"topP": 1,
"topK": 1
}
In Safety settings doc, there is a section:
In the
HarmCategory
enum, there are much more to choose from.What if I just want to use Gemini API, the coding DX is not that good.
Here is my code snippet. I listed all to my code and commented all options I don't want. This is to avoid someone after me take over my code and someone put it to the list by accident.
It maybe there is a way to make sure someone will not make this mistake. That details should be hidden from the library.
For example, provide a set of default common SafetySetting list for the users? See below:
The
DefaultSafetySettings.BlockOnlyHigh
equals to:I don't have a good idea right now. What do you think?