Skip to content

Commit 2d1795a

Browse files
committed
update deprecated retrival to create_retrieval_chain
1 parent 9fec08e commit 2d1795a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ask-bedrock-with-rag.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,11 @@ def main():
9696
response = retrieval_chain.invoke({"input": question})
9797

9898
print("")
99-
logger.info("These are the similar documents from OpenSearch based on the provided query")
99+
logger.info("These are the similar documents from OpenSearch based on the provided query:")
100100
source_documents = response.get('context')
101101
for d in source_documents:
102102
print("")
103-
# logger.info(f"With the following similar content from OpenSearch:\n{d.page_content}\n")
104-
logger.info(f"Text: {d.metadata['text']}")
103+
logger.info(f"Text: {d.page_content}")
105104

106105
print("")
107106
logger.info(f"The answer from Bedrock {bedrock_model_id} is: {response.get('answer')}")

0 commit comments

Comments
 (0)