From 7ffad0c3e04a8606184b8b6f4d8c4b5bf9d7dea4 Mon Sep 17 00:00:00 2001 From: Simone Vellei Date: Fri, 28 Jun 2024 15:59:19 +0200 Subject: [PATCH] Update ollama.go --- embedder/ollama/ollama.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/embedder/ollama/ollama.go b/embedder/ollama/ollama.go index c78eff7..b15766e 100644 --- a/embedder/ollama/ollama.go +++ b/embedder/ollama/ollama.go @@ -17,11 +17,11 @@ const ( defaultEndpoint = "http://localhost:11434/api" ) -type ErrorOllamaEmbed struct { +type OllamaEmbedError struct { Err error } -func (e *ErrorOllamaEmbed) Error() string { +func (e *OllamaEmbedError) Error() string { return fmt.Sprintf("Error embedding text: %v", e.Err) } @@ -100,7 +100,7 @@ func (e *Embedder) embed(ctx context.Context, text string) (embedder.Embedding, } if resp.HTTPStatusCode >= http.StatusBadRequest { - return nil, &ErrorOllamaEmbed{ + return nil, &OllamaEmbedError{ Err: errors.New(string(resp.RawBody)), } }