Add Metrics to api\embed response (#5709)

* add prompt tokens to embed response

* rm slog

* metrics

* types

* prompt n

* clean up

* reset submodule

* update tests

* test name

* list metrics
This commit is contained in:
royjhan 2024-07-30 13:12:21 -07:00 committed by GitHub
parent cef2c6054d
commit 1b44d873e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 39 additions and 15 deletions

View file

@ -267,6 +267,10 @@ type EmbedRequest struct {
type EmbedResponse struct {
Model string `json:"model"`
Embeddings [][]float32 `json:"embeddings"`
TotalDuration time.Duration `json:"total_duration,omitempty"`
LoadDuration time.Duration `json:"load_duration,omitempty"`
PromptEvalCount int `json:"prompt_eval_count,omitempty"`
}
// EmbeddingRequest is the request passed to [Client.Embeddings].