Skip to content

Commit

Permalink
Fix collection name is not persisted
Browse files Browse the repository at this point in the history
  • Loading branch information
philippgille committed Feb 25, 2024
1 parent 0c8d22e commit 431929c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 431929c

Please sign in to comment.