From 51cc2bf42977104e539040892bdb7baf72c12091 Mon Sep 17 00:00:00 2001 From: Asuka Minato Date: Fri, 22 Aug 2025 19:32:22 +0900 Subject: [PATCH 01/36] example of next(, None) (#24345) --- api/core/rag/extractor/excel_extractor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/core/rag/extractor/excel_extractor.py b/api/core/rag/extractor/excel_extractor.py index a3b35458df..7cc554c74d 100644 --- a/api/core/rag/extractor/excel_extractor.py +++ b/api/core/rag/extractor/excel_extractor.py @@ -34,9 +34,8 @@ class ExcelExtractor(BaseExtractor): for sheet_name in wb.sheetnames: sheet = wb[sheet_name] data = sheet.values - try: - cols = next(data) - except StopIteration: + cols = next(data, None) + if cols is None: continue df = pd.DataFrame(data, columns=cols) From ffe1685b5426d6a5fa3daa45e75a0d9882133b2d Mon Sep 17 00:00:00 2001 From: 17hz <0x149527@gmail.com> Date: Fri, 22 Aug 2025 18:44:48 +0800 Subject: [PATCH 02/36] feat: Add default value support for all workflow start node variable types (#24129) Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../config-var/config-modal/index.tsx | 70 +++++++++++++++++-- .../base/chat/chat-with-history/hooks.tsx | 6 +- .../base/chat/embedded-chatbot/hooks.tsx | 6 +- .../share/text-generation/run-once/index.tsx | 17 ++++- .../workflow/panel/inputs-panel.tsx | 33 +++------ web/utils/model-config.ts | 4 ++ 6 files changed, 100 insertions(+), 36 deletions(-) diff --git a/web/app/components/app/configuration/config-var/config-modal/index.tsx b/web/app/components/app/configuration/config-var/config-modal/index.tsx index 861020545d..4ba451452c 100644 --- a/web/app/components/app/configuration/config-var/config-modal/index.tsx +++ b/web/app/components/app/configuration/config-var/config-modal/index.tsx @@ -21,6 +21,10 @@ import Checkbox from '@/app/components/base/checkbox' import { DEFAULT_FILE_UPLOAD_SETTING } from '@/app/components/workflow/constants' import { DEFAULT_VALUE_MAX_LEN } from '@/config' import { SimpleSelect } from '@/app/components/base/select' +import Textarea from '@/app/components/base/textarea' +import { FileUploaderInAttachmentWrapper } from '@/app/components/base/file-uploader' +import { TransferMethod } from '@/types/app' +import type { FileEntity } from '@/app/components/base/file-uploader/types' const TEXT_MAX_LENGTH = 256 @@ -82,6 +86,8 @@ const ConfigModal: FC = ({ return () => { const newPayload = produce(tempPayload, (draft) => { draft.type = type + // Clear default value when switching types + draft.default = undefined if ([InputVarType.singleFile, InputVarType.multiFiles].includes(type)) { (Object.keys(DEFAULT_FILE_UPLOAD_SETTING)).forEach((key) => { if (key !== 'max_length') @@ -234,6 +240,41 @@ const ConfigModal: FC = ({ )} + + {/* Default value for text input */} + {type === InputVarType.textInput && ( + + handlePayloadChange('default')(e.target.value || undefined)} + placeholder={t('appDebug.variableConfig.inputPlaceholder')!} + /> + + )} + + {/* Default value for paragraph */} + {type === InputVarType.paragraph && ( + +