From 9eaf492d5b72d252c9dcaa55d5d99dab87bf19e0 Mon Sep 17 00:00:00 2001 From: Fred Liang Date: Sun, 31 Dec 2023 19:44:51 +0800 Subject: [PATCH] chore: low the google safety setting to avoid unexpected blocking --- app/client/platforms/google.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/client/platforms/google.ts b/app/client/platforms/google.ts index 1dfcb660d3b..f0f63659f2b 100644 --- a/app/client/platforms/google.ts +++ b/app/client/platforms/google.ts @@ -59,6 +59,24 @@ export class GeminiProApi implements LLMApi { topP: modelConfig.top_p, // "topK": modelConfig.top_k, }, + safetySettings: [ + { + category: "HARM_CATEGORY_HARASSMENT", + threshold: "BLOCK_ONLY_HIGH", + }, + { + category: "HARM_CATEGORY_HATE_SPEECH", + threshold: "BLOCK_ONLY_HIGH", + }, + { + category: "HARM_CATEGORY_SEXUALLY_EXPLICIT", + threshold: "BLOCK_ONLY_HIGH", + }, + { + category: "HARM_CATEGORY_DANGEROUS_CONTENT", + threshold: "BLOCK_ONLY_HIGH", + }, + ], }; console.log("[Request] google payload: ", requestPayload);