From 3fcf8248c3c34a13c4a18379a6af938166623569 Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Wed, 2 Oct 2024 10:46:21 -0700 Subject: [PATCH 1/3] Remove block_fewest --- .../vision_models/_vision_models.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/google/generativeai/vision_models/_vision_models.py b/google/generativeai/vision_models/_vision_models.py index 0bb4f7dbe..352ecbf42 100644 --- a/google/generativeai/vision_models/_vision_models.py +++ b/google/generativeai/vision_models/_vision_models.py @@ -104,7 +104,7 @@ def to_mapping_value(value) -> struct_pb2.Struct: OutputMimeType = Literal["image/png", "image/jpeg"] OUTPUT_MIME_TYPES = OutputMimeType.__args__ # type: ignore -SafetyFilterLevel = Literal["block_most", "block_some", "block_few", "block_fewest"] +SafetyFilterLevel = Literal["block_most", "block_some", "block_few"] SAFETY_FILTER_LEVELS = SafetyFilterLevel.__args__ # type: ignore PersonGeneration = Literal["dont_allow", "allow_adult", "allow_all"] @@ -277,14 +277,15 @@ def _generate_images( Japanese, `"ko"` for Korean, and `"auto"` for automatic language detection. safety_filter_level: Adds a filter level to Safety filtering. Supported - values are: * "block_most" : Strongest filtering level, most strict - blocking * "block_some" : Block some problematic prompts and responses - * "block_few" : Block fewer problematic prompts and responses * - "block_fewest" : Block very few problematic prompts and responses + values are: + * "block_most" : Strongest filtering level, most strict blocking + * "block_some" : Block some problematic prompts and responses + * "block_few" : Block fewer problematic prompts and responses person_generation: Allow generation of people by the model Supported - values are: * "dont_allow" : Block generation of people * - "allow_adult" : Generate adults, but not children * "allow_all" : - Generate adults and children + values are: + * "dont_allow" : Block generation of people + * "allow_adult" : Generate adults, but not children + * "allow_all" : Generate adults and children Returns: An `ImageGenerationResponse` object. @@ -408,7 +409,6 @@ def generate_images( blocking * "block_some" : Block some problematic prompts and responses * "block_few" : Block fewer problematic prompts and responses - * "block_fewest" : Block very few problematic prompts and responses person_generation: Allow generation of people by the model Supported values are: * "dont_allow" : Block generation of people From b58308a99f636ddf8fba59da3b7a2c9f4a05a153 Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Wed, 2 Oct 2024 10:54:21 -0700 Subject: [PATCH 2/3] Format. Change-Id: Ib65044811345a97078723bb74092913007f517e6 --- google/generativeai/vision_models/_vision_models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/google/generativeai/vision_models/_vision_models.py b/google/generativeai/vision_models/_vision_models.py index 352ecbf42..c253f84ed 100644 --- a/google/generativeai/vision_models/_vision_models.py +++ b/google/generativeai/vision_models/_vision_models.py @@ -277,14 +277,14 @@ def _generate_images( Japanese, `"ko"` for Korean, and `"auto"` for automatic language detection. safety_filter_level: Adds a filter level to Safety filtering. Supported - values are: - * "block_most" : Strongest filtering level, most strict blocking + values are: + * "block_most" : Strongest filtering level, most strict blocking * "block_some" : Block some problematic prompts and responses * "block_few" : Block fewer problematic prompts and responses person_generation: Allow generation of people by the model Supported - values are: + values are: * "dont_allow" : Block generation of people - * "allow_adult" : Generate adults, but not children + * "allow_adult" : Generate adults, but not children * "allow_all" : Generate adults and children Returns: From d3f71c1276df86734a0d4aa9fd4f8a094ab016e0 Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Wed, 2 Oct 2024 11:12:47 -0700 Subject: [PATCH 3/3] Remove allow_all --- google/generativeai/vision_models/_vision_models.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/google/generativeai/vision_models/_vision_models.py b/google/generativeai/vision_models/_vision_models.py index c253f84ed..2db174d64 100644 --- a/google/generativeai/vision_models/_vision_models.py +++ b/google/generativeai/vision_models/_vision_models.py @@ -107,7 +107,7 @@ def to_mapping_value(value) -> struct_pb2.Struct: SafetyFilterLevel = Literal["block_most", "block_some", "block_few"] SAFETY_FILTER_LEVELS = SafetyFilterLevel.__args__ # type: ignore -PersonGeneration = Literal["dont_allow", "allow_adult", "allow_all"] +PersonGeneration = Literal["dont_allow", "allow_adult"] PERSON_GENERATIONS = PersonGeneration.__args__ # type: ignore @@ -285,7 +285,6 @@ def _generate_images( values are: * "dont_allow" : Block generation of people * "allow_adult" : Generate adults, but not children - * "allow_all" : Generate adults and children Returns: An `ImageGenerationResponse` object. @@ -413,7 +412,6 @@ def generate_images( values are: * "dont_allow" : Block generation of people * "allow_adult" : Generate adults, but not children - * "allow_all" : Generate adults and children Returns: An `ImageGenerationResponse` object. """