Skip to content

Commit

Permalink
Merge pull request #136 from ccoder64/main
Browse files Browse the repository at this point in the history
add safetySettings, set block_none
  • Loading branch information
babaohuang authored Jan 30, 2024
2 parents e5fff5a + 3d3447c commit 1d044a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/openAI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export const startChatAndSendMessageStream = async(history: ChatMessage[], newMe
generationConfig: {
maxOutputTokens: 8000,
},
safetySettings: [
{category: 'HARM_CATEGORY_HARASSMENT', threshold: 'BLOCK_NONE'},

Check failure on line 22 in src/utils/openAI.ts

View workflow job for this annotation

GitHub Actions / lint

A space is required after '{'

Check failure on line 22 in src/utils/openAI.ts

View workflow job for this annotation

GitHub Actions / lint

A space is required before '}'
{category: 'HARM_CATEGORY_HATE_SPEECH', threshold: 'BLOCK_NONE'},

Check failure on line 23 in src/utils/openAI.ts

View workflow job for this annotation

GitHub Actions / lint

A space is required after '{'

Check failure on line 23 in src/utils/openAI.ts

View workflow job for this annotation

GitHub Actions / lint

A space is required before '}'
{category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT', threshold: 'BLOCK_NONE'},

Check failure on line 24 in src/utils/openAI.ts

View workflow job for this annotation

GitHub Actions / lint

A space is required after '{'

Check failure on line 24 in src/utils/openAI.ts

View workflow job for this annotation

GitHub Actions / lint

A space is required before '}'
{category: 'HARM_CATEGORY_DANGEROUS_CONTENT', threshold: 'BLOCK_NONE'}

Check failure on line 25 in src/utils/openAI.ts

View workflow job for this annotation

GitHub Actions / lint

A space is required after '{'

Check failure on line 25 in src/utils/openAI.ts

View workflow job for this annotation

GitHub Actions / lint

A space is required before '}'
],
})

// Use sendMessageStream for streaming responses
Expand Down

0 comments on commit 1d044a3

Please sign in to comment.