Skip to content

Commit 1eefe5c

Browse files
committed
refactor(plugin): update Ollama Cloud API base URL and version formatting
1 parent 8e84ed3 commit 1eefe5c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

go/plugins/compat_oai/ollamacloud/ollamacloud.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package ollamacloud
1818

1919
import (
2020
"context"
21+
"fmt"
2122
"os"
2223

2324
"github.com/firebase/genkit/go/ai"
@@ -28,9 +29,9 @@ import (
2829
)
2930

3031
const (
31-
provider = "ollamacloud"
32-
baseURL = "https://ollama.com"
33-
version = "/v1"
32+
provider = "ollamacloud"
33+
apiBaseURL = "https://ollama.com"
34+
apiVersion = "v1"
3435
)
3536

3637
// supportedModels defines a curated set of Ollama Cloud models.
@@ -122,7 +123,7 @@ func (o *OllamaCloud) Init(ctx context.Context) []api.Action {
122123
// Configure OpenAI-compatible client with Ollama Cloud settings
123124
o.openAICompatible.Opts = []option.RequestOption{
124125
option.WithAPIKey(apiKey),
125-
option.WithBaseURL(baseURL + version),
126+
option.WithBaseURL(fmt.Sprintf("%s/%s", apiBaseURL, apiVersion)),
126127
}
127128
if len(o.Opts) > 0 {
128129
o.openAICompatible.Opts = append(o.openAICompatible.Opts, o.Opts...)

0 commit comments

Comments
 (0)