Skip to content

Commit

Permalink
Merge pull request #177 from GoogleCloudPlatform/@invertase/add-filte…
Browse files Browse the repository at this point in the history
…r-params-GL

feat(firestore-palm-gen-text): add config params for filters
  • Loading branch information
cabljac authored Aug 31, 2023
2 parents 9d599b8 + 7a09c0b commit f42aaf3
Show file tree
Hide file tree
Showing 8 changed files with 3,069 additions and 1,764 deletions.
14 changes: 14 additions & 0 deletions firestore-palm-gen-text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ Additionally, this extension uses the PaLM API, which is currently in public pre

* Maximum number of tokens: If you have selected the Vertex AI service as your PaLM API provider, this parameter will be used to set the max_tokens parameter in the Vertex API request. It should be an integer in the range [1,1024]. The default value for the extension is 100.

* Derogatory Content Threshold: Threshold for derogatory content. Specify what level of derogatory content is blocked by the PaLM provider. This threshold is applicable only to the Generative Language PaLM API.

* Toxicity Threshold: Threshold for toxic content. Specify what level of toxic content is blocked by the PaLM provider. This threshold is applicable only to the Generative Language PaLM API.

* Sexual Content Threshold: Threshold for sexual content. Specify what level of sexual content is blocked by the PaLM provider. This threshold is applicable only to the Generative Language PaLM API.

* Violent Content Threshold: Threshold for violent content. Specify what level of violent content is blocked by the PaLM provider. This threshold is applicable only to the Generative Language PaLM API.

* Medical Content Threshold: Threshold for medical content. Specify what level of medical content is blocked by the PaLM provider. This threshold is applicable only to the Generative Language PaLM API.

* Dangerous Content Threshold: Threshold for dangerous content. Specify what level of dangerous content is blocked by the PaLM provider. This threshold is applicable only to the Generative Language PaLM API.

* Unspecified Harm Threshold: Threshold for non-specific harmful content. Specify what level of non-specific harmful content is blocked by the PaLM provider. This threshold is applicable only to the Generative Language PaLM API.



**Cloud Functions:**
Expand Down
133 changes: 133 additions & 0 deletions firestore-palm-gen-text/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,136 @@ params:
required: false
default: 100
immutable: false

- param: DEROGATORY_THRESHOLD
label: Derogatory Content Threshold
description: >-
Threshold for derogatory content. Specify what level of derogatory content is blocked by the PaLM provider.
This threshold is applicable only to the Generative Language PaLM API.
type: select
options:
- label: Harm block threshold unspecified
value: HARM_BLOCK_THRESHOLD_UNSPECIFIED
- label: Block low and above
value: BLOCK_LOW_AND_ABOVE
- label: Block medium and above
value: BLOCK_MEDIUM_AND_ABOVE
- label: Block only high
value: BLOCK_ONLY_HIGH
required: false
default: BLOCK_ONLY_HIGH
immutable: false

- param: TOXICITY_THRESHOLD
label: Toxicity Threshold
description: >-
Threshold for toxic content. Specify what level of toxic content is blocked by the PaLM provider.
This threshold is applicable only to the Generative Language PaLM API.
type: select
options:
- label: Harm block threshold unspecified
value: HARM_BLOCK_THRESHOLD_UNSPECIFIED
- label: Block low and above
value: BLOCK_LOW_AND_ABOVE
- label: Block medium and above
value: BLOCK_MEDIUM_AND_ABOVE
- label: Block only high
value: BLOCK_ONLY_HIGH
required: false
default: BLOCK_ONLY_HIGH
immutable: false

- param: SEXUAL_THRESHOLD
label: Sexual Content Threshold
description: >-
Threshold for sexual content. Specify what level of sexual content is blocked by the PaLM provider.
This threshold is applicable only to the Generative Language PaLM API.
type: select
options:
- label: Harm block threshold unspecified
value: HARM_BLOCK_THRESHOLD_UNSPECIFIED
- label: Block low and above
value: BLOCK_LOW_AND_ABOVE
- label: Block medium and above
value: BLOCK_MEDIUM_AND_ABOVE
- label: Block only high
value: BLOCK_ONLY_HIGH
required: false
default: BLOCK_ONLY_HIGH
immutable: false

- param: VIOLENCE_THRESHOLD
label: Violent Content Threshold
description: >-
Threshold for violent content. Specify what level of violent content is blocked by the PaLM provider.
This threshold is applicable only to the Generative Language PaLM API.
type: select
options:
- label: Harm block threshold unspecified
value: HARM_BLOCK_THRESHOLD_UNSPECIFIED
- label: Block low and above
value: BLOCK_LOW_AND_ABOVE
- label: Block medium and above
value: BLOCK_MEDIUM_AND_ABOVE
- label: Block only high
value: BLOCK_ONLY_HIGH
required: false
default: BLOCK_ONLY_HIGH
immutable: false

- param: MEDICAL_THRESHOLD
label: Medical Content Threshold
description: >-
Threshold for medical content. Specify what level of medical content is blocked by the PaLM provider.
This threshold is applicable only to the Generative Language PaLM API.
type: select
options:
- label: Harm block threshold unspecified
value: HARM_BLOCK_THRESHOLD_UNSPECIFIED
- label: Block low and above
value: BLOCK_LOW_AND_ABOVE
- label: Block medium and above
value: BLOCK_MEDIUM_AND_ABOVE
- label: Block only high
value: BLOCK_ONLY_HIGH
required: false
default: BLOCK_ONLY_HIGH
immutable: false

- param: DANGEROUS_THRESHOLD
label: Dangerous Content Threshold
description: >-
Threshold for dangerous content. Specify what level of dangerous content is blocked by the PaLM provider.
This threshold is applicable only to the Generative Language PaLM API.
type: select
options:
- label: Harm block threshold unspecified
value: HARM_BLOCK_THRESHOLD_UNSPECIFIED
- label: Block low and above
value: BLOCK_LOW_AND_ABOVE
- label: Block medium and above
value: BLOCK_MEDIUM_AND_ABOVE
- label: Block only high
value: BLOCK_ONLY_HIGH
required: false
default: BLOCK_ONLY_HIGH
immutable: false

- param: UNSPECIFIED_THRESHOLD
label: Unspecified Harm Threshold
description: >-
Threshold for non-specific harmful content. Specify what level of non-specific harmful content is blocked by the PaLM provider.
This threshold is applicable only to the Generative Language PaLM API.
type: select
options:
- label: Harm block threshold unspecified
value: HARM_BLOCK_THRESHOLD_UNSPECIFIED
- label: Block low and above
value: BLOCK_LOW_AND_ABOVE
- label: Block medium and above
value: BLOCK_MEDIUM_AND_ABOVE
- label: Block only high
value: BLOCK_ONLY_HIGH
required: false
default: BLOCK_ONLY_HIGH
immutable: false
Loading

0 comments on commit f42aaf3

Please sign in to comment.