From 33e51cd75e893c42982c3de0300c6bc33031091b Mon Sep 17 00:00:00 2001 From: Yeuoly Date: Fri, 22 Nov 2024 18:11:59 +0800 Subject: [PATCH] refactor: text_embedding result to list[int] --- internal/types/entities/model_entities/text_embedding.go | 2 +- internal/types/exception/generic.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/types/entities/model_entities/text_embedding.go b/internal/types/entities/model_entities/text_embedding.go index 5912953..fc36198 100644 --- a/internal/types/entities/model_entities/text_embedding.go +++ b/internal/types/entities/model_entities/text_embedding.go @@ -19,5 +19,5 @@ type TextEmbeddingResult struct { } type GetTextEmbeddingNumTokensResponse struct { - NumTokens int `json:"num_tokens" validate:"required"` + NumTokens []int `json:"num_tokens" validate:"required"` } diff --git a/internal/types/exception/generic.go b/internal/types/exception/generic.go index 31727d8..d91d97a 100644 --- a/internal/types/exception/generic.go +++ b/internal/types/exception/generic.go @@ -18,6 +18,7 @@ func (e *genericError) Error() string { } func (e *genericError) ToResponse() *entities.Response { + // TODO: using struct instead, currently, for compatibility with old code errorMsg := parser.MarshalJson(e) return entities.NewDaemonErrorResponse(e.code, errorMsg)