Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
ErrModelUnavailable identifies an unavailable local ONNX embedding model. Callers can use errors.Is to distinguish this condition from other embedder initialization failures.
Functions ¶
func CheckModelAvailability ¶ added in v2.13.1
func CheckModelAvailability() error
CheckModelAvailability verifies that the local MiniLM artifacts are ready before Chroma's ONNX constructor can attempt a download.
Types ¶
type AvailabilityReason ¶ added in v2.13.1
type AvailabilityReason string
AvailabilityReason identifies why the local ONNX model cannot be used.
const ( AvailabilityConfiguration AvailabilityReason = "configuration" AvailabilityMissingArtifacts AvailabilityReason = "missing_artifacts" AvailabilityDownloadActive AvailabilityReason = "download_active" AvailabilityDownloadStale AvailabilityReason = "download_stale" AvailabilityInvalidLock AvailabilityReason = "invalid_lock" )
type DownloadLock ¶ added in v2.13.1
type DownloadLock struct {
Path string
PID int
Active bool
Invalid bool
Age time.Duration
Detail string
}
DownloadLock describes the ONNX model download lock, when one exists.
type LocalEmbedder ¶
type LocalEmbedder struct {
// contains filtered or unexported fields
}
func NewLocalEmbedder ¶
func NewLocalEmbedder() (*LocalEmbedder, error)
func (*LocalEmbedder) Close ¶
func (e *LocalEmbedder) Close() error
func (*LocalEmbedder) EmbedBatch ¶
func (*LocalEmbedder) Model ¶ added in v2.11.0
func (e *LocalEmbedder) Model() string
Model returns the identifier of the embedding model, used to invalidate previously stored content hashes when the model changes.
type ModelAvailabilityError ¶ added in v2.13.1
type ModelAvailabilityError struct {
Reason AvailabilityReason
ModelPath string
TokenizerPath string
LockPath string
Missing []string
Lock *DownloadLock
Detail string
}
ModelAvailabilityError reports a model cache state that must be repaired or allowed to finish before the local embedder can be initialized.
func (*ModelAvailabilityError) Error ¶ added in v2.13.1
func (e *ModelAvailabilityError) Error() string
func (*ModelAvailabilityError) Unwrap ¶ added in v2.13.1
func (e *ModelAvailabilityError) Unwrap() error