src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
export const globalConfigSchematics = createConfigSchematics()
.field(
"fredApiKey",
"string",
{
displayName: "FRED API Key",
subtitle: "From https://fred.stlouisfed.org/docs/api/api_key.html",
hint: "Required. Set once globally.",
},
""
)
.build();
export const configSchematics = createConfigSchematics()
.field(
"defaultLimit",
"numeric",
{
displayName: "Default Limit",
hint: "Default max results per query (1-1000)",
},
25
)
.field(
"defaultSortOrder",
"string",
{
displayName: "Default Sort",
subtitle: "asc or desc",
},
"asc"
)
.field(
"maxBrowseChars",
"numeric",
{
displayName: "Max Chars - Browse",
subtitle: "Truncate length for fred_browse (1000-50000)",
hint: "Avoid context blowup, adjustable in Plugin Settings",
slider: { min: 1000, max: 50000, step: 500 },
},
12000
)
.field(
"maxSearchChars",
"numeric",
{
displayName: "Max Chars - Search",
subtitle: "Truncate length for fred_search (1000-50000)",
hint: "Summary + raw, adjustable",
slider: { min: 1000, max: 50000, step: 500 },
},
15000
)
.field(
"maxSeriesChars",
"numeric",
{
displayName: "Max Chars - Get Series",
subtitle: "Truncate length for fred_get_series (1000-50000)",
hint: "Observations JSON length limit",
slider: { min: 1000, max: 50000, step: 500 },
},
20000
)
.field(
"maxObservations",
"numeric",
{
displayName: "Max Observations Kept",
subtitle: "Keep last N observations (10-1000)",
hint: "Prevents token overflow, e.g. keep last 200",
slider: { min: 10, max: 1000, step: 10 },
},
200
)
.build();
src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
export const globalConfigSchematics = createConfigSchematics()
.field(
"fredApiKey",
"string",
{
displayName: "FRED API Key",
subtitle: "From https://fred.stlouisfed.org/docs/api/api_key.html",
hint: "Required. Set once globally.",
},
""
)
.build();
export const configSchematics = createConfigSchematics()
.field(
"defaultLimit",
"numeric",
{
displayName: "Default Limit",
hint: "Default max results per query (1-1000)",
},
25
)
.field(
"defaultSortOrder",
"string",
{
displayName: "Default Sort",
subtitle: "asc or desc",
},
"asc"
)
.field(
"maxBrowseChars",
"numeric",
{
displayName: "Max Chars - Browse",
subtitle: "Truncate length for fred_browse (1000-50000)",
hint: "Avoid context blowup, adjustable in Plugin Settings",
slider: { min: 1000, max: 50000, step: 500 },
},
12000
)
.field(
"maxSearchChars",
"numeric",
{
displayName: "Max Chars - Search",
subtitle: "Truncate length for fred_search (1000-50000)",
hint: "Summary + raw, adjustable",
slider: { min: 1000, max: 50000, step: 500 },
},
15000
)
.field(
"maxSeriesChars",
"numeric",
{
displayName: "Max Chars - Get Series",
subtitle: "Truncate length for fred_get_series (1000-50000)",
hint: "Observations JSON length limit",
slider: { min: 1000, max: 50000, step: 500 },
},
20000
)
.field(
"maxObservations",
"numeric",
{
displayName: "Max Observations Kept",
subtitle: "Keep last N observations (10-1000)",
hint: "Prevents token overflow, e.g. keep last 200",
slider: { min: 10, max: 1000, step: 10 },
},
200
)
.build();