From f08c46c0446a6947efb6566d1b290cde177bb638 Mon Sep 17 00:00:00 2001 From: Ofer Mendelevitch <ofer@vectara.com> Date: Tue, 3 Oct 2023 16:13:05 -0700 Subject: [PATCH] Vectara - minor update (#7954) --- CONTRIBUTING.md | 11 +++++++++++ docs/community/integrations/managed_indices.md | 4 ++-- llama_index/indices/managed/vectara/base.py | 1 + llama_index/indices/managed/vectara/retriever.py | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b48aa2e5b0..e1739113aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -99,6 +99,17 @@ See [Storage guide](https://gpt-index.readthedocs.io/en/latest/how_to/storage.ht --- +#### Managed Index + +A managed index is used to represent an index that's managed via an API, exposing API calls to index documents and query documents. + +Currently we support the [VectaraIndex](https://github.com/run-llama/llama_index/tree/ca09272af000307762d301c99da46ddc70d3bfd2/llama_index/indices/managed/vectara). +Open to contributions! + +See [Managed Index docs](https://gpt-index.readthedocs.io/en/stable/community/integrations/managed_indices.html) for details. + +--- + #### Vector Stores Our vector store classes store embeddings and support lookup via similarity search. diff --git a/docs/community/integrations/managed_indices.md b/docs/community/integrations/managed_indices.md index 6b418ac328..dce4c382d3 100644 --- a/docs/community/integrations/managed_indices.md +++ b/docs/community/integrations/managed_indices.md @@ -14,8 +14,8 @@ Below we show how to use it. **Vectara Index Construction/Querying** -Use the [Vectara Console](https://console.vectara.com/login) to create a corpus (aka Index), and add an API key for access. -Then put the customer id, corpus id, and API key in your environment as shown below. +First, [sign up](https://vectara.com/integrations/llama_index) and use the Vectara Console to create a corpus (aka Index), and add an API key for access. +Then put the customer id, corpus id, and API key in your environment. Then construct the Vectara Index and query it as follows: diff --git a/llama_index/indices/managed/vectara/base.py b/llama_index/indices/managed/vectara/base.py index 55c3372608..a757fb1d71 100644 --- a/llama_index/indices/managed/vectara/base.py +++ b/llama_index/indices/managed/vectara/base.py @@ -113,6 +113,7 @@ class VectaraIndex(BaseManagedIndex): "x-api-key": self._vectara_api_key, "customer-id": self._vectara_customer_id, "Content-Type": "application/json", + "X-Source": "llama_index", } def _delete_doc(self, doc_id: str) -> bool: diff --git a/llama_index/indices/managed/vectara/retriever.py b/llama_index/indices/managed/vectara/retriever.py index 589084a60a..d35f27c1bb 100644 --- a/llama_index/indices/managed/vectara/retriever.py +++ b/llama_index/indices/managed/vectara/retriever.py @@ -57,6 +57,7 @@ class VectaraRetriever(BaseRetriever): "x-api-key": self._index._vectara_api_key, "customer-id": self._index._vectara_customer_id, "Content-Type": "application/json", + "X-Source": "llama_index", } def _retrieve( -- GitLab