server: return empty slice on empty /api/embed request (#5713)

* server: return empty slice on empty `/api/embed` request

* fix tests
This commit is contained in:
Jeffrey Morgan
2024-07-15 17:39:44 -07:00
committed by GitHub
parent 8288ec8824
commit 7ac6d462ec
2 changed files with 7 additions and 3 deletions

View File

@@ -206,7 +206,7 @@ type EmbedRequest struct {
// EmbedResponse is the response from [Client.Embed].
type EmbedResponse struct {
Model string `json:"model"`
Embeddings [][]float32 `json:"embeddings,omitempty"`
Embeddings [][]float32 `json:"embeddings"`
}
// EmbeddingRequest is the request passed to [Client.Embeddings].