Skip to content

Commit

Permalink
Merge pull request #37 from FloRul/feature/api-auth
Browse files Browse the repository at this point in the history
Fix variable name in prepare_document_prompt function
  • Loading branch information
FloRul authored Feb 20, 2024
2 parents b1af77b + 778e3d7 commit c52bb60
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lambdas/inference/src/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <quotes></quotes> XML tags to help you answer: <quotes>{docs_context}</quotes>."
return "I could not find any relevant quotes to help you answer the user's query."

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit c52bb60

Please sign in to comment.