diff --git a/libs/langchain/langchain/vectorstores/vectara.py b/libs/langchain/langchain/vectorstores/vectara.py index cb390780a7a..ed3ffedf66d 100644 --- a/libs/langchain/langchain/vectorstores/vectara.py +++ b/libs/langchain/langchain/vectorstores/vectara.py @@ -39,6 +39,7 @@ class Vectara(VectorStore): vectara_corpus_id: Optional[str] = None, vectara_api_key: Optional[str] = None, vectara_api_timeout: int = 60, + source: Optional[str] = "langchain", ): """Initialize with Vectara API.""" self._vectara_customer_id = vectara_customer_id or os.environ.get( @@ -59,6 +60,8 @@ class Vectara(VectorStore): ) else: logger.debug(f"Using corpus id {self._vectara_corpus_id}") + self._source = source + self._session = requests.Session() # to reuse connections adapter = requests.adapters.HTTPAdapter(max_retries=3) self._session.mount("http://", adapter) @@ -74,7 +77,7 @@ class Vectara(VectorStore): "x-api-key": self._vectara_api_key, "customer-id": self._vectara_customer_id, "Content-Type": "application/json", - "X-Source": "langchain", + "X-Source": self._source, } def _delete_doc(self, doc_id: str) -> bool: