Find answers from the community

Updated 10 months ago

Hello! I'm having an issue that when

Hello! I'm having an issue that when trying to insert a Document to a QdrantVectorStore with the insert method, I get the error AttributeError: 'NoneType' object has no attribute 'create_collection'
My code looks like this:
Plain Text
documents = [
    Document(
        text="LlamaIndex is a simple, flexible data framework for connecting custom data sources to large language models.",
        metadata={
            "tenant": "llama_index",
        },
    ),
    Document(
        text="Qdrant is a vector database & vector similarity search engine.",
        metadata={
            "tenant": "qdrant",
        },
    ),
]

llm = OpenAI(model="gpt-3.5-turbo", temperature=0)

aclient = AsyncQdrantClient(
    url="localhost",
    port=6333,
    prefer_grpc=True,
)

vector_store = QdrantVectorStore(
    collection_name="multitenant",
    aclient=aclient,
    enable_hybrid=True, 
    batch_size=20,
    prefer_grpc=True
)

qdrant_index = VectorStoreIndex.from_vector_store(
    llm=llm,
    vector_store=vector_store,
    embed_model=FastEmbedEmbedding(
        model_name="BAAI/bge-base-en-v1.5"
    ),
    transformations=[splitter],
    use_async=True,
    show_progress=True,
)

for document in documents:
    # qdrant_index.insert(document)
    await qdrant_index.insert(document)
L
s
2 comments
you'll need to provide both aclient and client

Plain Text
vector_store = QdrantVectorStore(
  aclient=aclient,
  client=client,
  ...
)


I should probably improve the logic for this, but for now, need to pass both
Thank you, with this it worked fine now!
Add a reply
Sign up and join the conversation on Discord