From 778e3d7ff256d9baefaaae89b7e85d10fd77e04b Mon Sep 17 00:00:00 2001 From: FloRul Date: Tue, 20 Feb 2024 16:03:57 -0500 Subject: [PATCH] Fix variable name in prepare_document_prompt function --- lambdas/inference/src/index.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lambdas/inference/src/index.py b/lambdas/inference/src/index.py index d4a083d..6545928 100644 --- a/lambdas/inference/src/index.py +++ b/lambdas/inference/src/index.py @@ -36,7 +36,7 @@ def prepare_prompt(query: str, docs: list, history: list): def prepare_document_prompt(docs): if docs: - docs_context = ".\n".join(doc.page_content for doc in docs) + docs_context = ".\n".join(doc[0].page_content for doc in docs) return f"Here is a set of quotes between XML tags to help you answer: {docs_context}." return "I could not find any relevant quotes to help you answer the user's query." @@ -106,8 +106,6 @@ def lambda_handler(event, context): history.add( human_message=query, assistant_message=response, prompt=prompt ) - - print(f"doc :{docs[0]}") result = { "completion": response, "docs": json.dumps(