From 90a081009d2708d6ea5b82f5bf227e7e73dab9b2 Mon Sep 17 00:00:00 2001 From: Sivasankar Mathiyazhagan Date: Mon, 17 Feb 2025 00:19:36 +0530 Subject: [PATCH] Added FIX for azure content filtering problem --- core/llm/templates/chat.test.ts | 2 +- core/llm/templates/chat.ts | 2 +- core/llm/templates/edit.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/llm/templates/chat.test.ts b/core/llm/templates/chat.test.ts index fbe84c40f..0bbe087ad 100644 --- a/core/llm/templates/chat.test.ts +++ b/core/llm/templates/chat.test.ts @@ -175,7 +175,7 @@ describe.skip("Chat Templates", () => { ]; const prompt = deepseekTemplateMessages(messages); const expectedPrompt = - "You are an AI programming assistant, utilizing the DeepSeek Coder model, developed by DeepSeek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer.\n### Instruction:\nWhat is polymorphism in OOP?\n### Response:\nExplanation of polymorphism.<|EOT|>\n"; + "You are an AI programming assistant, utilizing the DeepSeek Coder model, developed by DeepSeek Company, and your role is to assist with questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will not answer.\n### Instruction:\nWhat is polymorphism in OOP?\n### Response:\nExplanation of polymorphism.<|EOT|>\n"; expect(prompt).toBe(expectedPrompt); }); }); diff --git a/core/llm/templates/chat.ts b/core/llm/templates/chat.ts index a4b999b05..b205f3d3c 100644 --- a/core/llm/templates/chat.ts +++ b/core/llm/templates/chat.ts @@ -156,7 +156,7 @@ function deepseekTemplateMessages(msgs: ChatMessage[]): string { let prompt = ""; let system: string | null = null; prompt += - "You are an AI programming assistant, utilizing the DeepSeek Coder model, developed by DeepSeek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer.\n"; + "You are an AI programming assistant, utilizing the DeepSeek Coder model, developed by DeepSeek Company, and your role is to assist with questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will not answer.\n"; if (msgs[0].role === "system") { system = renderChatMessage(msgs.shift()!); } diff --git a/core/llm/templates/edit.ts b/core/llm/templates/edit.ts index e6ad4d6b6..aa8433fc4 100644 --- a/core/llm/templates/edit.ts +++ b/core/llm/templates/edit.ts @@ -129,7 +129,7 @@ Sure! Here's the code you requested: `; const deepseekEditPrompt = `### System Prompt -You are an AI programming assistant, utilizing the DeepSeek Coder model, developed by DeepSeek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer. +You are an AI programming assistant, utilizing the DeepSeek Coder model, developed by DeepSeek Company, and your role is to assist with questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will not answer. ### Instruction: Rewrite the code to satisfy this request: "{{{userInput}}}"