feat(searxng): show setup JSON format note

This commit is contained in:
Peter Steinberger
2026-05-02 06:51:13 +01:00
parent 49dd4339ce
commit ee8f47eda7
6 changed files with 92 additions and 0 deletions

View File

@@ -145,6 +145,13 @@ describe("searxng web search provider", () => {
expect(resolveSearxngLanguage(config)).toBe("de");
});
it("exposes a credentialNote with JSON format guidance", () => {
const provider = createSearxngWebSearchProvider();
expect(provider.credentialNote).toContain("json format enabled");
expect(provider.credentialNote).toContain("search.formats");
});
it("persists base URL to plugin config via setConfiguredCredentialValue", () => {
const provider = createSearxngWebSearchProvider();
const config = {} as Record<string, unknown>;

View File

@@ -56,6 +56,10 @@ export function createSearxngWebSearchProvider(): WebSearchProviderPlugin {
configuredCredential: { pluginId: "searxng", field: "baseUrl" },
selectionPluginId: "searxng",
}),
credentialNote: [
"For the SearXNG JSON API to work, make sure your SearXNG instance",
"has the json format enabled in its settings.yml under search.formats.",
].join("\n"),
createTool: (ctx) => ({
description:
"Search the web using a self-hosted SearXNG instance. Returns titles, URLs, and snippets.",