Skip to content

Commit

Permalink
4.8.10 test (#2401)
Browse files Browse the repository at this point in the history
* perf: i18n

* perf: i18n and img tip

* perf: readme

* perf: hide tool ai response

* fix: copy app

* fix: parse image url regx

* perf: folder collection forbid update
  • Loading branch information
c121914yu authored Aug 16, 2024
1 parent 5bf0dd0 commit 61347d9
Show file tree
Hide file tree
Showing 29 changed files with 344 additions and 282 deletions.
Binary file modified .github/imgs/intro1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/imgs/intro2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/imgs/intro3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/imgs/intro4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions docSite/content/zh-cn/docs/development/upgrading/4810.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ weight: 816
3. 新增 - 用户选择节点(Debug 模式暂未支持)
4. 商业版新增 - 飞书机器人接入
5. 商业版新增 - 公众号接入接入
6. 修复 - Prompt 模式调用工具,stream=false 模式下,会携带 0: 开头标记。
7. 修复 - 对话日志鉴权问题:仅为 APP 管理员的用户,无法查看对话日志详情。
8. 修复 - 选择 Milvus 部署时,无法导出知识库。
6. 优化 - 知识库集合禁用,目录禁用会递归修改其下所有 children 的禁用状态。
7. 修复 - Prompt 模式调用工具,stream=false 模式下,会携带 0: 开头标记。
8. 修复 - 对话日志鉴权问题:仅为 APP 管理员的用户,无法查看对话日志详情。
9. 修复 - 选择 Milvus 部署时,无法导出知识库。
10. 修复 - 创建 APP 副本,无法复制系统配置。
11. 修复 - 图片识别模式下,自动解析图片链接正则不够严谨问题。
5 changes: 3 additions & 2 deletions docSite/content/zh-cn/docs/use-cases/feishu.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
title: "教程 - 接入飞书机器人"
description: "FastGPT 接入飞书机器人"
title: "接入飞书机器人教程"
description: "FastGPT 接入飞书机器人教程"
icon: "chat"
draft: false
toc: true
weight: 507
---

## 1. 申请飞书应用

开一个免费的测试企业更方便进行调试。
Expand Down
14 changes: 8 additions & 6 deletions packages/global/core/workflow/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { i18nT } from '../../../web/i18n/utils';

export enum FlowNodeTemplateTypeEnum {
systemInput = 'systemInput',
ai = 'ai',
Expand Down Expand Up @@ -181,23 +183,23 @@ export enum VariableInputEnum {
export const variableMap = {
[VariableInputEnum.input]: {
icon: 'core/app/variable/input',
title: 'core.module.variable.input type',
title: i18nT('common:core.module.variable.input type'),
desc: ''
},
[VariableInputEnum.textarea]: {
icon: 'core/app/variable/textarea',
title: 'core.module.variable.textarea type',
desc: '允许用户最多输入4000字的对话框。'
title: i18nT('common:core.module.variable.textarea type'),
desc: i18nT('app:variable.textarea_type_desc')
},
[VariableInputEnum.select]: {
icon: 'core/app/variable/select',
title: 'core.module.variable.select type',
title: i18nT('common:core.module.variable.select type'),
desc: ''
},
[VariableInputEnum.custom]: {
icon: 'core/app/variable/external',
title: 'core.module.variable.Custom type',
desc: '可以定义一个无需用户填写的全局变量。\n该变量的值可以来自于 API 接口,分享链接的 Query 或通过【变量更新】模块进行赋值。'
title: i18nT('common:core.module.variable.Custom type'),
desc: i18nT('app:variable.select type_desc')
}
};

Expand Down
3 changes: 2 additions & 1 deletion packages/service/core/chat/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export const loadRequestMessages = async ({
}

// 正则表达式匹配图片URL
const imageRegex = /(https?:\/\/.*\.(?:png|jpe?g|gif|webp|bmp|tiff?|svg|ico|heic|avif))/i;
const imageRegex =
/(https?:\/\/[^\s/$.?#].[^\s]*\.(?:png|jpe?g|gif|webp|bmp|tiff?|svg|ico|heic|avif))/i;

const result: { type: 'text' | 'image'; value: string }[] = [];
let lastIndex = 0;
Expand Down
5 changes: 5 additions & 0 deletions packages/service/core/workflow/dispatch/tools/http468.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,15 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
const requestBody = await (() => {
if (!httpJsonBody) return {};
try {
// Replace all variables in the string body
httpJsonBody = replaceVariable(httpJsonBody, allVariables);

// Text body, return directly
if (headers['Content-Type']?.includes('text/plain')) {
return httpJsonBody?.replaceAll(UNDEFINED_SIGN, 'null');
}

// Json body, parse and return
const jsonParse = JSON.parse(httpJsonBody);
const removeSignJson = removeUndefinedSign(jsonParse);
return removeSignJson;
Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/common/MyModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const MyModal = ({
closeOnOverlayClick = true,
...props
}: MyModalProps) => {
const isPc = useSystem();
const { isPc } = useSystem();

return (
<Modal
Expand Down
4 changes: 4 additions & 0 deletions packages/web/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@
},
"upload_file_max_amount": "Max files",
"upload_file_max_amount_tip": "1. The maximum number of files to be uploaded at a time.\n2. The maximum number of files that can be remembered in the dialog window: Files in the history are automatically retrieved for each round of conversation, and files that are out of range are forgotten.",
"variable": {
"select type_desc": "You can define a global variable that does not need to be filled in by the user.\n\nThe value of this variable can come from the API interface, the Query of the shared link, or be assigned through the [Variable Update] module.",
"textarea_type_desc": "A dialog box that allows the user to enter up to 4000 words."
},
"version": {
"Revert success": "Revert success"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/web/i18n/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,7 @@
"success": "Start syncing"
}
},
"training": {
}
"training": {}
},
"data": {
"Auxiliary Data": "Auxiliary data",
Expand Down Expand Up @@ -1270,7 +1269,9 @@
"Sub plan": "Subscription plan",
"Sub plan tip": "Free use of {{title}} or upgrade to a higher plan",
"Team plan and usage": "Plan and usage",
"web_site_sync": "Website sync",
"Training weight": "Training priority: {{weight}}",
"rerank": "Rerank",
"Update extra ai points": "Extra AI points",
"Update extra dataset size": "Extra storage",
"Upgrade plan": "Upgrade plan",
Expand Down
13 changes: 8 additions & 5 deletions packages/web/i18n/en/publish.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"app_key_tips": "These keys have the current application identification, refer to the document for specific use ",
"create_api_key": "Create new Key",
"create_link": "Create link",
"default_response": "Default Response",
"edit_api_key": "Edit Key information",
"edit_link": "Edit",
"feishu_name": "Lark",
"link_name": "Name of the share link",
"qpm_tips": "How many times per minute can each IP ask at most",
"qpm_is_empty": "QPM cannot be empty",
"app_key_tips": "These keys have the current application identification, refer to the document for specific use ",
"key_alias": "key alias, for display only ",
"key_tips": "You can use the API Key to access certain interfaces (you can't access the app, you need to use the API key within the app to access the app)",
"link_name": "Name of the share link",
"official_account": {
"params": "Wechat params"
},
"qpm_is_empty": "QPM cannot be empty",
"qpm_tips": "How many times per minute can each IP ask at most",
"token_auth": "Token authentication",
"token_auth_tips": "Identity verification server address, if this value is filled, a request will be sent to the specified server before each conversation to perform identity verification",
"token_auth_use_cases": "View usage instructions for identity verification"
}
}
4 changes: 4 additions & 0 deletions packages/web/i18n/zh/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@
},
"upload_file_max_amount": "最大文件数量",
"upload_file_max_amount_tip": "1.单次上传文件的最大数量。\n2.对话窗口记忆的最大文件数量:每轮对话会自动获取历史中的文件,超出范围的文件会被遗忘。",
"variable": {
"select type_desc": "可以定义一个无需用户填写的全局变量。\n该变量的值可以来自于 API 接口,分享链接的 Query 或通过【变量更新】模块进行赋值。",
"textarea_type_desc": "允许用户最多输入4000字的对话框。"
},
"version": {
"Revert success": "回滚成功"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/web/i18n/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,7 @@
"success": "开始同步"
}
},
"training": {
}
"training": {}
},
"data": {
"Auxiliary Data": "辅助数据",
Expand Down Expand Up @@ -1286,6 +1285,8 @@
"Sub plan tip": "免费使用 {{title}} 或升级更高的套餐",
"Team plan and usage": "套餐与用量",
"Training weight": "训练优先级:{{weight}}",
"web_site_sync": "Web 站点同步",
"rerank": "检索结果重排",
"Update extra ai points": "额外 AI 积分",
"Update extra dataset size": "额外存储量",
"Upgrade plan": "升级套餐",
Expand Down
49 changes: 25 additions & 24 deletions packages/web/i18n/zh/publish.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
{
"publish_name": "名称",
"app_key_tips": "这些 key 已有当前应用标识,具体使用可参考文档",
"basic_info": "基本信息",
"copy_link_hint": "将下面链接复制到指定位置",
"create_api_key": "创建新 key",
"create_link": "创建链接",
"default_response": "默认回复",
"edit_api_key": "编辑 key 信息",
"edit_feishu_bot": "编辑飞书机器人",
"edit_link": "编辑",
"feishu_api": "飞书接口",
"feishu_bot": "飞书机器人",
"feishu_bot_desc": "通过 API 直接接入飞书机器人",
"feishu_name": "飞书",
"new_feishu_bot": "新增飞书机器人",
"edit_feishu_bot": "编辑飞书机器人",
"link_name": "分享链接的名字",
"qpm_tips": "每个 IP 每分钟最多提问多少次",
"qpm_is_empty": "QPM 不能为空",
"app_key_tips": "这些 key 已有当前应用标识,具体使用可参考文档",
"key_alias": "key 的别名,仅用于展示",
"key_tips": "你可以使用 API 秘钥访问一些特定的接口(无法访问应用,访问应用需使用应用内的 API key)",
"link_name": "分享链接的名字",
"new_feishu_bot": "新增飞书机器人",
"official_account": {
"api": "微信公众号 API",
"create_modal_title": "创建微信公众号接入",
"desc": "通过 API 直接接入微信公众号",
"edit_modal_title": "编辑微信公众号接入",
"name": "微信公众号接入",
"params": "微信公众号参数"
},
"publish_name": "名称",
"qpm_is_empty": "QPM 不能为空",
"qpm_tips": "每个 IP 每分钟最多提问多少次",
"request_address": "请求地址",
"show_share_link_modal_title": "开始使用",
"token_auth": "身份验证",
"token_auth_tips": "身份校验服务器地址,如填写该值,每次对话前都会向指定服务器发送一个请求,进行身份校验",
"token_auth_use_cases": "查看身份验证使用说明",
"show_share_link_modal_title": "开始使用",
"request_address": "请求地址",
"basic_info": "基本信息",
"feishu_api": "飞书接口",
"feishu_bot": "飞书机器人",
"feishu_bot_desc": "通过 API 直接接入飞书机器人",
"copy_link_hint": "将下面链接复制到指定位置",
"wecom": {
"title": "发布到企业微信机器人",
"api": "企微 API",
"bot": "企业微信机器人",
"bot_desc": "通过 API 直接接入企业微信机器人",
"edit_modal_title": "编辑企微机器人",
"create_modal_title": "创建企微机器人",
"api": "企微 API"
},
"official_account": {
"name": "微信公众号接入",
"desc": "通过 API 直接接入微信公众号",
"edit_modal_title": "编辑微信公众号接入",
"create_modal_title": "创建微信公众号接入",
"api": "微信公众号 API"
"edit_modal_title": "编辑企微机器人",
"title": "发布到企业微信机器人"
}
}
4 changes: 4 additions & 0 deletions projects/app/public/imgs/app/fileinput.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 61347d9

Please sign in to comment.