Skip to content

Commit

Permalink
Block none
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnygunawan committed Feb 1, 2024
1 parent 14c409d commit e164662
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion BotNet.Services/Gemini/GeminiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ ILogger<GeminiClient> logger
public async Task<string> ChatAsync(IEnumerable<Content> messages, int maxTokens, CancellationToken cancellationToken) {
GeminiRequest geminiRequest = new(
Contents: messages.ToImmutableList(),
SafetySettings: null,
SafetySettings: [
new SafetySettings("HARM_CATEGORY_HARASSMENT", "BLOCK_NONE"),
new SafetySettings("HARM_CATEGORY_HATE_SPEECH", "BLOCK_NONE"),
new SafetySettings("HARM_CATEGORY_SEXUALLY_EXPLICIT", "BLOCK_NONE"),
new SafetySettings("HARM_CATEGORY_DANGEROUS_CONTENT", "BLOCK_NONE")
],
GenerationConfig: new(
MaxOutputTokens: maxTokens
)
Expand Down

0 comments on commit e164662

Please sign in to comment.