From beeb7f133177bedc6d8cce58964cd207adc6930f Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 7 May 2026 09:39:49 -0500 Subject: [PATCH] add field messages for object and review genai --- web/public/locales/en/views/settings.json | 3 +++ .../config-form/section-configs/objects.ts | 16 ++++++++++++++++ .../config-form/section-configs/review.ts | 14 ++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/web/public/locales/en/views/settings.json b/web/public/locales/en/views/settings.json index e32ba8be8b..2c1884c053 100644 --- a/web/public/locales/en/views/settings.json +++ b/web/public/locales/en/views/settings.json @@ -1662,6 +1662,9 @@ "detect": { "fpsGreaterThanFive": "Setting the detect FPS higher than 5 is not recommended. Higher values may cause performance issues and will not provide any benefit." }, + "objects": { + "genaiNoDescriptionsProvider": "You must configure a GenAI provider with the 'descriptions' role for descriptions to be generated." + }, "faceRecognition": { "globalDisabled": "The face recognition enrichment must be enabled for face recognition features to function on this camera.", "personNotTracked": "Face recognition requires the 'person' object to be tracked. Enable 'person' in Objects for this camera." diff --git a/web/src/components/config-form/section-configs/objects.ts b/web/src/components/config-form/section-configs/objects.ts index 5a87bdc623..d17b5a51dc 100644 --- a/web/src/components/config-form/section-configs/objects.ts +++ b/web/src/components/config-form/section-configs/objects.ts @@ -11,6 +11,22 @@ const hideAttributeFilters = (config: FrigateConfig): string[] => const objects: SectionConfigOverrides = { base: { sectionDocs: "/configuration/object_filters", + fieldMessages: [ + { + key: "genai-no-descriptions-provider", + field: "genai.enabled", + messageKey: "configMessages.objects.genaiNoDescriptionsProvider", + severity: "warning", + position: "before", + condition: (ctx) => { + const providers = ctx.fullConfig.genai; + if (!providers || Object.keys(providers).length === 0) return true; + return !Object.values(providers).some((agent) => + agent.roles?.includes("descriptions"), + ); + }, + }, + ], fieldDocs: { "filters.min_area": "/configuration/object_filters#object-area", "filters.max_area": "/configuration/object_filters#object-area", diff --git a/web/src/components/config-form/section-configs/review.ts b/web/src/components/config-form/section-configs/review.ts index 1069d82bf2..83c49d6a75 100644 --- a/web/src/components/config-form/section-configs/review.ts +++ b/web/src/components/config-form/section-configs/review.ts @@ -41,6 +41,20 @@ const review: SectionConfigOverrides = { return !Array.isArray(labels) || labels.length === 0; }, }, + { + key: "genai-no-descriptions-provider", + field: "genai.enabled", + messageKey: "configMessages.objects.genaiNoDescriptionsProvider", + severity: "warning", + position: "before", + condition: (ctx) => { + const providers = ctx.fullConfig.genai; + if (!providers || Object.keys(providers).length === 0) return true; + return !Object.values(providers).some((agent) => + agent.roles?.includes("descriptions"), + ); + }, + }, ], fieldDocs: { "alerts.labels": "/configuration/review/#alerts-and-detections",