-
Notifications
You must be signed in to change notification settings - Fork 110
Description
Environment details
- Programming language: TypeScript
- OS: macOS
- Language runtime version: Node 20
- Package version: 1.10.0
Steps to reproduce
When using the method
property inside safety settings, we get an error:
Error: method parameter is not supported in Gemini API.
Also, about the default value for this field, the docs are in conflict with each other. One mentions that the default value is probability, but the other says it is severity.


Finally, only 5 categories in HarmCategory
are supported. Mapping all categories (which we were trying to do automatically) results in the following error:
{"error":{"code":400,"message":"* GenerateContentRequest.safety_settings[0]: element predicate failed: $.category in (HarmCategory.HARM_CATEGORY_HATE_SPEECH, HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, HarmCategory.HARM_CATEGORY_HARASSMENT, HarmCategory.HARM_CATEGORY_CIVIC_INTEGRITY)\n","status":"INVALID_ARGUMENT"}}