diff --git a/README.md b/README.md index 04159ef52..ff87b1668 100644 --- a/README.md +++ b/README.md @@ -206,20 +206,6 @@ fit debug - 环境要求:node.js >= 20 -- ELSA 框架编译产物:参考 [ELSA](https://github.com/ModelEngine-Group/fit-framework/blob/main/framework/elsa/README.md) 的编译构建章节 - -**修改 ELSA 依赖地址** - -进入目录 `app-platform/frontend` ,搜索 `package.json` 文件的 ELSA 依赖地址: - -``` -"dependencies": { - "@fit-elsa/elsa-core": "file:${fitElsaCoreUrl}", - "@fit-elsa/elsa-react": "file:${fitElsaReactUrl}", -``` - -将 `${fitElsaCoreUrl}` 和 `${fitElsaReactUrl}` 分别改成 `ELSA` 框架编译产物 `fit-elsa-core` 和 `fit-react` 的目录地址即可。 - **修改代理文件** 修改 `app-platform/frontend` 目录下的 `proxy.config.json` 文件,可以修改需要访问的后端地址。如本地后端地址是 `http://127.0.0.1:8080` 。可以按照如下示例配置: @@ -257,6 +243,23 @@ npm run build:single ``` npm run start ``` + +### 联调ELSA配置 + +- ELSA 框架编译产物:参考 [ELSA](https://github.com/ModelEngine-Group/fit-framework/blob/main/framework/elsa/README.md) 的编译构建章节 + +**修改 ELSA 依赖地址** + +进入目录 `app-platform/frontend` ,搜索 `package.json` 文件的 ELSA 依赖地址: + +``` +"dependencies": { + "@fit-elsa/elsa-core": "file:${fitElsaCoreUrl}", + "@fit-elsa/agent-flow": "file:${fitElsaReactUrl}", +``` + +将 `${fitElsaCoreUrl}` 和 `${fitElsaReactUrl}` 分别改成 `ELSA` 框架编译产物 `fit-elsa-core` 和 `fit-react` 的目录地址即可。 + --------- ## 快速开始 diff --git a/frontend/package.json b/frontend/package.json index 5bdb40d59..ef977b161 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -61,8 +61,8 @@ "ajv": "8.17.1" }, "dependencies": { - "@fit-elsa/elsa-core": "file:../../fit-framework/framework/elsa/fit-elsa", - "@fit-elsa/elsa-react": "file:../../fit-framework/framework/elsa/fit-elsa-react", + "@fit-elsa/elsa": "1.0.2", + "@fit-elsa/agent-flow": "1.0.0-alpha.6", "antd": "4.24.13", "axios": "1.8.2", "dayjs": "1.11.10", diff --git a/frontend/src/locale/i18n.ts b/frontend/src/locale/i18n.ts index c8bb2f004..d483357f9 100644 --- a/frontend/src/locale/i18n.ts +++ b/frontend/src/locale/i18n.ts @@ -7,10 +7,10 @@ import i18n from 'i18next'; import { initReactI18next } from "react-i18next"; import en from './en_US.json'; import zh from './zh_CN.json'; -import coreEn from '@fit-elsa/elsa-core/locales/en.json'; -import coreZh from '@fit-elsa/elsa-core/locales/zh.json'; -import reactEn from '@fit-elsa/elsa-react/locales/en.json'; -import reactZh from '@fit-elsa/elsa-react/locales/zh.json'; +import coreEn from '@fit-elsa/elsa/locales/en.json'; +import coreZh from '@fit-elsa/elsa/locales/zh.json'; +import agentEn from '@fit-elsa/agent-flow/locales/en.json'; +import agentZh from '@fit-elsa/agent-flow/locales/zh.json'; const mergeTranslations = (...translationObjects) => { // 从右向左合并(右侧优先级更高) @@ -21,10 +21,10 @@ const mergeTranslations = (...translationObjects) => { const resources = { en: { - translation: mergeTranslations(coreEn, reactEn, en) // 优先级顺序: en > reactEn > coreEn + translation: mergeTranslations(coreEn, agentEn, en) // 优先级顺序: en > agentEn > coreEn }, zh: { - translation: mergeTranslations(coreZh, reactZh, zh) // 优先级顺序: zh > reactZh > coreZh + translation: mergeTranslations(coreZh, agentZh, zh) // 优先级顺序: zh > agentZh > coreZh } }; diff --git a/frontend/src/pages/addFlow/components/elsa-stage.tsx b/frontend/src/pages/addFlow/components/elsa-stage.tsx index 56fc7ff7b..6dd6a02af 100644 --- a/frontend/src/pages/addFlow/components/elsa-stage.tsx +++ b/frontend/src/pages/addFlow/components/elsa-stage.tsx @@ -7,7 +7,7 @@ import React, { useEffect, useCallback, useState, useRef, useImperativeHandle, useContext } from 'react'; import { Button, Alert, Spin } from 'antd'; import { useParams } from 'react-router-dom'; -import { JadeFlow } from '@fit-elsa/elsa-react'; +import { JadeFlow } from '@fit-elsa/agent-flow'; import { validate } from '../utils'; import AddKnowledge from '../../configForm/configUi/components/add-knowledge'; import HuggingFaceModal from './hugging-face-modal'; diff --git a/frontend/src/pages/components/edit-modal.tsx b/frontend/src/pages/components/edit-modal.tsx index 341af6ab0..2dc063875 100644 --- a/frontend/src/pages/components/edit-modal.tsx +++ b/frontend/src/pages/components/edit-modal.tsx @@ -18,7 +18,7 @@ import { APP_TYPE, APP_BUILT_TYPE, APP_BUILT_CLASSIFICATION } from './common/com import { useTranslation } from 'react-i18next'; import { findConfigItem, getConfigValue } from '@/shared/utils/common'; import { convertImgPath } from '@/common/util'; -import { createGraphOperator } from '@fit-elsa/elsa-react'; +import { createGraphOperator } from '@fit-elsa/agent-flow'; import { pick, isEmpty } from 'lodash'; import assistant from '@/assets/images/appdevelop/assistant.png'; import agent from '@/assets/images/appdevelop/agent.png'; diff --git a/frontend/src/pages/components/header.tsx b/frontend/src/pages/components/header.tsx index f5412d45b..16cc534a9 100644 --- a/frontend/src/pages/components/header.tsx +++ b/frontend/src/pages/components/header.tsx @@ -18,7 +18,7 @@ import { Message } from "@/shared/utils/message"; import { setAppInfo, setValidateInfo } from '@/store/appInfo/appInfo'; import { getCheckList, exportApp, updateAppInfo, updateFlowInfo } from '@/shared/http/aipp'; import { convertImgPath } from '@/common/util'; -import { createGraphOperator } from '@fit-elsa/elsa-react'; +import { createGraphOperator } from '@fit-elsa/agent-flow'; import { get, cloneDeep } from 'lodash'; import TimeLineDrawer from '@/components/timeLine'; import PublishModal from './publish-modal'; diff --git a/frontend/src/pages/configForm/index.tsx b/frontend/src/pages/configForm/index.tsx index da17358d0..cab4598e7 100644 --- a/frontend/src/pages/configForm/index.tsx +++ b/frontend/src/pages/configForm/index.tsx @@ -13,7 +13,7 @@ import './index.scoped.scss'; import './configUi/index.scoped.scss'; import { setConfigData } from '@/store/appConfig/config'; import { getConfigValue } from '@/shared/utils/common'; -import { createGraphOperator } from '@fit-elsa/elsa-react'; +import { createGraphOperator } from '@fit-elsa/agent-flow'; const ConfigForm = (props) => { const { diff --git a/frontend/src/pages/detailFlow/index.tsx b/frontend/src/pages/detailFlow/index.tsx index f37b94230..bcd6be28a 100644 --- a/frontend/src/pages/detailFlow/index.tsx +++ b/frontend/src/pages/detailFlow/index.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState } from 'react'; import { LeftArrowIcon } from '@/assets/icon'; import { useParams } from 'react-router-dom'; import { getAppInfo } from '@/shared/http/aipp'; -import { JadeFlow } from '@fit-elsa/elsa-react'; +import { JadeFlow } from '@fit-elsa/agent-flow'; import { configMap } from '../addFlow/config'; import i18n from '../../locale/i18n'; import './index.scss'; diff --git a/frontend/src/shared/utils/common.ts b/frontend/src/shared/utils/common.ts index 677275919..2ba8ac65f 100644 --- a/frontend/src/shared/utils/common.ts +++ b/frontend/src/shared/utils/common.ts @@ -2,7 +2,7 @@ import { useLocation } from 'react-router-dom'; import { useCallback, useMemo, useState } from 'react'; import { pick, find, filter } from 'lodash'; import { Message } from '@/shared/utils/message'; -import { createGraphOperator } from '@fit-elsa/elsa-react'; +import { createGraphOperator } from '@fit-elsa/agent-flow'; import { storage } from '../storage'; import i18n from '@/locale/i18n'; import { getAppCategories } from "@/shared/http/aipp";