mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-03 12:07:36 +00:00
Bagatur/vectara regression (#9276)
Co-authored-by: Ofer Mendelevitch <ofer@vectara.com> Co-authored-by: Ofer Mendelevitch <ofermend@gmail.com>
This commit is contained in:
@@ -117,7 +117,7 @@ class Vectara(VectorStore):
|
||||
|
||||
response = self._session.post(
|
||||
headers=self._get_post_headers(),
|
||||
url="https://api.vectara.io/v1/core/index",
|
||||
url="https://api.vectara.io/v1/index",
|
||||
data=json.dumps(request),
|
||||
timeout=self.vectara_api_timeout,
|
||||
verify=True,
|
||||
@@ -223,11 +223,12 @@ class Vectara(VectorStore):
|
||||
doc = {
|
||||
"document_id": doc_id,
|
||||
"metadataJson": json.dumps(doc_metadata),
|
||||
"parts": [
|
||||
"section": [
|
||||
{"text": text, "metadataJson": json.dumps(md)}
|
||||
for text, md in zip(texts, metadatas)
|
||||
],
|
||||
}
|
||||
|
||||
success_str = self._index_doc(doc)
|
||||
if success_str == "E_ALREADY_EXISTS":
|
||||
self._delete_doc(doc_id)
|
||||
@@ -304,6 +305,7 @@ class Vectara(VectorStore):
|
||||
return []
|
||||
|
||||
result = response.json()
|
||||
|
||||
responses = result["responseSet"][0]["response"]
|
||||
vectara_default_metadata = ["lang", "len", "offset"]
|
||||
docs = [
|
||||
|
Reference in New Issue
Block a user