Skip to content

Commit

Permalink
Update ollama.go
Browse files Browse the repository at this point in the history
  • Loading branch information
henomis authored Jun 28, 2024
1 parent 650fb59 commit 7ffad0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions embedder/ollama/ollama.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)),
}
}
Expand Down

0 comments on commit 7ffad0c

Please sign in to comment.