mirror of
https://github.com/Warky-Devs/vecna.git
synced 2026-05-05 01:26:58 +00:00
feat: 🎉 Vectors na Vectors, the begining
Translate 1536 <-> 768 , 3072 <-> 2048
This commit is contained in:
27
pkg/embedclient/client.go
Normal file
27
pkg/embedclient/client.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package embedclient
|
||||
|
||||
import "context"
|
||||
|
||||
// Request is a batch of texts to embed.
|
||||
type Request struct {
|
||||
Texts []string
|
||||
Model string
|
||||
}
|
||||
|
||||
// Usage reports token consumption from the backing model.
|
||||
type Usage struct {
|
||||
PromptTokens int
|
||||
TotalTokens int
|
||||
}
|
||||
|
||||
// Response holds the raw embeddings returned by the backing model.
|
||||
type Response struct {
|
||||
Embeddings [][]float32
|
||||
Model string
|
||||
Usage Usage
|
||||
}
|
||||
|
||||
// Client sends text to a backing embedding model and returns raw vectors.
|
||||
type Client interface {
|
||||
Embed(ctx context.Context, req Request) (Response, error)
|
||||
}
|
||||
Reference in New Issue
Block a user