feat(models): add per-preset request overrides
This commit is contained in:
1 parent
bdfc8f7bd4
commit
d4b01285a9
25 files changed
+349
-9
No files matched your search
@@ -1176,7 +1176,7 @@ export async function fetchSidebarState(
|
||||
function modelGenerationSettingsPayload(
|
||||
configuration: Pick<
|
||||
ModelConfigurationCreate,
|
||||
"maxTokens" | "contextWindowTokens" | "temperature" | "reasoningEffort" | "api"
|
||||
"maxTokens" | "contextWindowTokens" | "temperature" | "reasoningEffort" | "api" | "extraHeaders" | "extraQuery" | "extraBody"
|
||||
>,
|
||||
): Record<string, unknown> {
|
||||
const payload: Record<string, unknown> = {};
|
||||
@@ -1195,6 +1195,11 @@ function modelGenerationSettingsPayload(
|
||||
if (configuration.api !== undefined) {
|
||||
payload.api = configuration.api;
|
||||
}
|
||||
for (const [key, field] of [
|
||||
["extraHeaders", "extra_headers"], ["extraQuery", "extra_query"], ["extraBody", "extra_body"],
|
||||
] as const) {
|
||||
if (configuration[key] !== undefined) payload[field] = configuration[key];
|
||||
}
|
||||
return payload;
|
||||
}
|
||||
|
||||
|
||||
@@ -706,6 +706,9 @@ export interface SettingsPayload {
|
||||
reasoning_effort: string | null;
|
||||
reasoning_effort_values?: string[];
|
||||
api?: ModelAPIConfig | null;
|
||||
extra_headers?: Record<string, string> | null;
|
||||
extra_query?: Record<string, string> | null;
|
||||
extra_body?: Record<string, unknown> | null;
|
||||
}>;
|
||||
model_call_order: string[];
|
||||
model_call_order_editable: boolean;
|
||||
@@ -714,6 +717,7 @@ export interface SettingsPayload {
|
||||
/** Host can resolve the default request API for an unsaved model configuration. */
|
||||
model_api_resolution_supported?: boolean;
|
||||
provider_api_configuration_supported?: boolean;
|
||||
model_request_overrides_supported?: boolean;
|
||||
created_model_preset?: string;
|
||||
created_provider?: string;
|
||||
providers: Array<{
|
||||
@@ -1332,6 +1336,9 @@ export interface ModelConfigurationCreate {
|
||||
temperature?: number;
|
||||
reasoningEffort?: string | null;
|
||||
api?: ModelAPIConfig | null;
|
||||
extraHeaders?: string;
|
||||
extraQuery?: string;
|
||||
extraBody?: string;
|
||||
}
|
||||
|
||||
export interface ModelConfigurationUpdate {
|
||||
@@ -1344,6 +1351,9 @@ export interface ModelConfigurationUpdate {
|
||||
temperature?: number;
|
||||
reasoningEffort?: string | null;
|
||||
api?: ModelAPIConfig | null;
|
||||
extraHeaders?: string;
|
||||
extraQuery?: string;
|
||||
extraBody?: string;
|
||||
}
|
||||
|
||||
export interface ProviderSettingsUpdate {
|
||||
|
||||
Reference in new issue
Block a user