Find answers from the community

Updated 3 months ago

Async

Getting this error when trying to call async qdrant search - right from the tutorial page

Plain Text
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[24], line 9
      7 store = QdrantVectorStore(client=qdrant_client, collection_name="test", prefer_grpc=True)
      8 storage_context = StorageContext.from_defaults(vector_store=store)
----> 9 index = VectorStoreIndex.from_documents(
     10     documents,
     11     storage_context=storage_context,
     12     use_async=True
     13 )
     14 # index = VectorStoreIndex.from_vector_store(store)
     15 print(index)

File c:\Users\tinbu\miniconda3\envs\py311\Lib\site-packages\llama_index\core\indices\base.py:142, in BaseIndex.from_documents(cls, documents, storage_context, show_progress, callback_manager, transformations, service_context, **kwargs)
    133     docstore.set_document_hash(doc.get_doc_id(), doc.hash)
    135 nodes = run_transformations(
    136     documents,  # type: ignore
    137     transformations,
    138     show_progress=show_progress,
    139     **kwargs,
    140 )
--> 142 return cls(
    143     nodes=nodes,
    144     storage_context=storage_context,
    145     callback_manager=callback_manager,
...
--> 431     await self._aclient.get_collection(collection_name)
    432 except (RpcError, UnexpectedResponse, ValueError):
    433     return False

AttributeError: 'NoneType' object has no attribute 'get_collection'
L
T
3 comments
If you are using sync methods, you need to provide both the sync and async client
Here it's failing because there's no sync client when calling a sync method πŸ‘
got it to work fam, ty
Add a reply
Sign up and join the conversation on Discord