Add per-model generation settings to the model selector
Each text and vision harness setting now carries the generation settings its model takes (temperature, sampling limits, penalties, seed, reasoning effort), edited in a modal under the model pick so the harness block stays short. Nothing is set by default, so models keep their provider's own values until a super admin or admin changes them. A setting is only offered and only sent when the catalog says the model takes it: OpenRouter's supported_parameters is now stored on harness_models and refreshed by the hourly sync. Other providers list no parameters, so their models get them all.
This commit is contained in:
@@ -4,6 +4,7 @@ import grabBotHarnessOverview from "@/src/functions/backend/db/harness/grab-bot-
|
||||
import grabHarnessSetting from "@/src/functions/backend/db/harness/grab-harness-setting";
|
||||
import saveBotHarnessSetting from "@/src/functions/backend/db/harness/save-bot-harness-setting";
|
||||
import logEvent, { grabRequestIP } from "@/src/functions/backend/logger";
|
||||
import { withHarnessParameters } from "@/src/dict/harness-parameter-dict";
|
||||
import { SaveBotHarnessSettingsRequestSchema } from "@/src/schemas/harness-schema";
|
||||
import type { BotHarnessOverviewPayload } from "@/src/types";
|
||||
import AppError from "@/src/utils/app-error";
|
||||
@@ -71,7 +72,13 @@ export const handler: BunextAPIRouteHandler<
|
||||
provider_id: setting.provider_id,
|
||||
fallback: setting.fallback,
|
||||
enabled: setting.enabled,
|
||||
options: setting.voice ? { ...options, voice: setting.voice } : options,
|
||||
options: withHarnessParameters({
|
||||
options: {
|
||||
...options,
|
||||
...(setting.voice ? { voice: setting.voice } : {}),
|
||||
},
|
||||
params: setting.params || {},
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user