Skip to content

Commit

Permalink
Merge pull request #24 from philippgille/fix-collection-name-not-pers…
Browse files Browse the repository at this point in the history
…isted

Fix collection name is not persisted
  • Loading branch information
philippgille authored Feb 25, 2024
2 parents 0c8d22e + 431929c commit f558425
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 f558425

Please sign in to comment.