Skip to content

Commit

Permalink
Make it a breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed Apr 21, 2024
1 parent 1bba04f commit 9298535
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions embed_ollama.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,9 @@ type ollamaResponse struct {
// using Ollama's embedding API. You can pass any model that Ollama supports and
// that supports embeddings. A good one as of 2024-03-02 is "nomic-embed-text".
// See https://ollama.com/library/nomic-embed-text
func NewEmbeddingFuncOllama(model string) EmbeddingFunc {
return NewEmbeddingFuncOllamaWithURL(model, defaultBaseURLOllama)
}

// NewEmbeddingFuncOllamaWithURL returns a function that creates embeddings for a text
// using Ollama's embedding API. You can pass any model that Ollama supports and
// that supports embeddings. A good one as of 2024-03-02 is "nomic-embed-text".
// See https://ollama.com/library/nomic-embed-text
// baseURLOllama is the base URL of the Ollama API. If it's empty,
// "http://localhost:11434/api" is used.
func NewEmbeddingFuncOllamaWithURL(model string, baseURLOllama string) EmbeddingFunc {
func NewEmbeddingFuncOllama(model string, baseURLOllama string) EmbeddingFunc {
if baseURLOllama == "" {
baseURLOllama = defaultBaseURLOllama
}
Expand Down
2 changes: 1 addition & 1 deletion embed_ollama_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestNewEmbeddingFuncOllama(t *testing.T) {
t.Fatal("unexpected error:", err)
}

f := NewEmbeddingFuncOllamaWithURL(model, strings.Replace(defaultBaseURLOllama, "11434", u.Port(), 1))
f := NewEmbeddingFuncOllama(model, strings.Replace(defaultBaseURLOllama, "11434", u.Port(), 1))
res, err := f(context.Background(), prompt)
if err != nil {
t.Fatal("expected nil, got", err)
Expand Down

0 comments on commit 9298535

Please sign in to comment.