Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultChunkMaxRunes = 1200 DefaultChunkOverlapRunes = 120 )
View Source
const DefaultIndexBatchSize = 32
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Citation ¶
type Citation struct {
ID string `json:"id"`
ParentID string `json:"parent_id,omitempty"`
Source string `json:"source,omitempty"`
Title string `json:"title,omitempty"`
URL string `json:"url,omitempty"`
ChunkIndex string `json:"chunk_index,omitempty"`
ChunkStart string `json:"chunk_start,omitempty"`
ChunkEnd string `json:"chunk_end,omitempty"`
}
func CitationFromDocument ¶
type DeleteRequest ¶
type DocumentEmbedding ¶
type HybridSearcher ¶
type HybridSearcher interface {
HybridQuery(ctx context.Context, query Query) ([]SearchResult, error)
}
type IndexResult ¶
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
func NewIndexer ¶
func NewIndexer(config IndexerConfig) (*Indexer, error)
type IndexerConfig ¶
type Query ¶
type Query struct {
Namespace string `json:"namespace,omitempty"`
Text string `json:"text,omitempty"`
Mode SearchMode `json:"mode,omitempty"`
Vector []float32 `json:"vector"`
Limit int `json:"limit,omitempty"`
Filter map[string]string `json:"filter,omitempty"`
VectorWeight float64 `json:"vector_weight,omitempty"`
TextWeight float64 `json:"text_weight,omitempty"`
}
type Reranker ¶
type Reranker interface {
Rerank(ctx context.Context, query string, results []SearchResult) ([]SearchResult, error)
}
type SearchMode ¶
type SearchMode string
const ( SearchModeVector SearchMode = "vector" SearchModeHybrid SearchMode = "hybrid" )
type SearchResult ¶
func MergeRRF ¶ added in v0.1.5
func MergeRRF(lists [][]SearchResult, k int, limit int) []SearchResult
MergeRRF fuses ranked result lists with reciprocal rank fusion.
type TextSplitter ¶
type TextSplitter struct {
// contains filtered or unexported fields
}
func NewTextSplitter ¶
func NewTextSplitter(config TextSplitterConfig) (*TextSplitter, error)
type TextSplitterConfig ¶
type VectorStore ¶
type VectorStore interface {
Upsert(ctx context.Context, documents []DocumentEmbedding) error
Query(ctx context.Context, query Query) ([]SearchResult, error)
Delete(ctx context.Context, req DeleteRequest) error
}
Click to show internal directories.
Click to hide internal directories.