From bd3adf7620609257696adc76a48a94dd2d95b6bf Mon Sep 17 00:00:00 2001
From: Renu Rozera <166179060+rozerarenu@users.noreply.github.com>
Date: Wed, 17 Apr 2024 12:23:54 -0700
Subject: [PATCH] Add changes for bedrock documentation and notebook (#12856)

---
 .../retrievers/bedrock_retriever.ipynb        | 20 +++++++------------
 .../querying/retriever/retrievers.md          |  1 +
 .../pyproject.toml                            |  4 ++--
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/docs/docs/examples/retrievers/bedrock_retriever.ipynb b/docs/docs/examples/retrievers/bedrock_retriever.ipynb
index f1569351e..016e93ef2 100644
--- a/docs/docs/examples/retrievers/bedrock_retriever.ipynb
+++ b/docs/docs/examples/retrievers/bedrock_retriever.ipynb
@@ -6,15 +6,15 @@
    "source": [
     "# Bedrock (Knowledge Bases)\n",
     "\n",
-    "> [Knowledge bases for Amazon Bedrock](https://aws.amazon.com/bedrock/knowledge-bases/) is an Amazon Web Services (AWS) offering which lets you quickly build RAG applications by using your private data to customize FM response.\n",
+    "[Knowledge bases for Amazon Bedrock](https://aws.amazon.com/bedrock/knowledge-bases/) is an Amazon Web Services (AWS) offering which lets you quickly build RAG applications by using your private data to customize FM response.\n",
     "\n",
-    "> Implementing `RAG` requires organizations to perform several cumbersome steps to convert data into embeddings (vectors), store the embeddings in a specialized vector database, and build custom integrations into the database to search and retrieve text relevant to the user’s query. This can be time-consuming and inefficient.\n",
+    "Implementing `RAG` requires organizations to perform several cumbersome steps to convert data into embeddings (vectors), store the embeddings in a specialized vector database, and build custom integrations into the database to search and retrieve text relevant to the user’s query. This can be time-consuming and inefficient.\n",
     "\n",
-    "> With `Knowledge Bases for Amazon Bedrock`, simply point to the location of your data in `Amazon S3`, and `Knowledge Bases for Amazon Bedrock` takes care of the entire ingestion workflow into your vector database. If you do not have an existing vector database, Amazon Bedrock creates an Amazon OpenSearch Serverless vector store for you.\n",
+    "With `Knowledge Bases for Amazon Bedrock`, simply point to the location of your data in `Amazon S3`, and `Knowledge Bases for Amazon Bedrock` takes care of the entire ingestion workflow into your vector database. If you do not have an existing vector database, Amazon Bedrock creates an Amazon OpenSearch Serverless vector store for you.\n",
     "\n",
-    "> Knowledge base can be configured through [AWS Console](https://aws.amazon.com/console/) or by using [AWS SDKs](https://aws.amazon.com/developer/tools/).\n",
+    "Knowledge base can be configured through [AWS Console](https://aws.amazon.com/console/) or by using [AWS SDKs](https://aws.amazon.com/developer/tools/).\n",
     "\n",
-    "> In this notebook, we introduce AmazonKnowledgeBasesRetriever - Amazon Bedrock integration in Llama Index via the Retrieve API to retrieve relevant results for a user query from knowledge bases."
+    "In this notebook, we introduce AmazonKnowledgeBasesRetriever - Amazon Bedrock integration in Llama Index via the Retrieve API to retrieve relevant results for a user query from knowledge bases."
    ]
   },
   {
@@ -31,7 +31,8 @@
    "outputs": [],
    "source": [
     "%pip install --upgrade --quiet  boto3 botocore\n",
-    "%pip install llama-index"
+    "%pip install llama-index\n",
+    "%pip install llama-index-retrievers-bedrock"
    ]
   },
   {
@@ -76,13 +77,6 @@
     "print(retrieved_results[0].get_content())"
    ]
   },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "The Milky Way is a large spiral galaxy, but in the grand scheme of the universe, it's relatively small. The observable universe is estimated to be about 93 billion light-years in diameter. In comparison, the Milky Way galaxy has a diameter of about 100,000 light-years. So, the Milky Way is just a tiny speck within the vastness of the observable universe. Keep in mind, however, that the universe may extend beyond the observable universe, but our ability to observe it is limited by the speed of light and the age of the universe."
-   ]
-  },
   {
    "cell_type": "markdown",
    "metadata": {},
diff --git a/docs/docs/module_guides/querying/retriever/retrievers.md b/docs/docs/module_guides/querying/retriever/retrievers.md
index 3de7794eb..dace94e70 100644
--- a/docs/docs/module_guides/querying/retriever/retrievers.md
+++ b/docs/docs/module_guides/querying/retriever/retrievers.md
@@ -60,6 +60,7 @@ hierarchical retrieval and query decomposition.
 - [Vectara](../../../examples/managed/vectaraDemo.ipynb)
 - [VideoDB](../../../examples/retrievers/videodb_retriever.ipynb)
 - [Zilliz](../../../examples/managed/zcpDemo.ipynb)
+- [Amazon Bedrock](../../../examples/retrievers/bedrock_retriever.ipynb)
 
 ### Other Retrievers
 
diff --git a/llama-index-integrations/retrievers/llama-index-retrievers-bedrock/pyproject.toml b/llama-index-integrations/retrievers/llama-index-retrievers-bedrock/pyproject.toml
index d365e8ee8..b5720f6c5 100644
--- a/llama-index-integrations/retrievers/llama-index-retrievers-bedrock/pyproject.toml
+++ b/llama-index-integrations/retrievers/llama-index-retrievers-bedrock/pyproject.toml
@@ -8,11 +8,11 @@ check-hidden = true
 skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb"
 
 [tool.llamahub]
-contains_example = true
+contains_example = false
 import_path = "llama_index.retrievers.bedrock"
 
 [tool.llamahub.class_authors]
-BedrockRetriever = "AmazonBedrock"
+AmazonKnowledgeBasesRetriever = "llama-index"
 
 [tool.mypy]
 disallow_untyped_defs = true
-- 
GitLab