Documentation
¶
Overview ¶
Package models provides pre-configured providers for popular embedding models. It includes automatic model type detection and factory functions for easy model loading.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BGEProvider ¶
type BGEProvider struct {
// contains filtered or unexported fields
}
BGEProvider creates a provider for BGE models
func NewBGEProvider ¶
func NewBGEProvider(modelPath string) (*BGEProvider, error)
NewBGEProvider creates a new BGE provider
func (*BGEProvider) Dimension ¶
func (p *BGEProvider) Dimension() int
Dimension returns the embedding dimension
type CustomModel ¶
type CustomModel struct {
// contains filtered or unexported fields
}
CustomModel is a placeholder for model implementation
func NewCustomModel ¶
func NewCustomModel(dimension int, modelPath string) (*CustomModel, error)
NewCustomModel creates a new custom model
type GenericProvider ¶
type GenericProvider struct {
// contains filtered or unexported fields
}
GenericProvider is a generic provider for any model type
func (*GenericProvider) Dimension ¶
func (p *GenericProvider) Dimension() int
Dimension returns the embedding dimension
type ModelInfo ¶
ModelInfo contains information about a model including its type, name, and dimensions.
func NewModelInfo ¶
NewModelInfo creates a new ModelInfo instance by analyzing the model file path.
type ModelType ¶
type ModelType string
ModelType defines the type of embedding model.
const ( // ModelTypeBERT represents BERT models ModelTypeBERT ModelType = "bert" // ModelTypeSentenceBERT represents Sentence-BERT models ModelTypeSentenceBERT ModelType = "sentence-bert" // ModelTypeBGE represents BGE models ModelTypeBGE ModelType = "bge" // ModelTypeGPT represents GPT models ModelTypeGPT ModelType = "gpt" // ModelTypeFastText represents FastText models ModelTypeFastText ModelType = "fasttext" // ModelTypeGloVe represents GloVe models ModelTypeGloVe ModelType = "glove" )
type Provider ¶
Provider is a generic interface for all model providers
func NewProvider ¶
NewProvider creates a new provider based on the model path
type SentenceBERTProvider ¶
type SentenceBERTProvider struct {
// contains filtered or unexported fields
}
SentenceBERTProvider creates a provider for Sentence-BERT models
func NewSentenceBERTProvider ¶
func NewSentenceBERTProvider(modelPath string) (*SentenceBERTProvider, error)
NewSentenceBERTProvider creates a new Sentence-BERT provider
func (*SentenceBERTProvider) Dimension ¶
func (p *SentenceBERTProvider) Dimension() int
Dimension returns the embedding dimension