Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` 。可以按照如下示例配置:
Expand Down Expand Up @@ -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` 的目录地址即可。

---------
## 快速开始

Expand Down
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/locale/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
// 从右向左合并(右侧优先级更高)
Expand All @@ -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
}
};

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/addFlow/components/elsa-stage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/components/edit-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/configForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/detailFlow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/shared/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down