From 5fb49fd22ae8e3e47ebd76844fac2a820867c367 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Fri, 16 May 2025 15:29:36 -0400 Subject: [PATCH] feat(ai): Add `HarmBlockThreshold.OFF` --- common/api-review/ai.api.md | 3 ++- docs-devsite/ai.md | 1 + packages/ai/src/types/enums.ts | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index d096d4c27f6..d24e24e636e 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -518,7 +518,8 @@ export enum HarmBlockThreshold { BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE", BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE", BLOCK_NONE = "BLOCK_NONE", - BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH" + BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH", + OFF = "OFF" } // @public diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index c43c0391ba4..a8e6db38a8d 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -551,6 +551,7 @@ export declare enum HarmBlockThreshold | BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | Content with NEGLIGIBLE and LOW will be allowed. | | BLOCK\_NONE | "BLOCK_NONE" | All content will be allowed. | | BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. | +| OFF | "OFF" | All content will be allowed. This is the same as BLOCK_NONE, but the metadata corresponding to the [HarmCategory](./ai.md#harmcategory) will not be present in the response. | ## HarmCategory diff --git a/packages/ai/src/types/enums.ts b/packages/ai/src/types/enums.ts index 5c6612ce26a..47d654bbcd1 100644 --- a/packages/ai/src/types/enums.ts +++ b/packages/ai/src/types/enums.ts @@ -58,7 +58,12 @@ export enum HarmBlockThreshold { /** * All content will be allowed. */ - BLOCK_NONE = 'BLOCK_NONE' + BLOCK_NONE = 'BLOCK_NONE', + /** + * All content will be allowed. This is the same as `BLOCK_NONE`, but the metadata corresponding + * to the {@link HarmCategory} will not be present in the response. + */ + OFF = 'OFF' } /**