Documentation
¶
Index ¶
- Constants
- type Config
- type Engine
- func (e *Engine) Close() error
- func (e *Engine) Dimension() int
- func (e *Engine) Embed(ctx context.Context, text string) ([]float32, error)
- func (e *Engine) EmbedBatch(ctx context.Context, texts []string) ([][]float32, error)
- func (e *Engine) EnsureReady(ctx context.Context) error
- func (e *Engine) IsLoaded() bool
- func (e *Engine) IsRuntimeLoaded() bool
- func (e *Engine) ModelPath() string
- func (e *Engine) RuntimeVersion() string
Constants ¶
View Source
const ( // ModelRepo is the Hugging Face model repository ModelRepo = "sentence-transformers/all-MiniLM-L6-v2" // EmbeddingDimension is the dimension of the embedding vectors EmbeddingDimension = 384 // DefaultModelDir is the default directory for model files DefaultModelDir = ".mcp-devtools/models" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine provides embedding generation using a local ONNX model via hugot
func (*Engine) EmbedBatch ¶
EmbedBatch generates embeddings for multiple texts
func (*Engine) EnsureReady ¶
EnsureReady ensures the model and runtime are downloaded and loaded
func (*Engine) IsRuntimeLoaded ¶
IsRuntimeLoaded returns whether the runtime is loaded
func (*Engine) RuntimeVersion ¶
RuntimeVersion returns the runtime version
Click to show internal directories.
Click to hide internal directories.