diff --git a/app/client/platforms/google.ts b/app/client/platforms/google.ts index f9ea54974d8..2cdb2df1a12 100644 --- a/app/client/platforms/google.ts +++ b/app/client/platforms/google.ts @@ -145,24 +145,33 @@ export class GeminiProApi implements LLMApi { const requestPayload = { contents: messages, generationConfig: { - // stopSequences: [ - // "Title" - // ], temperature: modelConfig.temperature, maxOutputTokens: modelConfig.max_tokens, topP: modelConfig.top_p, - // "topK": modelConfig.top_k, }, - test: { - // stopSequences: [ - // "Title" - // ], - temperature: modelConfig.temperature, - maxOutputTokens: modelConfig.max_tokens, - topP: modelConfig.top_p, - // "topK": modelConfig.top_k, - }, - + tools: [ + { + googleSearch: {} + } + ], + safetySettings: [ + { + category: "HARM_CATEGORY_DANGEROUS_CONTENT", + threshold: "BLOCK_NONE" + }, + { + category: "HARM_CATEGORY_HATE_SPEECH", + threshold: "BLOCK_NONE" + }, + { + category: "HARM_CATEGORY_HARASSMENT", + threshold: "BLOCK_NONE" + }, + { + category: "HARM_CATEGORY_SEXUALLY_EXPLICIT", + threshold: "BLOCK_NONE" + } + ] }; let shouldStream = !!options.config.stream;