mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 00:16:38 +00:00
fix(cli): use openai_compat instead of openai-compat in provider setup (#1062)
The CLI setup wizard and 'providers add' command were using 'openai-compat' (hyphen), but the API and database expect 'openai_compat' (underscore), causing provider creation to fail. Fixes #1046
This commit is contained in:
1 parent
2c41e0907e
commit
bd52dbaf6f
2 files changed
+4
-4
No files matched your search
@@ -125,7 +125,7 @@ func runProvidersAdd() {
|
||||
{"OpenAI", "openai"},
|
||||
{"OpenRouter", "openrouter"},
|
||||
{"DashScope (Alibaba)", "dashscope"},
|
||||
{"OpenAI-compatible", "openai-compat"},
|
||||
{"OpenAI-compatible", "openai_compat"},
|
||||
}
|
||||
providerType, err := promptSelect("Provider type", typeOptions, 0)
|
||||
if err != nil {
|
||||
@@ -150,7 +150,7 @@ func runProvidersAdd() {
|
||||
// Step 4: Base URL (pre-fill per type, editable)
|
||||
defaultURL := defaultBaseURL(providerType)
|
||||
baseURL := ""
|
||||
if providerType == "openai-compat" {
|
||||
if providerType == "openai_compat" {
|
||||
baseURL, err = promptString("Base URL", "e.g. https://api.example.com/v1", defaultURL)
|
||||
if err != nil {
|
||||
fmt.Println("Cancelled.")
|
||||
|
||||
@@ -49,7 +49,7 @@ func addProvider() {
|
||||
{"OpenAI", "openai"},
|
||||
{"OpenRouter", "openrouter"},
|
||||
{"DashScope (Alibaba)", "dashscope"},
|
||||
{"OpenAI-compatible", "openai-compat"},
|
||||
{"OpenAI-compatible", "openai_compat"},
|
||||
}
|
||||
providerType, err := promptSelect("Provider type", typeOptions, 0)
|
||||
if err != nil {
|
||||
@@ -68,7 +68,7 @@ func addProvider() {
|
||||
}
|
||||
|
||||
baseURL := ""
|
||||
if providerType == "openai-compat" {
|
||||
if providerType == "openai_compat" {
|
||||
baseURL, err = promptString("Base URL", "e.g. https://api.example.com/v1", "")
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user