diff --git a/test/testcases/test_web_api/test_chunk_feedback/__init__.py b/test/testcases/test_web_api/test_chunk_feedback/__init__.py index 177b91dd0..1a080087b 100644 --- a/test/testcases/test_web_api/test_chunk_feedback/__init__.py +++ b/test/testcases/test_web_api/test_chunk_feedback/__init__.py @@ -12,4 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# + +from rag.flow.chunker.token_chunker import TokenChunker, TokenChunkerParam + +__all__ = ["TokenChunker", "TokenChunkerParam"] diff --git a/web/src/pages/agents/use-import-json.ts b/web/src/pages/agents/use-import-json.ts index 091d20598..6cda70873 100644 --- a/web/src/pages/agents/use-import-json.ts +++ b/web/src/pages/agents/use-import-json.ts @@ -8,6 +8,7 @@ import { Node } from '@xyflow/react'; import isEmpty from 'lodash/isEmpty'; import { useCallback } from 'react'; import { useTranslation } from 'react-i18next'; +import { buildDslComponentsByGraph } from '../agent/utils'; import { DataflowEmptyDsl } from './hooks/use-create-agent'; import { FormSchemaType } from './upload-agent-dialog/upload-agent-form'; @@ -65,6 +66,14 @@ export const useHandleImportJsonFile = () => { dsl.variables = graphOrDsl.variables; } + if (Array.isArray(graph?.nodes) && Array.isArray(graph?.edges)) { + dsl.components = buildDslComponentsByGraph( + graph.nodes as any, + graph.edges as any, + graphOrDsl.components ?? dsl.components, + ); + } + setAgent({ title: name, dsl,