AttributeError: ‘Blob’ object has no attribute ‘_prep_and_do_upload’ When I try to perform add_texts() method in the VectorSearchVectorStore object

I’m trying to build a RAG system using a vector search index from GCP services on Python.
I have already created the vector search index and deployed the endpoint. Im using below code:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>from langchain_google_vertexai import (
VectorSearchVectorStore,
VectorSearchVectorStoreDatastore,
)
# TODO : replace 1234567890123456789 with your acutial index ID
my_index = aiplatform.MatchingEngineIndex("1234567890123456789")
# TODO : replace 1234567890123456789 with your acutial endpoint ID
my_index_endpoint = aiplatform.MatchingEngineIndexEndpoint("1234567890123456789")
# Input texts
chunk_texts= [
"The cat sat on",
"the mat.",
"I like to",
"eat pizza for",
"dinner.",
"The sun sets",
"in the west.",
]
# Create a Vector Store
vector_store = VectorSearchVectorStore.from_components(
project_id=PROJECT_ID,
region=REGION,
gcs_bucket_name=BUCKET,
index_id=my_index.name,
endpoint_id=my_index_endpoint.name,
embedding=embedding_model,
stream_update=True,
)
# Add vectors and mapped text chunks to your vectore store
vector_store.add_texts(texts=chunk_texts,is_complete_overwrite=True)
</code>
<code>from langchain_google_vertexai import ( VectorSearchVectorStore, VectorSearchVectorStoreDatastore, ) # TODO : replace 1234567890123456789 with your acutial index ID my_index = aiplatform.MatchingEngineIndex("1234567890123456789") # TODO : replace 1234567890123456789 with your acutial endpoint ID my_index_endpoint = aiplatform.MatchingEngineIndexEndpoint("1234567890123456789") # Input texts chunk_texts= [ "The cat sat on", "the mat.", "I like to", "eat pizza for", "dinner.", "The sun sets", "in the west.", ] # Create a Vector Store vector_store = VectorSearchVectorStore.from_components( project_id=PROJECT_ID, region=REGION, gcs_bucket_name=BUCKET, index_id=my_index.name, endpoint_id=my_index_endpoint.name, embedding=embedding_model, stream_update=True, ) # Add vectors and mapped text chunks to your vectore store vector_store.add_texts(texts=chunk_texts,is_complete_overwrite=True) </code>
from langchain_google_vertexai import (
    VectorSearchVectorStore,
    VectorSearchVectorStoreDatastore,
)
# TODO : replace 1234567890123456789 with your acutial index ID
my_index = aiplatform.MatchingEngineIndex("1234567890123456789")

# TODO : replace 1234567890123456789 with your acutial endpoint ID
my_index_endpoint = aiplatform.MatchingEngineIndexEndpoint("1234567890123456789")

# Input texts
chunk_texts= [
    "The cat sat on",
    "the mat.",
    "I like to",
    "eat pizza for",
    "dinner.",
    "The sun sets",
    "in the west.",
]

# Create a Vector Store
vector_store = VectorSearchVectorStore.from_components(
    project_id=PROJECT_ID,
    region=REGION,
    gcs_bucket_name=BUCKET,
    index_id=my_index.name,
    endpoint_id=my_index_endpoint.name,
    embedding=embedding_model,
    stream_update=True,
)

# Add vectors and mapped text chunks to your vectore store
vector_store.add_texts(texts=chunk_texts,is_complete_overwrite=True)

