Documentation
¶
Index ¶
- type Embedder
- type Indexer
- func (i *Indexer) AsyncBatchIndex(ctx context.Context, sources []Source) error
- func (i *Indexer) AsyncIndex(ctx context.Context, source Source) error
- func (i *Indexer) AsyncIndexDirectory(ctx context.Context, directoryPath string) error
- func (i *Indexer) BatchIndex(ctx context.Context, sources []Source) error
- func (i *Indexer) Index(ctx context.Context, source Source) error
- func (i *Indexer) IndexDirectory(ctx context.Context, directoryPath string) error
- func (i *Indexer) WithConfig(config IndexerConfig) *Indexer
- type IndexerConfig
- type Logger
- type Metrics
- type Source
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
Indexer handles document indexing operations
func NewIndexer ¶
func NewIndexer( parsers map[string]parser.Parser, defaultParser parser.Parser, embedder Embedder, store vectorstore.Store, metrics Metrics, logger Logger, tracer Tracer, ) *Indexer
NewIndexer creates a new indexer
func (*Indexer) AsyncBatchIndex ¶
AsyncBatchIndex adds multiple documents to the RAG engine asynchronously
func (*Indexer) AsyncIndex ¶
AsyncIndex adds documents to the RAG engine asynchronously
func (*Indexer) AsyncIndexDirectory ¶
AsyncIndexDirectory indexes all files in a directory recursively asynchronously
func (*Indexer) BatchIndex ¶
BatchIndex adds multiple documents to the RAG engine in batch
func (*Indexer) IndexDirectory ¶
IndexDirectory indexes all files in a directory recursively with concurrent workers
func (*Indexer) WithConfig ¶
func (i *Indexer) WithConfig(config IndexerConfig) *Indexer
WithConfig sets the indexer configuration
type IndexerConfig ¶
type IndexerConfig struct {
// WorkerCount is the number of concurrent workers for directory indexing (default: 10)
WorkerCount int
// FileChannelBuffer is the buffer size for the file channel in directory indexing (default: 100)
FileChannelBuffer int
// ErrorChannelBuffer is the buffer size for the error channel in directory indexing (default: 10)
ErrorChannelBuffer int
}
IndexerConfig holds configurable parameters for the Indexer
func DefaultIndexerConfig ¶
func DefaultIndexerConfig() IndexerConfig
DefaultIndexerConfig returns the default indexer configuration
type Logger ¶
type Logger interface {
Info(ctx context.Context, message string, fields map[string]interface{})
Debug(ctx context.Context, message string, fields map[string]interface{})
Error(ctx context.Context, message string, err error, fields map[string]interface{})
}
Logger defines the interface for logging