diff --git a/client/CustomGoogleGeminiClient.js b/client/CustomGoogleGeminiClient.js index 6db1fc3..fde1d7d 100644 --- a/client/CustomGoogleGeminiClient.js +++ b/client/CustomGoogleGeminiClient.js @@ -184,11 +184,6 @@ export class CustomGoogleGeminiClient extends GoogleGeminiClient { * @type Array */ contents: history, - system_instruction: { - parts: { - text: systemMessage - } - }, safetySettings: [ { category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, @@ -219,6 +214,13 @@ export class CustomGoogleGeminiClient extends GoogleGeminiClient { }, tools: [] } + if (systemMessage) { + body.system_instruction = { + parts: { + text: systemMessage + } + } + } if (this.tools?.length > 0) { body.tools.push({ function_declarations: this.tools.map(tool => tool.function())