QdrantVectorStore
class in LlamaIndex. This class provides methods for storing and querying vectors in a Qdrant collection.import qdrant_client from llama_index.vector_stores.qdrant import QdrantVectorStore client = qdrant_client.QdrantClient() vector_store = QdrantVectorStore( collection_name="example_collection", client=client )
get_nodes
and aget_nodes
methods are indeed part of the QdrantVectorStore
class in LlamaIndex. These methods are used to retrieve nodes from the index.get_nodes
method:get_nodes(node_ids: Optional[List[str]] = None, filters: Optional[MetadataFilters] = None, limit: Optional[int] = None) -> List[BaseNode]
aget_nodes
method:aget_nodes(node_ids: Optional[List[str]] = None, filters: Optional[MetadataFilters] = None, limit: Optional[int] = None) -> List[BaseNode]
node_ids
: An optional list of node IDs to retrieve.filters
: Optional metadata filters to apply.limit
: An optional limit on the number of nodes to retrieve.get_nodes
method:node_ids = ["node1", "node2", "node3"] nodes = vector_store.get_nodes(node_ids=node_ids)
nodes
will be a list of the nodes with the IDs "node1", "node2", and "node3".get_nodes
method not implemented. This is a common pattern in object-oriented programming where a base class defines a method's signature but leaves the implementation to its subclasses.get_nodes
method is implemented in the QdrantVectorStore
subclass. If you're using QdrantVectorStore
, you should be able to call get_nodes
without seeing a NotImplementedError
.from llama_index.vector_stores.qdrant import QdrantVectorStore # Assuming you have a QdrantVectorStore instance vector_store = QdrantVectorStore(...) # You can then call get_nodes nodes = vector_store.get_nodes(node_ids=["node1", "node2"])
NotImplementedError
, it might be because you're using a different subclass of BasePydanticVectorStore
(or another base class) that doesn't implement get_nodes
. In that case, you would need to use a subclass that does implement this method, like QdrantVectorStore
.get_nodes
method is not implemented. In object-oriented programming, it's common for base classes to define a method signature, like get_nodes
, but not provide an implementation. This is indicated by the raise NotImplementedError("get_nodes not implemented")
line you're seeing.get_nodes
method is implemented in some specific subclasses of the base class. For example, in the QdrantVectorStore
subclass, the get_nodes
method is implemented and can be used to retrieve nodes from the vector store.get_nodes
is not implemented, you would need to switch to a class where it is implemented, or implement it yourself in a custom subclass.get_nodes
is implemented in the QdrantVectorStore
subclass:def get_nodes( self, node_ids: Optional[List[str]] = None, filters: Optional[MetadataFilters] = None, limit: Optional[int] = None, ) -> List[BaseNode]: # Implementation details...