"source" argument in constructor of Vectara (#11454)

Replace this entire comment with:
- **Description:** minor update to constructor to allow for
specification of "source"
  - **Tag maintainer:** @baskaryan
  - **Twitter handle:** @ofermend
pull/11462/head
Ofer Mendelevitch 1 year ago committed by GitHub
parent d9018ae5f1
commit 3c7653bf0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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:

Loading…
Cancel
Save