Documentation
¶
Index ¶
- func NewTestBucket(role, text string) merkle.Bucket
- type MockEmbedder
- type MockVectorDriver
- func (m *MockVectorDriver) Add(_ context.Context, docs []vector.Document) error
- func (m *MockVectorDriver) Close() error
- func (m *MockVectorDriver) Delete(_ context.Context, _ []string) error
- func (m *MockVectorDriver) Get(_ context.Context, _ []string) ([]vector.Document, error)
- func (m *MockVectorDriver) Query(_ context.Context, _ []float32, topK int) ([]vector.QueryResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestBucket ¶
NewTestBucket creates a simple bucket for testing
Types ¶
type MockEmbedder ¶
type MockEmbedder struct {
Embeddings map[string][]float32
// FailOn causes Embed to return an error when the input text matches
FailOn string
}
MockEmbedder is a test embedder that returns predictable embeddings
func NewMockEmbedder ¶
func NewMockEmbedder() *MockEmbedder
func (*MockEmbedder) Close ¶
func (m *MockEmbedder) Close() error
type MockVectorDriver ¶
type MockVectorDriver struct {
Documents []vector.Document
Results []vector.QueryResult
// FailQuery causes Query to return an error
FailQuery bool
}
MockVectorDriver is a test vector driver
func NewMockVectorDriver ¶
func NewMockVectorDriver() *MockVectorDriver
func (*MockVectorDriver) Close ¶
func (m *MockVectorDriver) Close() error
func (*MockVectorDriver) Delete ¶
func (m *MockVectorDriver) Delete(_ context.Context, _ []string) error
func (*MockVectorDriver) Query ¶
func (m *MockVectorDriver) Query(_ context.Context, _ []float32, topK int) ([]vector.QueryResult, error)
Click to show internal directories.
Click to hide internal directories.