Documentation
¶
Index ¶
- Variables
- func Embeddings(input string, model string) ([][]float64, error)
- type DB
- func (d *DB) AddVector(x *Vector) error
- func (d *DB) GobDecode(data []byte) error
- func (d *DB) GobEncode() ([]byte, error)
- func (d *DB) Len() int
- func (d *DB) LoadFile(fn DecodeFunction) error
- func (d *DB) SetFilename(f string)
- func (d *DB) SetParallel(p int) error
- func (d *DB) SimilarVectors(x *Vector, n int, t float64) ([]*Vector, error)
- type DecodeFunction
- type EmbedRequest
- type EmbedResponse
- type Vector
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrZeroVector = errors.New("zero length vector") ErrVectorSizeMismatch = errors.New("vectors are not the same size") )
View Source
var ErrInvalidParallel = errors.New("number of threads must be >= 0")
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) LoadFile ¶
func (d *DB) LoadFile(fn DecodeFunction) error
func (*DB) SetFilename ¶
func (*DB) SetParallel ¶
type DecodeFunction ¶
type DecodeFunction func(json.RawMessage) (any, error)
type EmbedRequest ¶
type EmbedResponse ¶
type EmbedResponse struct {
Embeddings [][]float64 `json:"embeddings"`
}
Click to show internal directories.
Click to hide internal directories.