From 4a917daf1684a65724dcd2f19eae44b56851ce39 Mon Sep 17 00:00:00 2001 From: Davide Delbianco Date: Tue, 1 Jul 2025 11:55:38 +0200 Subject: [PATCH] chore: Make the `usage` property of LLM-based nodes available in variable picker --- web/app/components/workflow/constants.ts | 8 ++++++++ web/app/components/workflow/nodes/llm/panel.tsx | 5 +++++ .../workflow/nodes/question-classifier/panel.tsx | 5 +++++ web/i18n/de-DE/workflow.ts | 1 + web/i18n/en-US/workflow.ts | 1 + web/i18n/es-ES/workflow.ts | 1 + web/i18n/fa-IR/workflow.ts | 1 + web/i18n/fr-FR/workflow.ts | 1 + web/i18n/hi-IN/workflow.ts | 1 + web/i18n/it-IT/workflow.ts | 1 + web/i18n/ja-JP/workflow.ts | 1 + web/i18n/ko-KR/workflow.ts | 1 + web/i18n/pl-PL/workflow.ts | 1 + web/i18n/pt-BR/workflow.ts | 1 + web/i18n/ro-RO/workflow.ts | 1 + web/i18n/ru-RU/workflow.ts | 1 + web/i18n/sl-SI/workflow.ts | 1 + web/i18n/th-TH/workflow.ts | 1 + web/i18n/tr-TR/workflow.ts | 1 + web/i18n/uk-UA/workflow.ts | 1 + web/i18n/vi-VN/workflow.ts | 1 + web/i18n/zh-Hans/workflow.ts | 1 + web/i18n/zh-Hant/workflow.ts | 1 + 23 files changed, 38 insertions(+) diff --git a/web/app/components/workflow/constants.ts b/web/app/components/workflow/constants.ts index 304295cfbf..c0dea936b6 100644 --- a/web/app/components/workflow/constants.ts +++ b/web/app/components/workflow/constants.ts @@ -480,6 +480,10 @@ export const LLM_OUTPUT_STRUCT: Var[] = [ variable: 'text', type: VarType.string, }, + { + variable: 'usage', + type: VarType.object, + }, ] export const KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT: Var[] = [ @@ -501,6 +505,10 @@ export const QUESTION_CLASSIFIER_OUTPUT_STRUCT = [ variable: 'class_name', type: VarType.string, }, + { + variable: 'usage', + type: VarType.object, + }, ] export const HTTP_REQUEST_OUTPUT_STRUCT: Var[] = [ diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsx index 2a71dffa11..471d65ef20 100644 --- a/web/app/components/workflow/nodes/llm/panel.tsx +++ b/web/app/components/workflow/nodes/llm/panel.tsx @@ -282,6 +282,11 @@ const Panel: FC> = ({ type='string' description={t(`${i18nPrefix}.outputVars.output`)} /> + {inputs.structured_output_enabled && ( <> diff --git a/web/app/components/workflow/nodes/question-classifier/panel.tsx b/web/app/components/workflow/nodes/question-classifier/panel.tsx index 8f6f5eb76d..8cf9ec5f7c 100644 --- a/web/app/components/workflow/nodes/question-classifier/panel.tsx +++ b/web/app/components/workflow/nodes/question-classifier/panel.tsx @@ -129,6 +129,11 @@ const Panel: FC> = ({ type='string' description={t(`${i18nPrefix}.outputVars.className`)} /> + diff --git a/web/i18n/de-DE/workflow.ts b/web/i18n/de-DE/workflow.ts index 55f5bac0e1..0696ff3e4e 100644 --- a/web/i18n/de-DE/workflow.ts +++ b/web/i18n/de-DE/workflow.ts @@ -669,6 +669,7 @@ const translation = { inputVars: 'Eingabevariablen', outputVars: { className: 'Klassennamen', + usage: 'Nutzungsinformationen des Modells', }, class: 'Klasse', classNamePlaceholder: 'Geben Sie Ihren Klassennamen ein', diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts index df0bb904fd..9f6bafe76b 100644 --- a/web/i18n/en-US/workflow.ts +++ b/web/i18n/en-US/workflow.ts @@ -673,6 +673,7 @@ const translation = { inputVars: 'Input Variables', outputVars: { className: 'Class Name', + usage: 'Model Usage Information', }, class: 'Class', classNamePlaceholder: 'Write your class name', diff --git a/web/i18n/es-ES/workflow.ts b/web/i18n/es-ES/workflow.ts index 580072895c..7645d5ed96 100644 --- a/web/i18n/es-ES/workflow.ts +++ b/web/i18n/es-ES/workflow.ts @@ -667,6 +667,7 @@ const translation = { inputVars: 'Variables de entrada', outputVars: { className: 'Nombre de la clase', + usage: 'Información de uso del modelo', }, class: 'Clase', classNamePlaceholder: 'Escribe el nombre de tu clase', diff --git a/web/i18n/fa-IR/workflow.ts b/web/i18n/fa-IR/workflow.ts index 1f2d87a84b..05f5fcbc7e 100644 --- a/web/i18n/fa-IR/workflow.ts +++ b/web/i18n/fa-IR/workflow.ts @@ -669,6 +669,7 @@ const translation = { inputVars: 'متغیرهای ورودی', outputVars: { className: 'نام کلاس', + usage: 'اطلاعات استفاده از مدل', }, class: 'کلاس', classNamePlaceholder: 'نام کلاس خود را بنویسید', diff --git a/web/i18n/fr-FR/workflow.ts b/web/i18n/fr-FR/workflow.ts index 0878d18374..429edd8546 100644 --- a/web/i18n/fr-FR/workflow.ts +++ b/web/i18n/fr-FR/workflow.ts @@ -669,6 +669,7 @@ const translation = { inputVars: 'Variables de saisie', outputVars: { className: 'Nom de la classe', + usage: 'Informations sur l\'utilisation du modèle', }, class: 'Classe', classNamePlaceholder: 'Écrivez le nom de votre classe', diff --git a/web/i18n/hi-IN/workflow.ts b/web/i18n/hi-IN/workflow.ts index 316116dc02..ad8e50003a 100644 --- a/web/i18n/hi-IN/workflow.ts +++ b/web/i18n/hi-IN/workflow.ts @@ -685,6 +685,7 @@ const translation = { inputVars: 'इनपुट वेरिएबल्स', outputVars: { className: 'क्लास नाम', + usage: 'मॉडल उपयोग जानकारी', }, class: 'क्लास', classNamePlaceholder: 'अपना क्लास नाम लिखें', diff --git a/web/i18n/it-IT/workflow.ts b/web/i18n/it-IT/workflow.ts index 0092e25d38..b60b7562ac 100644 --- a/web/i18n/it-IT/workflow.ts +++ b/web/i18n/it-IT/workflow.ts @@ -688,6 +688,7 @@ const translation = { inputVars: 'Variabili di Input', outputVars: { className: 'Nome Classe', + usage: 'Informazioni sull\'utilizzo del modello', }, class: 'Classe', classNamePlaceholder: 'Scrivi il nome della tua classe', diff --git a/web/i18n/ja-JP/workflow.ts b/web/i18n/ja-JP/workflow.ts index 3c959669bf..06fa8d03a2 100644 --- a/web/i18n/ja-JP/workflow.ts +++ b/web/i18n/ja-JP/workflow.ts @@ -676,6 +676,7 @@ const translation = { inputVars: '入力変数', outputVars: { className: 'クラス名', + usage: 'モデル使用量', }, class: 'クラス', classNamePlaceholder: 'クラス名を入力してください', diff --git a/web/i18n/ko-KR/workflow.ts b/web/i18n/ko-KR/workflow.ts index e3ae99d299..2f1cf59f5c 100644 --- a/web/i18n/ko-KR/workflow.ts +++ b/web/i18n/ko-KR/workflow.ts @@ -669,6 +669,7 @@ const translation = { inputVars: '입력 변수', outputVars: { className: '클래스 이름', + usage: '모델 사용 정보', }, class: '클래스', classNamePlaceholder: '클래스 이름을 작성하세요', diff --git a/web/i18n/pl-PL/workflow.ts b/web/i18n/pl-PL/workflow.ts index ca2e95bdf6..c2080a6e0e 100644 --- a/web/i18n/pl-PL/workflow.ts +++ b/web/i18n/pl-PL/workflow.ts @@ -669,6 +669,7 @@ const translation = { inputVars: 'Zmienne wejściowe', outputVars: { className: 'Nazwa klasy', + usage: 'Informacje o użyciu modelu', }, class: 'Klasa', classNamePlaceholder: 'Napisz nazwę swojej klasy', diff --git a/web/i18n/pt-BR/workflow.ts b/web/i18n/pt-BR/workflow.ts index 2a86228499..4671e3379c 100644 --- a/web/i18n/pt-BR/workflow.ts +++ b/web/i18n/pt-BR/workflow.ts @@ -669,6 +669,7 @@ const translation = { inputVars: 'Variáveis de entrada', outputVars: { className: 'Nome da classe', + usage: 'Informações de uso do modelo', }, class: 'Classe', classNamePlaceholder: 'Escreva o nome da sua classe', diff --git a/web/i18n/ro-RO/workflow.ts b/web/i18n/ro-RO/workflow.ts index 09282f4d1c..2d63e7bad2 100644 --- a/web/i18n/ro-RO/workflow.ts +++ b/web/i18n/ro-RO/workflow.ts @@ -669,6 +669,7 @@ const translation = { inputVars: 'Variabile de intrare', outputVars: { className: 'Nume clasă', + usage: 'Informații de utilizare a modelului', }, class: 'Clasă', classNamePlaceholder: 'Scrieți numele clasei', diff --git a/web/i18n/ru-RU/workflow.ts b/web/i18n/ru-RU/workflow.ts index b7b41562a9..7b7dc11216 100644 --- a/web/i18n/ru-RU/workflow.ts +++ b/web/i18n/ru-RU/workflow.ts @@ -669,6 +669,7 @@ const translation = { inputVars: 'Входные переменные', outputVars: { className: 'Имя класса', + usage: 'Информация об использовании модели', }, class: 'Класс', classNamePlaceholder: 'Введите имя вашего класса', diff --git a/web/i18n/sl-SI/workflow.ts b/web/i18n/sl-SI/workflow.ts index 2dbcdb008b..fd559dae2e 100644 --- a/web/i18n/sl-SI/workflow.ts +++ b/web/i18n/sl-SI/workflow.ts @@ -667,6 +667,7 @@ const translation = { questionClassifiers: { outputVars: { className: 'Ime razreda', + usage: 'Informacije o uporabi modela', }, instruction: 'Navodilo', addClass: 'Dodaj razred', diff --git a/web/i18n/th-TH/workflow.ts b/web/i18n/th-TH/workflow.ts index f017b5d02e..324339dcb6 100644 --- a/web/i18n/th-TH/workflow.ts +++ b/web/i18n/th-TH/workflow.ts @@ -668,6 +668,7 @@ const translation = { inputVars: 'ตัวแปรอินพุต', outputVars: { className: 'ชื่อคลาส', + usage: 'ข้อมูลการใช้งานรุ่น', }, class: 'ประเภท', classNamePlaceholder: 'เขียนชื่อชั้นเรียนของคุณ', diff --git a/web/i18n/tr-TR/workflow.ts b/web/i18n/tr-TR/workflow.ts index 0c55351c21..9f4f45f4c2 100644 --- a/web/i18n/tr-TR/workflow.ts +++ b/web/i18n/tr-TR/workflow.ts @@ -670,6 +670,7 @@ const translation = { inputVars: 'Giriş Değişkenleri', outputVars: { className: 'Sınıf Adı', + usage: 'Model Kullanım Bilgileri', }, class: 'Sınıf', classNamePlaceholder: 'Sınıf adınızı yazın', diff --git a/web/i18n/uk-UA/workflow.ts b/web/i18n/uk-UA/workflow.ts index 110c82dc1a..5ceef09b79 100644 --- a/web/i18n/uk-UA/workflow.ts +++ b/web/i18n/uk-UA/workflow.ts @@ -669,6 +669,7 @@ const translation = { inputVars: 'Вхідні змінні', outputVars: { className: 'Назва класу', + usage: 'Інформація про використання моделі', }, class: 'Клас', classNamePlaceholder: 'Напишіть назву вашого класу', diff --git a/web/i18n/vi-VN/workflow.ts b/web/i18n/vi-VN/workflow.ts index 7c32f39350..c84c320a6a 100644 --- a/web/i18n/vi-VN/workflow.ts +++ b/web/i18n/vi-VN/workflow.ts @@ -669,6 +669,7 @@ const translation = { inputVars: 'Biến đầu vào', outputVars: { className: 'Tên lớp', + usage: 'Thông tin sử dụng mô hình', }, class: 'Lớp', classNamePlaceholder: 'Viết tên lớp của bạn', diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts index aa9dcae261..d081fd8c32 100644 --- a/web/i18n/zh-Hans/workflow.ts +++ b/web/i18n/zh-Hans/workflow.ts @@ -674,6 +674,7 @@ const translation = { inputVars: '输入变量', outputVars: { className: '分类名称', + usage: '模型用量信息', }, class: '分类', classNamePlaceholder: '输入你的分类名称', diff --git a/web/i18n/zh-Hant/workflow.ts b/web/i18n/zh-Hant/workflow.ts index 8262e60351..c696c2ec17 100644 --- a/web/i18n/zh-Hant/workflow.ts +++ b/web/i18n/zh-Hant/workflow.ts @@ -670,6 +670,7 @@ const translation = { inputVars: '輸入變量', outputVars: { className: '分類名稱', + usage: '模型用量信息', }, class: '分類', classNamePlaceholder: '輸入你的分類名稱',