Documentation
¶
Index ¶
- Constants
- func CountWords(text string) int
- func EnsureRuntime() error
- func L2Normalize(values []float32) []float32
- func NormalizeText(text string) string
- func RuntimeLibPath() (string, error)
- func ShouldSummarizeQuery(text string) bool
- func SupportsDocumentPath(path string) bool
- type Document
- type DocumentChunk
- type EmbeddingModelInfo
- type EncodingAdapter
- type RuntimeOptions
- type Summarizer
- type SummaryModelInfo
- type TextEmbedder
Constants ¶
View Source
const ( DefaultChunkTargetWords = 220 DefaultChunkOverlapWords = 40 LongQueryWordLimit = 220 )
Variables ¶
This section is empty.
Functions ¶
func CountWords ¶
func EnsureRuntime ¶
func EnsureRuntime() error
func L2Normalize ¶
func NormalizeText ¶
func RuntimeLibPath ¶
func ShouldSummarizeQuery ¶
func SupportsDocumentPath ¶
Types ¶
type Document ¶
func LoadDocument ¶
type DocumentChunk ¶
func ChunkDocument ¶
func ChunkDocument(text string, targetWords, overlapWords int) []DocumentChunk
type EmbeddingModelInfo ¶
type EmbeddingModelInfo struct {
ID string
ModelPath string
TokenizerPath string
Definition embeddingModelDefinition
}
func EnsureEmbeddingModel ¶
func EnsureEmbeddingModel(db *sql.DB, modelName string) (EmbeddingModelInfo, error)
type EncodingAdapter ¶
type RuntimeOptions ¶
type RuntimeOptions struct {
Verbose bool
}
type Summarizer ¶
type Summarizer struct {
// contains filtered or unexported fields
}
func NewSummarizer ¶
func NewSummarizer(info SummaryModelInfo, options RuntimeOptions) (*Summarizer, error)
func (*Summarizer) Close ¶
func (s *Summarizer) Close() error
type SummaryModelInfo ¶
type SummaryModelInfo struct {
ID string
EncoderPath string
DecoderPath string
TokenizerPath string
Definition summaryModelDefinition
}
func EnsureSummaryModel ¶
func EnsureSummaryModel(db *sql.DB, modelName string) (SummaryModelInfo, error)
type TextEmbedder ¶
type TextEmbedder struct {
// contains filtered or unexported fields
}
func NewTextEmbedder ¶
func NewTextEmbedder(info EmbeddingModelInfo, options RuntimeOptions) (*TextEmbedder, error)
func (*TextEmbedder) Close ¶
func (e *TextEmbedder) Close() error
func (*TextEmbedder) EmbedDocument ¶
func (e *TextEmbedder) EmbedDocument(text string) ([]float32, error)
func (*TextEmbedder) EmbedQuery ¶
func (e *TextEmbedder) EmbedQuery(text string) ([]float32, error)
Click to show internal directories.
Click to hide internal directories.