src / configSchematics.ts
import { createConfigSchematics } from "@lmstudio/sdk";
export const globalConfigSchematics = createConfigSchematics()
.field(
"searxngInstanceUrl",
"string",
{
displayName: "SearXNG instance URL",
hint: "Used by the SearXNG backend only. Base URL of an instance with JSON output enabled (e.g. https://searx.example.org). Leave empty if you only use DuckDuckGo.",
},
"",
)
.field(
"requestTimeoutMs",
"numeric",
{
displayName: "Request timeout (ms)",
hint: "How long to wait for the search backend before giving up.",
slider: { min: 1000, max: 30000, step: 500 },
int: true,
},
10000,
)
.build();
export const configSchematics = createConfigSchematics()
.field(
"backend",
"select",
{
displayName: "Search backend",
hint: "Which search engine the tool talks to.",
options: [
{ value: "duckduckgo", displayName: "DuckDuckGo (no setup)" },
{ value: "searxng", displayName: "SearXNG (requires instance URL in global config)" },
],
},
"duckduckgo",
)
.field(
"defaultMaxResults",
"numeric",
{
displayName: "Max results",
hint: "Maximum number of results returned to the model per search (1–20).",
slider: { min: 1, max: 20, step: 1 },
int: true,
},
8,
)
.field(
"searxngLanguage",
"string",
{
displayName: "SearXNG language",
hint: "SearXNG-only. Language code, e.g. `fr`, `en-US`, or `auto`.",
},
"auto",
)
.field(
"searxngSafesearch",
"select",
{
displayName: "SearXNG safe search",
hint: "SearXNG-only. Filtering level applied to results.",
options: [
{ value: "0", displayName: "Off" },
{ value: "1", displayName: "Moderate" },
{ value: "2", displayName: "Strict" },
],
},
"1",
)
.build();