diff --git a/api/core/app/apps/advanced_chat/generate_task_pipeline.py b/api/core/app/apps/advanced_chat/generate_task_pipeline.py index 65a147dcdd..c50fa2ca48 100644 --- a/api/core/app/apps/advanced_chat/generate_task_pipeline.py +++ b/api/core/app/apps/advanced_chat/generate_task_pipeline.py @@ -305,7 +305,9 @@ class AdvancedChatAppGenerateTaskPipeline: err = self._base_task_pipeline._handle_error(event=event, session=session, message_id=self._message_id) yield self._base_task_pipeline._error_to_stream_response(err) - def _handle_workflow_started_event(self, **kwargs) -> Generator[StreamResponse, None, None]: + def _handle_workflow_started_event( + self, event: QueueWorkflowStartedEvent, **kwargs + ) -> Generator[StreamResponse, None, None]: """Handle workflow started events.""" with self._database_session() as session: workflow_execution = self._workflow_cycle_manager.handle_workflow_run_start() diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx index badc2034d7..f89ddd2140 100644 --- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx +++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx @@ -3,12 +3,12 @@ import type { FC } from 'react' import React, { useEffect, useRef, useState } from 'react' import { RiDeleteBinLine, + RiNodeTree, } from '@remixicon/react' import { useTranslation } from 'react-i18next' import { useContext } from 'use-context-selector' import { formatFileSize } from '@/utils/format' import cn from '@/utils/classnames' -import { Yaml as YamlIcon } from '@/app/components/base/icons/src/public/files' import { ToastContext } from '@/app/components/base/toast' import { UploadCloud01 } from '@/app/components/base/icons/src/vender/line/general' import Button from '@/app/components/base/button' @@ -122,12 +122,12 @@ const Uploader: FC = ({ {file && (
- +
{file.name}
- YAML + PIPELINE · {formatFileSize(file.size)}
diff --git a/web/app/components/plugins/marketplace/search-box/trigger/tool-selector.tsx b/web/app/components/plugins/marketplace/search-box/trigger/tool-selector.tsx index 43f1a20840..00f8c55a90 100644 --- a/web/app/components/plugins/marketplace/search-box/trigger/tool-selector.tsx +++ b/web/app/components/plugins/marketplace/search-box/trigger/tool-selector.tsx @@ -49,7 +49,10 @@ const ToolSelectorTrigger = ({ !!selectedTagsLength && ( onTagsChange([])} + onClick={(e) => { + e.stopPropagation() + onTagsChange([]) + }} /> ) } diff --git a/web/app/components/rag-pipeline/components/panel/input-field/editor/form/hooks.ts b/web/app/components/rag-pipeline/components/panel/input-field/editor/form/hooks.ts index bbca128cf1..87d4e9ce42 100644 --- a/web/app/components/rag-pipeline/components/panel/input-field/editor/form/hooks.ts +++ b/web/app/components/rag-pipeline/components/panel/input-field/editor/form/hooks.ts @@ -54,7 +54,7 @@ export const useHiddenFieldNames = (type: PipelineInputVarType) => { break case PipelineInputVarType.checkbox: fieldNames = [ - t('appDebug.variableConfig.startedChecked'), + t('appDebug.variableConfig.startChecked'), t('appDebug.variableConfig.tooltips'), ] break diff --git a/web/app/components/rag-pipeline/components/rag-pipeline-main.tsx b/web/app/components/rag-pipeline/components/rag-pipeline-main.tsx index 5daf1f2ceb..137352f947 100644 --- a/web/app/components/rag-pipeline/components/rag-pipeline-main.tsx +++ b/web/app/components/rag-pipeline/components/rag-pipeline-main.tsx @@ -70,21 +70,21 @@ const RagPipelineMain = ({ ...configsMap, }) const { - hasNodeInspectVars, - hasSetInspectVar, - fetchInspectVarValue, - editInspectVarValue, - renameInspectVarName, - appendNodeInspectVars, - deleteInspectVar, - deleteNodeInspectorVars, - deleteAllInspectorVars, - isInspectVarEdited, - resetToLastRunVar, - invalidateSysVarValues, - resetConversationVar, - invalidateConversationVarValues, - } = useInspectVarsCrud() + hasNodeInspectVars, + hasSetInspectVar, + fetchInspectVarValue, + editInspectVarValue, + renameInspectVarName, + appendNodeInspectVars, + deleteInspectVar, + deleteNodeInspectorVars, + deleteAllInspectorVars, + isInspectVarEdited, + resetToLastRunVar, + invalidateSysVarValues, + resetConversationVar, + invalidateConversationVarValues, + } = useInspectVarsCrud() const hooksStore = useMemo(() => { return { diff --git a/web/app/components/workflow-app/hooks/use-DSL.ts b/web/app/components/workflow-app/hooks/use-DSL.ts index 372eb2c850..1fedfc8bed 100644 --- a/web/app/components/workflow-app/hooks/use-DSL.ts +++ b/web/app/components/workflow-app/hooks/use-DSL.ts @@ -22,7 +22,7 @@ export const useDSL = () => { const appDetail = useAppStore(s => s.appDetail) - const handleExportDSL = useCallback(async (include = false) => { + const handleExportDSL = useCallback(async (include = false, workflowId?: string) => { if (!appDetail) return @@ -35,6 +35,7 @@ export const useDSL = () => { const { data } = await exportAppConfig({ appID: appDetail.id, include, + workflowID: workflowId, }) const a = document.createElement('a') const file = new Blob([data], { type: 'application/yaml' }) diff --git a/web/app/components/workflow/block-selector/all-tools.tsx b/web/app/components/workflow/block-selector/all-tools.tsx index b5a722ada4..6a2e07a411 100644 --- a/web/app/components/workflow/block-selector/all-tools.tsx +++ b/web/app/components/workflow/block-selector/all-tools.tsx @@ -26,7 +26,6 @@ import { PluginType } from '../../plugins/types' import { useMarketplacePlugins } from '../../plugins/marketplace/hooks' import { useGlobalPublicStore } from '@/context/global-public-context' import RAGToolSuggestions from './rag-tool-suggestions' -import { useRAGRecommendedPlugins } from '@/service/use-tools' type AllToolsProps = { className?: string @@ -117,13 +116,7 @@ const AllTools = ({ const wrapElemRef = useRef(null) const isSupportGroupView = [ToolTypeEnum.All, ToolTypeEnum.BuiltIn].includes(activeTab) - const isShowRAGRecommendations = isInRAGPipeline && activeTab === ToolTypeEnum.All && !searchText && tags.length === 0 - const { data: ragRecommendedPlugins } = useRAGRecommendedPlugins(isShowRAGRecommendations) - const recommendedPlugins = useMemo(() => { - if (ragRecommendedPlugins) - return [...ragRecommendedPlugins.installed_recommended_plugins] - return [] - }, [ragRecommendedPlugins]) + const isShowRAGRecommendations = isInRAGPipeline && activeTab === ToolTypeEnum.All && !hasFilter return (
@@ -154,9 +147,8 @@ const AllTools = ({ className='max-h-[464px] overflow-y-auto' onScroll={pluginRef.current?.handleScroll} > - {recommendedPlugins.length > 0 && ( + {isShowRAGRecommendations && ( (({ disableMaxWidth = false, }, ref) => { const { t } = useTranslation() - const hasFilter = !searchText + const noFilter = !searchText && tags.length === 0 const hasRes = list.length > 0 const urlWithSearchText = getMarketplaceUrl('', { q: searchText, tags: tags.join(',') }) const nextToStickyELemRef = useRef(null) @@ -66,7 +66,7 @@ const List = forwardRef(({ window.open(urlWithSearchText, '_blank') } - if (hasFilter) { + if (noFilter) { return ( (({ onAction={noop} /> ))} - {list.length > 0 && ( + {hasRes && (
> } const RAGToolSuggestions: React.FC = ({ - tools, viewType, onSelect, onTagsChange, }) => { const { t } = useTranslation() + const { + data: ragRecommendedPlugins, + isFetching: isFetchingRAGRecommendedPlugins, + } = useRAGRecommendedPlugins() + + const recommendedPlugins = useMemo(() => { + if (ragRecommendedPlugins) + return [...ragRecommendedPlugins.installed_recommended_plugins] + return [] + }, [ragRecommendedPlugins]) + const loadMore = useCallback(() => { onTagsChange((prev) => { if (prev.includes('rag')) @@ -35,26 +48,52 @@ const RAGToolSuggestions: React.FC = ({
{t('pipeline.ragToolSuggestions.title')}
- -
-
- + {isFetchingRAGRecommendedPlugins && ( +
+
-
- {t('common.operation.more')} -
-
+ )} + {!isFetchingRAGRecommendedPlugins && recommendedPlugins.length === 0 && ( +

+ + ), + }} + /> +

+ )} + {!isFetchingRAGRecommendedPlugins && recommendedPlugins.length > 0 && ( + <> + +
+
+ +
+
+ {t('common.operation.more')} +
+
+ + )}
) } diff --git a/web/app/components/workflow/hooks-store/store.ts b/web/app/components/workflow/hooks-store/store.ts index 4e8c189c49..562faee06b 100644 --- a/web/app/components/workflow/hooks-store/store.ts +++ b/web/app/components/workflow/hooks-store/store.ts @@ -48,7 +48,7 @@ export type CommonHooksFnMap = { availableNodesMetaData?: AvailableNodesMetaData getWorkflowRunAndTraceUrl: (runId?: string) => { runUrl: string; traceUrl: string } exportCheck?: () => Promise - handleExportDSL?: (include?: boolean) => Promise + handleExportDSL?: (include?: boolean, flowId?: string) => Promise fetchInspectVars: (params: { passInVars?: boolean, vars?: VarInInspect[], passedInAllPluginInfoList?: Record, passedInSchemaTypeDefinitions?: SchemaTypeDefinition[] }) => Promise hasNodeInspectVars: (nodeId: string) => boolean hasSetInspectVar: (nodeId: string, name: string, sysVars: VarInInspect[], conversationVars: VarInInspect[]) => boolean diff --git a/web/app/components/workflow/panel/version-history-panel/index.tsx b/web/app/components/workflow/panel/version-history-panel/index.tsx index 5c20da1ac1..eeb4f50720 100644 --- a/web/app/components/workflow/panel/version-history-panel/index.tsx +++ b/web/app/components/workflow/panel/version-history-panel/index.tsx @@ -120,7 +120,7 @@ export const VersionHistoryPanel = ({ }) break case VersionHistoryContextMenuOptions.exportDSL: - handleExportDSL(false, item.id) + handleExportDSL?.(false, item.id) break } }, [t, handleExportDSL]) diff --git a/web/app/components/workflow/variable-inspect/display-content.tsx b/web/app/components/workflow/variable-inspect/display-content.tsx index 06af502b26..f9f23212c0 100644 --- a/web/app/components/workflow/variable-inspect/display-content.tsx +++ b/web/app/components/workflow/variable-inspect/display-content.tsx @@ -22,10 +22,11 @@ type DisplayContentProps = { readonly: boolean handleTextChange?: (value: string) => void handleEditorChange?: (value: string) => void + className?: string } const DisplayContent = (props: DisplayContentProps) => { - const { previewType, varType, schemaType, mdString, jsonString, readonly, handleTextChange, handleEditorChange } = props + const { previewType, varType, schemaType, mdString, jsonString, readonly, handleTextChange, handleEditorChange, className } = props const [viewMode, setViewMode] = useState(ViewMode.Code) const [isFocused, setIsFocused] = useState(false) const { t } = useTranslation() @@ -50,7 +51,7 @@ const DisplayContent = (props: DisplayContentProps) => { }, [previewType, schemaType, jsonString]) return ( -
+
{previewType === PreviewType.Markdown && (
diff --git a/web/app/components/workflow/variable-inspect/value-content.tsx b/web/app/components/workflow/variable-inspect/value-content.tsx index 4919acfad9..3414164143 100644 --- a/web/app/components/workflow/variable-inspect/value-content.tsx +++ b/web/app/components/workflow/variable-inspect/value-content.tsx @@ -198,6 +198,7 @@ const ValueContent = ({ mdString={value as any} readonly={textEditorDisabled} handleTextChange={handleTextChange} + className={cn(isTruncated && 'pt-[36px]')} /> ) : (