Documentation
¶
Index ¶
- type Embedder
- func (p *Embedder) BatchEmbed(ctx context.Context, parts []string, usage *components.LLMUsage) ([]embedder.Embedding, error)
- func (p *Embedder) DotProduct(ctx context.Context, target, query *embedder.Embedding) (float64, error)
- func (p *Embedder) Embed(ctx context.Context, text string, embedding *embedder.Embedding, ...) error
- func (p *Embedder) SetClient(clt *openai.Client)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Embedder ¶
func (*Embedder) BatchEmbed ¶
func (*Embedder) DotProduct ¶
func (p *Embedder) DotProduct(ctx context.Context, target, query *embedder.Embedding) (float64, error)
DotProduct calculates the dot product of the embedding vector with another embedding vector. Both vectors must have the same length; otherwise, an ErrVectorLengthMismatch is returned. The method returns the calculated dot product as a float32 value.
Click to show internal directories.
Click to hide internal directories.