Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document interface { // ID returns the unique ID for the document. ID() string // Content returns the content of the document. Content() string }
Document represents a single document.
type Index ¶
type Index[K comparable] interface { ReadOnlyIndex[K] Add(key K, value ...llm.Embedding) error Remove(key K) bool }
type IndexEntry ¶
type IndexEntry[K comparable] struct { // DocumentID is the unique ID for the document. DocumentID K // IndexID is the unique ID for the index. IndexID int64 // ChunkIndex is the index of the chunk in the document. ChunkIndex int // ChunkCount is the total number of chunks in the document. ChunkCount int // Embedding is the embedding for the chunk. Embedding llm.Embedding // Valid indicates whether the entry is valid or not. Valid bool }
IndexEntry represents a single entry in the index.
type ReadOnlyIndex ¶
type SearchHit ¶
type SearchHit[K comparable] struct { IndexEntry[K] // Distance is the distance between the query and the document. Distance float32 }
SearchHit represents a single search hit.
Click to show internal directories.
Click to hide internal directories.