From cf44ac8c1f2537df3cfb40a214b307c58455c6ab Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:04:00 +0300 Subject: [PATCH] Don't add sys instruction if empty --- src/endpoints/backends/chat-completions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js index 934c9d52e..c582a099e 100644 --- a/src/endpoints/backends/chat-completions.js +++ b/src/endpoints/backends/chat-completions.js @@ -433,7 +433,7 @@ async function sendMakerSuiteRequest(request, response) { generationConfig: generationConfig, }; - if (useSystemPrompt) { + if (useSystemPrompt && Array.isArray(prompt.system_instruction) && prompt.system_instruction.length) { body.systemInstruction = prompt.system_instruction; }