Documentation
¶
Index ¶
- Constants
- func EnsureDefaultEmbeddingFunctionModel() error
- func EnsureLibTokenizersSharedLibrary() error
- func EnsureOnnxRuntimeSharedLibrary() error
- func ExpandDims(input []int64, shape []int64) ([][][]int64, error)
- func ReshapeFlattenedTensor[T Number](flatTensor []T, shape []int) (interface{}, error)
- type AtomicRefCounter
- type DefaultEmbeddingFunction
- type EmbeddingInput
- type Number
- type Option
- type Tensor2D
- type Tensor3D
Constants ¶
View Source
const ( LibTokenizersVersion = "0.9.0" LibOnnxRuntimeVersion = "1.21.0" ChromaCacheDir = ".cache/chroma/" )
Variables ¶
This section is empty.
Functions ¶
func EnsureDefaultEmbeddingFunctionModel ¶
func EnsureDefaultEmbeddingFunctionModel() error
func EnsureLibTokenizersSharedLibrary ¶
func EnsureLibTokenizersSharedLibrary() error
func EnsureOnnxRuntimeSharedLibrary ¶
func EnsureOnnxRuntimeSharedLibrary() error
func ReshapeFlattenedTensor ¶
Types ¶
type AtomicRefCounter ¶
type AtomicRefCounter struct {
// contains filtered or unexported fields
}
func (*AtomicRefCounter) Decrement ¶
func (arc *AtomicRefCounter) Decrement()
func (*AtomicRefCounter) GetCount ¶
func (arc *AtomicRefCounter) GetCount() int32
func (*AtomicRefCounter) Increment ¶
func (arc *AtomicRefCounter) Increment()
type DefaultEmbeddingFunction ¶
type DefaultEmbeddingFunction struct {
// contains filtered or unexported fields
}
func NewDefaultEmbeddingFunction ¶
func NewDefaultEmbeddingFunction(opts ...Option) (*DefaultEmbeddingFunction, func() error, error)
func (*DefaultEmbeddingFunction) Close ¶
func (e *DefaultEmbeddingFunction) Close() error
func (*DefaultEmbeddingFunction) EmbedDocuments ¶
func (e *DefaultEmbeddingFunction) EmbedDocuments(ctx context.Context, documents []string) ([]embeddings.Embedding, error)
func (*DefaultEmbeddingFunction) EmbedQuery ¶
func (e *DefaultEmbeddingFunction) EmbedQuery(ctx context.Context, document string) (embeddings.Embedding, error)
type EmbeddingInput ¶
type EmbeddingInput struct {
// contains filtered or unexported fields
}
func NewEmbeddingInput ¶
func (*EmbeddingInput) Close ¶
func (ei *EmbeddingInput) Close() error
type Number ¶
type Number interface {
~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~float32 | ~float64
}
Number is a constraint that permits any number type
type Option ¶
type Option func(p *DefaultEmbeddingFunction) error
type Tensor3D ¶
type Tensor3D[T Number] [][][]T
Tensor3D is a generic 3D tensor
func BroadcastTo ¶
BroadcastTo simulates np.broadcast_to for any 3D tensor
func ConvertTensor3D ¶
ConvertTensor3D converts a Tensor3D of one numeric type to another
Click to show internal directories.
Click to hide internal directories.