From 40543e92b999c189bbd8a4ffec5e4b23ad749f2c Mon Sep 17 00:00:00 2001 From: MoePotato Date: Tue, 14 Jan 2025 22:46:51 +0800 Subject: [PATCH] 1 --- app/client/platforms/google.ts | 37 +++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 14 deletions(-) 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;