use float32

This commit is contained in:
Roy Han
2024-07-02 10:30:29 -07:00
parent 512e0a7bde
commit 00a4cb26ca
6 changed files with 27 additions and 27 deletions

View File

@@ -210,7 +210,7 @@ type EmbedRequest struct {
Model string `json:"model"`
// Input is the input to embed.
Input any `json:"input,omitempty"`
Input any `json:"input"`
// KeepAlive controls how long the model will stay loaded in memory following
// this request.
@@ -222,6 +222,12 @@ type EmbedRequest struct {
Options map[string]interface{} `json:"options"`
}
// EmbedResponse is the response from [Client.Embed].
type EmbedResponse struct {
Model string `json:"model"`
Embeddings [][]float32 `json:"embeddings,omitempty"`
}
// EmbeddingRequest is the request passed to [Client.Embeddings].
type EmbeddingRequest struct {
// Model is the model name.
@@ -238,12 +244,6 @@ type EmbeddingRequest struct {
Options map[string]interface{} `json:"options"`
}
// EmbedResponse is the response from [Client.Embed].
type EmbedResponse struct {
Model string `json:"model"`
Embeddings [][]float64 `json:"embeddings,omitempty"`
}
// EmbeddingResponse is the response from [Client.Embeddings].
type EmbeddingResponse struct {
Embedding []float64 `json:"embedding"`