Skip to content

Commit

Permalink
chore: low the google safety setting to avoid unexpected blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
fredliang44 committed Dec 31, 2023
1 parent a80502f commit 9eaf492
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/client/platforms/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9eaf492

Please sign in to comment.