Skip to content

Commit

Permalink
fix: Remove Safety Block
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Dec 20, 2023
1 parent 16d1632 commit bda4d8a
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/services/translate/geminipro/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ export async function translate(text, from, to, options = {}) {
};
let body = {
contents: promptList,
safetySettings: [
{
category: 'HARM_CATEGORY_HARASSMENT',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_HATE_SPEECH',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
threshold: 'BLOCK_NONE',
},
],
};

if (stream) {
Expand Down
18 changes: 18 additions & 0 deletions src/services/translate/geminipro_custom/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ export async function translate(text, from, to, options = {}) {
};
let body = {
contents: promptList,
safetySettings: [
{
category: 'HARM_CATEGORY_HARASSMENT',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_HATE_SPEECH',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
threshold: 'BLOCK_NONE',
},
],
};

if (stream) {
Expand Down
18 changes: 18 additions & 0 deletions src/services/translate/geminipro_polish/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ export async function translate(text, from, to, options = {}) {
};
let body = {
contents: promptList,
safetySettings: [
{
category: 'HARM_CATEGORY_HARASSMENT',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_HATE_SPEECH',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
threshold: 'BLOCK_NONE',
},
],
};

if (stream) {
Expand Down
18 changes: 18 additions & 0 deletions src/services/translate/geminipro_summary/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ export async function translate(text, from, to, options = {}) {
};
let body = {
contents: promptList,
safetySettings: [
{
category: 'HARM_CATEGORY_HARASSMENT',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_HATE_SPEECH',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
threshold: 'BLOCK_NONE',
},
{
category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
threshold: 'BLOCK_NONE',
},
],
};

if (stream) {
Expand Down

0 comments on commit bda4d8a

Please sign in to comment.