Documentation
¶
Index ¶
- type Embeddings
- func (e *Embeddings) GenerateEmbeddings(content string) ([]float32, error)
- func (e *Embeddings) GetSimilarity(queryEmbedding []float32, contentEmbedding []float32) (float64, error)
- func (e *Embeddings) Marshal(embeddings []float32) (string, error)
- func (e *Embeddings) Unmarshal(data string) ([]float32, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Embeddings ¶
type Embeddings struct {
// contains filtered or unexported fields
}
func NewEmbeddings ¶
func NewEmbeddings(workerURL string) *Embeddings
NewEmbeddings creates a new Embeddings instance with the Cloudflare Worker URL.
func (*Embeddings) GenerateEmbeddings ¶
func (e *Embeddings) GenerateEmbeddings(content string) ([]float32, error)
GenerateEmbeddings sends text to the Cloudflare Worker and returns embeddings.
func (*Embeddings) GetSimilarity ¶
func (e *Embeddings) GetSimilarity(queryEmbedding []float32, contentEmbedding []float32) (float64, error)
GetSimilarity computes similarity between a query and precomputed embeddings.
Click to show internal directories.
Click to hide internal directories.