fix(webui): open the preset for blocked image input (#6724)
This commit is contained in:
1 parent
607de63fb4
commit
ce12bfdd0d
38 files changed
+430
-78
No files matched your search
@@ -5,10 +5,22 @@ export interface ModelRequestFailureDetails {
|
||||
attempts?: number;
|
||||
}
|
||||
|
||||
export function isImageRequestFailure(errorKind?: string): boolean {
|
||||
return errorKind === "unsupported_image" || errorKind === "image_request_rejected";
|
||||
}
|
||||
|
||||
export function resolveModelRequestFailureCopy(
|
||||
details: ModelRequestFailureDetails,
|
||||
t: TFunction,
|
||||
): { title: string; body: string } {
|
||||
if (isImageRequestFailure(details.errorKind)) {
|
||||
return {
|
||||
title: t(details.errorKind === "unsupported_image"
|
||||
? "errors.modelRequestFailed.imageInputTitle"
|
||||
: "errors.modelRequestFailed.imageRequestRejectedTitle"),
|
||||
body: t("errors.modelRequestFailed.imageInputBody"),
|
||||
};
|
||||
}
|
||||
let titleKey = "errors.modelRequestFailed.unknownTitle";
|
||||
if (details.errorKind === "billing") {
|
||||
titleKey = "errors.modelRequestFailed.billingTitle";
|
||||
|
||||
@@ -800,6 +800,7 @@ export interface SettingsPayload {
|
||||
}>;
|
||||
model_call_order: string[];
|
||||
model_call_order_editable: boolean;
|
||||
image_fallback_configured?: boolean;
|
||||
/** Whether an actual legacy model configuration is available to convert. */
|
||||
model_configuration_migratable?: boolean;
|
||||
/** Host can resolve the default request API for an unsaved model configuration. */
|
||||
|
||||
Reference in new issue
Block a user