From 431929c06c05ba6c25b3a500677877e26e1cd7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Gill=C3=A9?= Date: Sun, 25 Feb 2024 16:38:21 +0100 Subject: [PATCH] Fix collection name is not persisted --- collection.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/collection.go b/collection.go index 66fc121..1cd7bdc 100644 --- a/collection.go +++ b/collection.go @@ -51,9 +51,16 @@ func newCollection(name string, metadata map[string]string, embed EmbeddingFunc, if err != nil { return nil, fmt.Errorf("couldn't create collection directory: %w", err) } - // Persist metadata + // Persist name and metadata metadataPath := path.Join(c.persistDirectory, metadataFileName) - err = persist(metadataPath, m) + pc := struct { + Name string + Metadata map[string]string + }{ + Name: name, + Metadata: m, + } + err = persist(metadataPath, pc) if err != nil { return nil, fmt.Errorf("couldn't persist collection metadata: %w", err) }