Surface the Google API key field regardless of search provider
It was only shown when Search Provider was set to Google, but the same key is also needed for Google embeddings in Semantic Search (Advanced tab) — a completely separate feature from web search. A user who only wanted Google for embeddings had no way to find where to enter the key. Now always visible under General → Web Search, with a caption clarifying both uses; Search Engine ID stays conditional since it's web-search-specific. Also pointed the Semantic Search tab's "no providers available" hint at the same location.
This commit is contained in:
@@ -1,6 +1,74 @@
|
||||
{
|
||||
"sourceLanguage" : "en",
|
||||
"strings" : {
|
||||
"Used for Google web search (if selected above) and for Google embeddings in Settings → Advanced → Semantic Search." : {
|
||||
"localizations" : {
|
||||
"da" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Bruges til Google-websøgning (hvis valgt ovenfor) og til Google-indlejringer i Indstillinger → Avanceret → Semantisk søgning."
|
||||
}
|
||||
},
|
||||
"de" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Wird für die Google-Websuche (falls oben ausgewählt) und für Google-Embeddings unter Einstellungen → Erweitert → Semantische Suche verwendet."
|
||||
}
|
||||
},
|
||||
"fr" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Utilisée pour la recherche web Google (si sélectionnée ci-dessus) et pour les embeddings Google dans Réglages → Avancé → Recherche sémantique."
|
||||
}
|
||||
},
|
||||
"nb" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Brukes til Google-websøk (hvis valgt ovenfor) og til Google-innbygginger i Innstillinger → Avansert → Semantisk søk."
|
||||
}
|
||||
},
|
||||
"sv" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Används för Google-webbsökning (om vald ovan) och för Google-embeddings i Inställningar → Avancerat → Semantisk sökning."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"⚠️ No embedding providers available. Configure an API key for OpenAI, OpenRouter, or Google (under General → Web Search) in the General tab." : {
|
||||
"localizations" : {
|
||||
"da" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "⚠️ Ingen indlejringsudbydere tilgængelige. Konfigurer en API-nøgle til OpenAI, OpenRouter eller Google (under Generelt → Websøgning) på fanen Generelt."
|
||||
}
|
||||
},
|
||||
"de" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "⚠️ Keine Embedding-Anbieter verfügbar. Konfiguriere einen API-Schlüssel für OpenAI, OpenRouter oder Google (unter Allgemein → Websuche) auf der Registerkarte „Allgemein“."
|
||||
}
|
||||
},
|
||||
"fr" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "⚠️ Aucun fournisseur d'embeddings disponible. Configure une clé API pour OpenAI, OpenRouter ou Google (sous Général → Recherche web) dans l'onglet Général."
|
||||
}
|
||||
},
|
||||
"nb" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "⚠️ Ingen innbyggingsleverandører tilgjengelig. Konfigurer en API-nøkkel for OpenAI, OpenRouter eller Google (under Generelt → Websøk) i fanen Generelt."
|
||||
}
|
||||
},
|
||||
"sv" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "⚠️ Inga embedding-leverantörer tillgängliga. Konfigurera en API-nyckel för OpenAI, OpenRouter eller Google (under Allmänt → Webbsökning) på fliken Allmänt."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Remote (HTTP)" : {
|
||||
"localizations" : {
|
||||
"da" : {
|
||||
|
||||
@@ -485,17 +485,28 @@ It's better to admit "I need more information" or "I cannot do that" than to fak
|
||||
.labelsHidden()
|
||||
.fixedSize()
|
||||
}
|
||||
// Always visible (not gated behind Search Provider == .google): this key is also
|
||||
// used for Google embeddings in Semantic Search (Advanced tab), which has nothing
|
||||
// to do with which web search provider is selected. Search Engine ID is web-search
|
||||
// specific, so that one stays conditional.
|
||||
rowDivider()
|
||||
row("Google API Key") {
|
||||
SecureField("", text: $googleKey)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.frame(width: 300)
|
||||
.onAppear { googleKey = settingsService.googleAPIKey ?? "" }
|
||||
.onChange(of: googleKey) {
|
||||
settingsService.googleAPIKey = googleKey.isEmpty ? nil : googleKey
|
||||
}
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text("Used for Google web search (if selected above) and for Google embeddings in Settings → Advanced → Semantic Search.")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
.padding(.horizontal, 12)
|
||||
.padding(.bottom, 4)
|
||||
if settingsService.searchProvider == .google {
|
||||
rowDivider()
|
||||
row("Google API Key") {
|
||||
SecureField("", text: $googleKey)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.frame(width: 300)
|
||||
.onAppear { googleKey = settingsService.googleAPIKey ?? "" }
|
||||
.onChange(of: googleKey) {
|
||||
settingsService.googleAPIKey = googleKey.isEmpty ? nil : googleKey
|
||||
}
|
||||
}
|
||||
rowDivider()
|
||||
row("Search Engine ID") {
|
||||
TextField("", text: $googleEngineID)
|
||||
@@ -1794,7 +1805,7 @@ It's better to admit "I need more information" or "I cannot do that" than to fak
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.padding(.horizontal, 4)
|
||||
} else {
|
||||
Text("⚠️ No embedding providers available. Configure an API key for OpenAI, OpenRouter, or Google in the General tab.")
|
||||
Text("⚠️ No embedding providers available. Configure an API key for OpenAI, OpenRouter, or Google (under General → Web Search) in the General tab.")
|
||||
.font(.system(size: 13))
|
||||
.foregroundStyle(.orange)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
|
||||
Reference in New Issue
Block a user