Project Files
src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
export const configSchematics = createConfigSchematics()
.field(
"apiKey",
"string",
{
displayName: "API Key",
subtitle: "Optional API key for sites or services that require one.",
},
"",
)
.field(
"requestDelaySeconds",
"numeric",
{
displayName: "Delay Between Requests (seconds)",
subtitle: "Delay between requests to avoid hammering a site.",
slider: { min: 0, max: 10, step: 1 },
},
2,
)
.field(
"userAgent",
"string",
{
displayName: "User-Agent",
subtitle: "User-Agent header to send with requests.",
},
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",
)
.field(
"maxRetries",
"numeric",
{
displayName: "Max Retries",
subtitle: "Maximum number of retries for failed requests.",
slider: { min: 0, max: 5, step: 1 },
},
2,
)
.build();
export type WebFetcherConfig = {
apiKey: string;
requestDelaySeconds: number;
userAgent: string;
maxRetries: number;
};