From 0e64f563787cc93d9d56a3363f38a0827225fbff Mon Sep 17 00:00:00 2001 From: Florian Rumiel Date: Wed, 6 Mar 2024 09:31:49 -0500 Subject: [PATCH] Refactor prepare_prompt function to include user query in final prompt --- lambdas/inference/src/index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lambdas/inference/src/index.py b/lambdas/inference/src/index.py index 5de28e1..85fb4ec 100644 --- a/lambdas/inference/src/index.py +++ b/lambdas/inference/src/index.py @@ -26,16 +26,16 @@ def prepare_prompt(query: str, docs: list, history: list, source: str): - basic_prompt = f'\n\nThe user sent the following message : "{query}".' source_prompt = prepare_source_prompt(source) document_prompt = prepare_document_prompt(docs) history_prompt = prepare_history_prompt(history) - final_prompt = f"""{basic_prompt}\n + final_prompt = f""" {source_prompt}\n {document_prompt}\n {history_prompt}\n {ENV_VARS['system_prompt']}\n + Human:{query}\n \nAssistant:""" return final_prompt