Documentation
¶
Index ¶
- type Document
- type Storage
- func (s *Storage) Clean() error
- func (s *Storage) Close()
- func (s *Storage) DeleteDocumentsByPrefix(prefix, context string) error
- func (s *Storage) GetContexts() ([]string, error)
- func (s *Storage) GetDB() *sql.DB
- func (s *Storage) GetDocument(url, context string) (*Document, error)
- func (s *Storage) ListAllDocuments(context string) ([]*Document, error)
- func (s *Storage) ListDocuments(context string, limit int) ([]*Document, error)
- func (s *Storage) SearchDocChunks(query string, context string) ([]*Document, error)
- func (s *Storage) UpsertDocument(doc *Document) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct {
URL string `json:"url"`
Title string `json:"title"`
Description string `json:"description"`
Content string `json:"content"`
Checksum string `json:"checksum"`
Embeddings []float32 `json:"embeddings"`
Context string `json:"context"`
SourceType string `json:"source_type"`
}
Document represents the data to be stored.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage manages the SQLite database.
func NewStorage ¶
NewStorage creates or opens an SQLite database.
func (*Storage) DeleteDocumentsByPrefix ¶
DeleteDocumentsByPrefix deletes all documents with a URL starting with the given prefix, optionally filtered by context.
func (*Storage) GetContexts ¶ added in v1.0.18
GetContexts retrieves a list of unique contexts from the database.
func (*Storage) GetDocument ¶
GetDocument retrieves a document by its URL, optionally filtered by context.
func (*Storage) ListAllDocuments ¶ added in v1.0.13
ListAllDocuments retrieves all documents from the store, optionally filtered by context.
func (*Storage) ListDocuments ¶
ListDocuments retrieves documents from the store, optionally filtered by context, with a limit.
func (*Storage) SearchDocChunks ¶ added in v1.0.18
SearchDocChunks searches for documents based on a query and optional context.
func (*Storage) UpsertDocument ¶
UpsertDocument stores a document in the database. The URL is used as the key.