Skip to content

Build your personal knowledge base with Trilium Notes

fix(llm): describe a search API's endpoint override in its own terms

Elian Doran46a2cde5989d
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 823c1309ec..ba757455df 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -4266,7 +4266,8 @@
"search_provider_group_cloud_description": "Uses an API key, with a free monthly allowance or billed per search depending on the service. Your searches are sent to the provider's servers.",
"search_provider_group_local": "Self-hosted",
"search_provider_group_local_description": "Your own metasearch instance. Searches reach only that instance and the search engines it queries.",
- "setup_hint_searxng": "The address of your SearXNG instance. Its <Code>settings.yml</Code> must list <Code>json</Code> under <Code>search.formats</Code>."
+ "setup_hint_searxng": "The address of your SearXNG instance. Its <Code>settings.yml</Code> must list <Code>json</Code> under <Code>search.formats</Code>.",
+ "search_base_url_description": "Optional. Reaches the same API through a proxy or gateway."
},
"common": {
"save": "Save",
diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx
index 29161e6a5f..5e997bd185 100644
--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx
+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx
@@ -285,7 +285,7 @@ export default function AddProviderModal({ show, onHidden, onSave, existingProvi
? <span className="text-danger">{t("llm.base_url_invalid")}</span>
: providerType?.setupHintKey
? <Trans i18nKey={providerType.setupHintKey} components={{ Code: <code /> }} />
- : t("llm.base_url_description");
+ : isSearch ? t("llm.search_base_url_description") : t("llm.base_url_description");
// Rendered in one of two slots: ahead of the key for self-hosted providers
// (the endpoint is their primary connection detail) or after it for vendor
diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsx b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsx
index 56b6191a60..5774f74f49 100644
--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsx
+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsx
@@ -275,6 +275,15 @@ describe("what gets saved", () => {
expect(saved).not.toHaveProperty("selectedModels");
});
+ it("explains a search API's endpoint override without pointing at model runtimes", () => {
+ open(undefined, "search");
+ act(() => providerCard("Brave Search")?.click());
+
+ const step = document.querySelector(".wizard-step")?.textContent;
+ expect(step).toContain("llm.search_base_url_description");
+ expect(step).not.toContain("llm.base_url_description");
+ });
+
it("keeps the kind of the search provider being edited", () => {
open({ id: "brave_1", name: "Brave Search", provider: "brave", kind: "search", apiKey: "old" });
type(textBoxes()[0], "new");