Jackson07/18/2023, 6:54 AM
However, putting this inside nodes.py doesn't seems ideal due to I still have other classes (like model class) and I believe mixing everything inside a nodes is an anti-pattern. But if I write a standalone function in nodes.py like below seems redundant.
class VectorStore: def __init__( self, client_path, embedding_func) -> None: self.collections = None self.client = chromadb.PersistentClient(path=client_path) self.embedding_func = embedding_func def create_collections(self,collection_name): self.collections = self.client.create_collection(collection_name,self.embedding_func) return self.collections def add_docs( collections, embeddings, metadatas, ids): collections.add( embeddings = embeddings, metadatas = metadatas, ids = ids )
So my question is what are the best way to separate classes and nodes, while avoiding code redundant at the same time?
def create_collections(collections,collections_name): collections.create_collections(collections_name)
datajoely07/18/2023, 7:35 AM
Juan Luis07/18/2023, 7:43 AM
https://docs.kedro.org/en/stable/hooks/introduction.html I see you're using Chroma right? any thoughts on how it compares to, say, Weaviate or others?
Jackson07/18/2023, 9:05 AM
datajoely07/18/2023, 9:14 AM
Nok Lam Chan07/18/2023, 10:32 AM
can be analog to