Documentation
¶
Index ¶
- type Store
- func (s *Store) AddDocuments(_ context.Context, docs []schema.Document, _ ...vectorstores.Option) ([]string, error)
- func (s *Store) DeleteCollection(_ context.Context, _ string) error
- func (s *Store) Docs() []schema.Document
- func (s *Store) ListCollections(_ context.Context) ([]string, error)
- func (s *Store) SimilaritySearch(_ context.Context, _ string, numDocuments int, _ ...vectorstores.Option) ([]schema.Document, error)
- func (s *Store) SimilaritySearchWithScores(ctx context.Context, query string, numDocuments int, ...) ([]vectorstores.DocumentWithScore, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an in-memory vector store for testing purposes.
func (*Store) AddDocuments ¶
func (s *Store) AddDocuments(_ context.Context, docs []schema.Document, _ ...vectorstores.Option) ([]string, error)
AddDocuments adds documents to the in-memory store.
func (*Store) DeleteCollection ¶ added in v0.5.0
DeleteCollection simulates deleting a collection.
func (*Store) ListCollections ¶
ListCollections returns a dummy collection name.
func (*Store) SimilaritySearch ¶
func (s *Store) SimilaritySearch(_ context.Context, _ string, numDocuments int, _ ...vectorstores.Option) ([]schema.Document, error)
SimilaritySearch returns the first N documents from the store, simulating a search.
func (*Store) SimilaritySearchWithScores ¶
func (s *Store) SimilaritySearchWithScores(ctx context.Context, query string, numDocuments int, options ...vectorstores.Option) ([]vectorstores.DocumentWithScore, error)
SimilaritySearchWithScores returns documents with a faked score of 1.0.
Click to show internal directories.
Click to hide internal directories.