mirror of
https://github.com/Warky-Devs/vecna.git
synced 2026-05-05 01:26:58 +00:00
28 lines
568 B
Go
28 lines
568 B
Go
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)
|
|
}
|