Full Error:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>AttributeError Traceback (most recent call last)
<ipython-input-22-5aa9b7d77460> in <cell line: 19>()
17
18 # Add vectors and mapped text chunks to your vectore store
---> 19 vector_store.add_texts(texts=text_chunks,is_complete_overwrite=True)
3 frames
/usr/local/lib/python3.10/dist-packages/langchain_google_vertexai/vectorstores/vectorstores.py in add_texts(self, texts, metadatas, is_complete_overwrite, **kwargs)
198 ]
199
--> 200 self._document_storage.mset(list(zip(ids, documents)))
201
202 embeddings = self._embeddings.embed_documents(texts)
/usr/local/lib/python3.10/dist-packages/langchain_google_vertexai/vectorstores/document_storage.py in mset(self, key_value_pairs)
98 # the input list, in order.
99 if isinstance(result, Exception):
--> 100 raise result
101 else:
102 for key, value in key_value_pairs:
/usr/lib/python3.10/concurrent/futures/thread.py in run(self)
56
57 try:
---> 58 result = self.fn(*self.args, **self.kwargs)
59 except BaseException as exc:
60 self.future.set_exception(exc)
/usr/local/lib/python3.10/dist-packages/google/cloud/storage/transfer_manager.py in _call_method_on_maybe_pickled_blob(maybe_pickled_blob, method_name, *args, **kwargs)
1276 else:
1277 blob = pickle.loads(maybe_pickled_blob)
-> 1278 return getattr(blob, method_name)(*args, **kwargs)
1279
1280
AttributeError: 'Blob' object has no attribute '_prep_and_do_upload'
</code>
<code>AttributeError Traceback (most recent call last) <ipython-input-22-5aa9b7d77460> in <cell line: 19>() 17 18 # Add vectors and mapped text chunks to your vectore store ---> 19 vector_store.add_texts(texts=text_chunks,is_complete_overwrite=True) 3 frames /usr/local/lib/python3.10/dist-packages/langchain_google_vertexai/vectorstores/vectorstores.py in add_texts(self, texts, metadatas, is_complete_overwrite, **kwargs) 198 ] 199 --> 200 self._document_storage.mset(list(zip(ids, documents))) 201 202 embeddings = self._embeddings.embed_documents(texts) /usr/local/lib/python3.10/dist-packages/langchain_google_vertexai/vectorstores/document_storage.py in mset(self, key_value_pairs) 98 # the input list, in order. 99 if isinstance(result, Exception): --> 100 raise result 101 else: 102 for key, value in key_value_pairs: /usr/lib/python3.10/concurrent/futures/thread.py in run(self) 56 57 try: ---> 58 result = self.fn(*self.args, **self.kwargs) 59 except BaseException as exc: 60 self.future.set_exception(exc) /usr/local/lib/python3.10/dist-packages/google/cloud/storage/transfer_manager.py in _call_method_on_maybe_pickled_blob(maybe_pickled_blob, method_name, *args, **kwargs) 1276 else: 1277 blob = pickle.loads(maybe_pickled_blob) -> 1278 return getattr(blob, method_name)(*args, **kwargs) 1279 1280 AttributeError: 'Blob' object has no attribute '_prep_and_do_upload' </code>
AttributeError                            Traceback (most recent call last)

<ipython-input-22-5aa9b7d77460> in <cell line: 19>()
     17 
     18 # Add vectors and mapped text chunks to your vectore store
---> 19 vector_store.add_texts(texts=text_chunks,is_complete_overwrite=True)

3 frames

/usr/local/lib/python3.10/dist-packages/langchain_google_vertexai/vectorstores/vectorstores.py in add_texts(self, texts, metadatas, is_complete_overwrite, **kwargs)
    198         ]
    199 
--> 200         self._document_storage.mset(list(zip(ids, documents)))
    201 
    202         embeddings = self._embeddings.embed_documents(texts)

/usr/local/lib/python3.10/dist-packages/langchain_google_vertexai/vectorstores/document_storage.py in mset(self, key_value_pairs)
     98                 # the input list, in order.
     99                 if isinstance(result, Exception):
--> 100                     raise result
    101         else:
    102             for key, value in key_value_pairs:

/usr/lib/python3.10/concurrent/futures/thread.py in run(self)
     56 
     57         try:
---> 58             result = self.fn(*self.args, **self.kwargs)
     59         except BaseException as exc:
     60             self.future.set_exception(exc)

/usr/local/lib/python3.10/dist-packages/google/cloud/storage/transfer_manager.py in _call_method_on_maybe_pickled_blob(maybe_pickled_blob, method_name, *args, **kwargs)
   1276     else:
   1277         blob = pickle.loads(maybe_pickled_blob)
-> 1278     return getattr(blob, method_name)(*args, **kwargs)
   1279 
   1280 

AttributeError: 'Blob' object has no attribute '_prep_and_do_upload'

langchain_google_vertexai == 1.0.10

The pipeline works when I create a new vector search and deploy a new endpoint, but I encounter an error when attempting to use it from a prebuilt ID.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật