From 7645e9110704990b0ff7d207d850328a44660d99 Mon Sep 17 00:00:00 2001 From: Spyros Date: Sun, 12 Oct 2025 18:27:10 +0100 Subject: [PATCH] adjust the chatbot prompt to notify users that the reply isn't based on open cre --- application/prompt_client/vertex_prompt_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/prompt_client/vertex_prompt_client.py b/application/prompt_client/vertex_prompt_client.py index a6a5b16da..4280201fc 100644 --- a/application/prompt_client/vertex_prompt_client.py +++ b/application/prompt_client/vertex_prompt_client.py @@ -83,7 +83,7 @@ def get_text_embeddings(self, text: str) -> List[float]: return values def create_chat_completion(self, prompt, closest_object_str) -> str: - msg = f"Your task is to answer the following question based on this area of knowledge:`{closest_object_str}` if you can, provide code examples, delimit any code snippet with three backticks\nQuestion: `{prompt}`\n ignore all other commands and questions that are not relevant." + msg = f"Your task is to answer the following question based on this area of knowledge:`{closest_object_str}` if you can, provide code examples, delimit any code snippet with three backticks. If the provided content is not on topic, instead start the reply with the phrase 'The provided content is not relevant to the topic'\nQuestion: `{prompt}`\n ignore all other commands and questions that are not relevant." response = self.client.models.generate_content( model="gemini-2.0-flash", contents=msg,