Skip to content

Commit

Permalink
4.8.10 test (#2433)
Browse files Browse the repository at this point in the history
* perf: node template ui

* perf: select tool path load error

* pay i18n

* i18n

* perf: oneapi code

* perf: doc

* node templates

* perf: usage table role

* feat: count vector total by datasetId

* perf: user select tip and tempalte market ui

* i18n

* perf: sso config tip
  • Loading branch information
c121914yu authored Aug 20, 2024
1 parent 40b1d22 commit 26d8009
Show file tree
Hide file tree
Showing 27 changed files with 345 additions and 160 deletions.
4 changes: 2 additions & 2 deletions docSite/content/zh-cn/docs/course/official_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ weight: 113

![图片](/imgs/offiaccount-1.png)

## 2. 登陆微信公众平台,获取 AppID 、 Secret和Token
## 2. 登录微信公众平台,获取 AppID 、 Secret和Token

### 1. https://mp.weixin.qq.com 登陆微信公众平台,选择您的公众号。
### 1. https://mp.weixin.qq.com 登录微信公众平台,选择您的公众号。

**只支持通过验证的公众号,未通过验证的公众号暂不支持。**

Expand Down
4 changes: 2 additions & 2 deletions docSite/content/zh-cn/docs/course/openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ weight: 112

在 FastGPT 中,你可以为每一个应用创建多个 API 密钥,用于访问应用的 API 接口。每个密钥仅能访问一个应用。完整的接口可以[查看应用对话接口](/docs/development/openapi/chat)

## 获取 API 秘钥
## 获取 API 密钥

依次选择应用 -> 「API访问」,然后点击「API 密钥」来创建密钥。

Expand All @@ -28,7 +28,7 @@ Tips: 安全起见,你可以设置一个额度或者过期时间,放置 key

```bash
OPENAI_API_BASE_URL: https://api.fastgpt.in/api (改成自己部署的域名)
OPENAI_API_KEY = 上一步获取到的秘钥
OPENAI_API_KEY = 上一步获取到的密钥
```

**[ChatGPT Next Web](https://github.com/Yidadaa/ChatGPT-Next-Web) 示例:**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ docker exec -it mongo mongorestore -u "username" -p "password" --authenticationD
5.重启容器 【C环境】
```
docker compose restart
docker logs -f mongo **强烈建议先检查mongo运行情况,在去做登陆动作,如果mongo报错,访问web也会报错”
docker logs -f mongo **强烈建议先检查mongo运行情况,在去做登录动作,如果mongo报错,访问web也会报错”
```

如果mongo启动正常,显示的是类似这样的,而不是 “mongo is restarting”,后者就是错误
Expand All @@ -182,5 +182,5 @@ docker logs -f mongo **强烈建议先检查mongo运行情况,在去做登陆
<img width="508" alt="iShot_2024-05-09_19 23 13" src="https://github.com/labring/FastGPT/assets/103937568/2e2afc9f-484c-4b63-93ee-1c14aef03de0">


6. 启动fastgpt容器服务后,登陆新fastgpt web,能看到原来的数据库内容完整显示,说明已经导入系统了。
6. 启动fastgpt容器服务后,登录新fastgpt web,能看到原来的数据库内容完整显示,说明已经导入系统了。
<img width="1728" alt="iShot_2024-05-09_19 23 51" src="https://github.com/labring/FastGPT/assets/103937568/846b6157-6b6a-4468-a1d9-c44d681ebf7c">
25 changes: 17 additions & 8 deletions docSite/content/zh-cn/docs/development/upgrading/4810.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: 'FastGPT V4.8.10 更新说明'
icon: 'upgrade'
draft: false
toc: true
weight: 816
weight: 814
---

## 更新指南
Expand All @@ -13,7 +13,13 @@ weight: 816

### 2. 更新商业版环境变量

商业版用户,需要给`fastgpt-pro`镜像,增加沙盒的环境变量:`SANDBOX_URL=http://fastgpt-sandbox.ns-hti44k5d.svc.cluster.local:3000`
1. 需要给`fastgpt-pro`镜像,增加沙盒的环境变量:`SANDBOX_URL=http://xxxxx:3000`
2. 给两个镜像增加环境变量,以便更好的存储系统日志:

```
LOG_LEVEL=debug
STORE_LOG_LEVEL=warn
```

-------

Expand All @@ -24,9 +30,12 @@ weight: 816
3. 新增 - 用户选择节点(Debug 模式暂未支持)
4. 商业版新增 - 飞书机器人接入
5. 商业版新增 - 公众号接入接入
6. 优化 - 知识库集合禁用,目录禁用会递归修改其下所有 children 的禁用状态。
7. 修复 - Prompt 模式调用工具,stream=false 模式下,会携带 0: 开头标记。
8. 修复 - 对话日志鉴权问题:仅为 APP 管理员的用户,无法查看对话日志详情。
9. 修复 - 选择 Milvus 部署时,无法导出知识库。
10. 修复 - 创建 APP 副本,无法复制系统配置。
11. 修复 - 图片识别模式下,自动解析图片链接正则不够严谨问题。
6. 商业版新增 - 自助开票申请
7. 商业版新增 - SSO 定制
8. 优化 - 知识库集合禁用,目录禁用会递归修改其下所有 children 的禁用状态。
9. 优化 - 节点选择,避免切换 tab 时候,path 加载报错。
10. 修复 - Prompt 模式调用工具,stream=false 模式下,会携带 0: 开头标记。
11. 修复 - 对话日志鉴权问题:仅为 APP 管理员的用户,无法查看对话日志详情。
12. 修复 - 选择 Milvus 部署时,无法导出知识库。
13. 修复 - 创建 APP 副本,无法复制系统配置。
14. 修复 - 图片识别模式下,自动解析图片链接正则不够严谨问题。
4 changes: 2 additions & 2 deletions docSite/content/zh-cn/docs/use-cases/onwechat.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ weight: 504

由于 FastGPT 的 API 接口和 OpenAI 的规范一致,可以无需变更原来的应用即可使用 FastGPT 上编排好的应用。API 使用可参考 [这篇文章](/docs/course/openapi/)。编排示例,可参考 [高级编排介绍](/docs/workflow/intro)

## 1. 获取 OpenAPI 秘钥
## 1. 获取 OpenAPI 密钥

依次选择应用 -> 「API访问」,然后点击「API 密钥」来创建密钥。

Expand All @@ -26,7 +26,7 @@ weight: 504

## 3. 创建 docker-compose.yml 文件

只需要修改 `OPEN_AI_API_KEY``OPEN_AI_API_BASE` 两个环境变量即可。其中 `OPEN_AI_API_KEY` 为第一步获取的秘钥`OPEN_AI_API_BASE` 为 FastGPT 的 OpenAPI 地址,例如:`https://api.fastgpt.in/api/v1`
只需要修改 `OPEN_AI_API_KEY``OPEN_AI_API_BASE` 两个环境变量即可。其中 `OPEN_AI_API_KEY` 为第一步获取的密钥`OPEN_AI_API_BASE` 为 FastGPT 的 OpenAPI 地址,例如:`https://api.fastgpt.in/api/v1`

随便找一个目录,创建一个 docker-compose.yml 文件,将下面的代码复制进去。

Expand Down
8 changes: 4 additions & 4 deletions docSite/content/zh-cn/docs/use-cases/wechat.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ weight: 506

## 配置微秘书

打开[微秘书](https://wechat.aibotk.com?r=zWLnZK) 注册登陆后找到菜单栏「基础配置」->「智能配置」,按照下图配置。
打开[微秘书](https://wechat.aibotk.com?r=zWLnZK) 注册登录后找到菜单栏「基础配置」->「智能配置」,按照下图配置。

![](/imgs/wechat2.png)

Expand All @@ -27,7 +27,7 @@ weight: 506

## sealos部署服务

[访问sealos](https://cloud.sealos.run/) 登陆进来之后打开「应用管理」-> 「新建应用」。
[访问sealos](https://cloud.sealos.run/) 登录进来之后打开「应用管理」-> 「新建应用」。
- 应用名:称随便填写
- 镜像名:私人微信填写 aibotk/wechat-assistant 企业微信填写 aibotk/worker-assistant
- cpu和内存建议 1c1g
Expand Down Expand Up @@ -61,12 +61,12 @@ WORK_PRO_TOKEN=你申请的企微 token (企业微信需要填写,私人

![](/imgs/wechat8.png)

返回[微秘书](https://wechat.aibotk.com?r=zWLnZK) 找到「首页」,扫码登陆需要接入的微信号
返回[微秘书](https://wechat.aibotk.com?r=zWLnZK) 找到「首页」,扫码登录需要接入的微信号

![](/imgs/wechat9.png)

## 测试
只需要发送信息,或者拉入群聊@登陆的微信就会回复信息啦
只需要发送信息,或者拉入群聊@登录的微信就会回复信息啦
![](/imgs/wechat10.png)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export const UserSelectNode: FlowNodeTemplateType = {
key: NodeInputKeyEnum.description,
renderTypeList: [FlowNodeInputTypeEnum.textarea],
valueType: WorkflowIOValueTypeEnum.string,
label: i18nT('app:workflow.select_description')
label: i18nT('app:workflow.select_description'),
description: i18nT('app:workflow.select_description_tip'),
placeholder: i18nT('app:workflow.select_description_placeholder')
},
{
key: NodeInputKeyEnum.userSelectOptions,
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/type/node.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export type NodeTemplateListItemType = {
name: string;
intro?: string; // template list intro
isTool?: boolean;
authorAvatar?: string;
author?: string;
unique?: boolean; // 唯一的
currentCost?: number; // 当前积分消耗
Expand Down
1 change: 1 addition & 0 deletions packages/service/common/vectorStore/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const deleteDatasetDataVector = Vector.delete;
export const recallFromVectorStore = Vector.embRecall;
export const getVectorDataByTime = Vector.getVectorDataByTime;
export const getVectorCountByTeamId = Vector.getVectorCountByTeamId;
export const getVectorCountByDatasetId = Vector.getVectorCountByDatasetId;

export const insertDatasetDataVector = async ({
model,
Expand Down
14 changes: 14 additions & 0 deletions packages/service/common/vectorStore/milvus/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,20 @@ export class MilvusCtrl {

return total;
};
getVectorCountByDatasetId = async (teamId: string, datasetId: string) => {
const client = await this.getClient();

const result = await client.query({
collection_name: DatasetVectorTableName,
output_fields: ['count(*)'],
filter: `(teamId == "${String(teamId)}") and (dataset == "${String(datasetId)}")`
});

const total = result.data?.[0]?.['count(*)'] as number;

return total;
};

getVectorDataByTime = async (start: Date, end: Date) => {
const client = await this.getClient();
const startTimestamp = new Date(start).getTime();
Expand Down
21 changes: 14 additions & 7 deletions packages/service/common/vectorStore/pg/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,6 @@ export class PgVectorCtrl {
});
}
};
getVectorCountByTeamId = async (teamId: string) => {
const total = await PgClient.count(DatasetVectorTableName, {
where: [['team_id', String(teamId)]]
});

return total;
};
getVectorDataByTime = async (start: Date, end: Date) => {
const { rows } = await PgClient.query<{
id: string;
Expand All @@ -230,4 +223,18 @@ export class PgVectorCtrl {
datasetId: item.dataset_id
}));
};
getVectorCountByTeamId = async (teamId: string) => {
const total = await PgClient.count(DatasetVectorTableName, {
where: [['team_id', String(teamId)]]
});

return total;
};
getVectorCountByDatasetId = async (teamId: string, datasetId: string) => {
const total = await PgClient.count(DatasetVectorTableName, {
where: [['team_id', String(teamId)], 'and', ['dataset_id', String(datasetId)]]
});

return total;
};
}
2 changes: 1 addition & 1 deletion packages/service/core/workflow/dispatch/chat/oneapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
systemPrompt,
stringQuoteText
}),
(async () => {
(() => {
// censor model and system key
if (modelConstantsData.censor && !user.openaiAccount?.key) {
return postTextCensor({
Expand Down
2 changes: 1 addition & 1 deletion packages/service/core/workflow/dispatch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons

// start process width initInput
const entryNodes = runtimeNodes.filter((item) => item.isEntry);
console.log(runtimeEdges);

// reset entry
// runtimeNodes.forEach((item) => {
// item.isEntry = false;
Expand Down
1 change: 1 addition & 0 deletions packages/web/components/common/Tabs/FillRowTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const FillRowTabs = ({ list, value, onChange, py = '7px', px = '12px', ...props
key={item.value}
flex={'1 0 0'}
alignItems={'center'}
justifyContent={'center'}
cursor={'pointer'}
borderRadius={'md'}
px={px}
Expand Down
2 changes: 2 additions & 0 deletions packages/web/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@
"read_files_result_desc": "The original text of the document consists of the file name and the document content. Multiple files are separated by horizontal lines.",
"read_files_tip": "Parse all uploaded documents in the conversation and return the corresponding document content",
"select_description": "Select description",
"select_description_placeholder": "For example: \n\nAre there any tomatoes in the refrigerator?",
"select_description_tip": "You can add a descriptive text to explain to users what each option represents.",
"select_result": "Select result",
"template": {
"communication": "Communication"
Expand Down
7 changes: 4 additions & 3 deletions packages/web/i18n/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,11 @@
"AI function": "AI function",
"AI response switch tip": "If you wish the current node not to output content, you can turn off this switch. AI output content will not be displayed to the user, you can manually use 'AI response content' for special processing.",
"AI support tool tip": "Supports function calls model, can better use tool invocation.",
"Basic Node": "Basic function",
"Basic Node": "Basic",
"Query extension": "Question optimization",
"System Plugin": "System plugin",
"System Plugin": "System",
"System input module": "System input",
"Team Plugin": "Team plugin",
"Team Plugin": "Team",
"Tool module": "Tool",
"UnKnow Module": "Unknown module",
"http body placeholder": "Same syntax as APIFox"
Expand Down Expand Up @@ -1091,6 +1091,7 @@
"confirm_pay": "confirm payment",
"get_pay_QR": "Get the recharge QR code",
"need_pay": "Need to pay",
"need_to_pay": "Actually paid",
"new_package_price": "New package price",
"notice": "Do not close the page",
"old_package_price": "Old package price",
Expand Down
2 changes: 2 additions & 0 deletions packages/web/i18n/zh/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
"read_files_result_desc": "文档原文,由文件名和文档内容组成,多个文件之间通过横线隔开。",
"read_files_tip": "解析对话中所有上传的文档,并返回对应文档内容",
"select_description": "说明文字",
"select_description_placeholder": "例如: \n冰箱里是否有西红柿?",
"select_description_tip": "你可以添加一段说明文字,用以向用户说明每个选项代表的含义。",
"select_result": "选择的结果",
"template": {
"communication": "通信"
Expand Down
Loading

0 comments on commit 26d8009

Please sign in to comment.