Compare commits
28 Commits
v4.8.19
...
v4.8.18-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47f7b1a7a3 | ||
|
|
fadb3e3ceb | ||
|
|
1c0b323b1b | ||
|
|
b26345dcaa | ||
|
|
cef8487ca1 | ||
|
|
ed619edd47 | ||
|
|
93cf5bb372 | ||
|
|
f556fbf0d5 | ||
|
|
07cc849877 | ||
|
|
2066094047 | ||
|
|
2bf1fce32a | ||
|
|
5465ca642f | ||
|
|
c0d0c629c5 | ||
|
|
20c6c202d2 | ||
|
|
c8f60b47d0 | ||
|
|
8b2be89350 | ||
|
|
a401d4d612 | ||
|
|
d24d29ac48 | ||
|
|
9abbc16036 | ||
|
|
28710ac05b | ||
|
|
3412d7009d | ||
|
|
c3480b0ffa | ||
|
|
f89212f35f | ||
|
|
03d1c6a651 | ||
|
|
5d1d4ff64f | ||
|
|
fd9600c6f8 | ||
|
|
efecfd44c3 | ||
|
|
1fc77a126a |
83
.github/workflows/fastgpt-image.yml
vendored
@@ -173,86 +173,3 @@ jobs:
|
||||
-t ${Docker_Hub_Tag} \
|
||||
-t ${Docker_Hub_Latest} \
|
||||
.
|
||||
build-fastgpt-images-sub-route-gchat:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
# install env
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt update && sudo apt install -y nodejs npm
|
||||
- name: Set up QEMU (optional)
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
driver-opts: network=host
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
# login docker
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GH_PAT }}
|
||||
- name: Login to Ali Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: registry.cn-hangzhou.aliyuncs.com
|
||||
username: ${{ secrets.ALI_HUB_USERNAME }}
|
||||
password: ${{ secrets.ALI_HUB_PASSWORD }}
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_NAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||
|
||||
# Set tag
|
||||
- name: Set image name and tag
|
||||
run: |
|
||||
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
||||
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
else
|
||||
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Build and publish image for main branch or tag push event
|
||||
env:
|
||||
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
|
||||
run: |
|
||||
docker buildx build \
|
||||
-f projects/app/Dockerfile \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--build-arg base_url=/gchat \
|
||||
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \
|
||||
--label "org.opencontainers.image.description=fastgpt-sub-route-gchat image" \
|
||||
--push \
|
||||
--cache-from=type=local,src=/tmp/.buildx-cache \
|
||||
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
||||
-t ${Git_Tag} \
|
||||
-t ${Git_Latest} \
|
||||
-t ${Ali_Tag} \
|
||||
-t ${Ali_Latest} \
|
||||
-t ${Docker_Hub_Tag} \
|
||||
-t ${Docker_Hub_Latest} \
|
||||
.
|
||||
|
||||
17
.github/workflows/preview-fastgpt-image.yml
vendored
@@ -51,23 +51,6 @@ jobs:
|
||||
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
||||
-t ${DOCKER_REPO_TAGGED} \
|
||||
.
|
||||
# Add write md step after build
|
||||
- name: Write md
|
||||
run: |
|
||||
echo "# 🤖 Generated by deploy action" > report.md
|
||||
echo "📦 Preview Image: \`${DOCKER_REPO_TAGGED}\`" >> report.md
|
||||
cat report.md
|
||||
|
||||
- name: Gh Rebot for Sealos
|
||||
uses: labring/gh-rebot@v0.0.6
|
||||
if: ${{ (github.event_name == 'pull_request_target') }}
|
||||
with:
|
||||
version: v0.0.6
|
||||
env:
|
||||
GH_TOKEN: '${{ secrets.GH_PAT }}'
|
||||
SEALOS_TYPE: 'pr_comment'
|
||||
SEALOS_FILENAME: 'report.md'
|
||||
SEALOS_REPLACE_TAG: 'DEFAULT_REPLACE_DEPLOY'
|
||||
|
||||
helm-check:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
2
dev.md
@@ -1,6 +1,6 @@
|
||||
## Premise
|
||||
|
||||
Since FastGPT is managed in the same way as monorepo, it is recommended to install ‘make’ first during development.
|
||||
Since FastGPT is managed in the same way as monorepo, it is recommended to install 'make' first during development.
|
||||
|
||||
monorepo Project Name:
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 174 KiB |
|
Before Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 243 KiB |
|
Before Width: | Height: | Size: 237 KiB |
|
Before Width: | Height: | Size: 550 KiB |
|
Before Width: | Height: | Size: 390 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 46 KiB |
@@ -7,7 +7,7 @@ toc: true
|
||||
weight: 1210
|
||||
---
|
||||
|
||||
FastGPT 项目在 Apache License 2.0 许可下开源,但包含以下附加条件:
|
||||
FastGPT 项目在 Apache License 2.0 许可下开源,同时包含以下附加条件:
|
||||
|
||||
+ FastGPT 允许被用于商业化,例如作为其他应用的“后端即服务”使用,或者作为应用开发平台提供给企业。然而,当满足以下条件时,必须联系作者获得商业许可:
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ weight: 707
|
||||
|
||||
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/development/docker/) 来挂载配置文件。
|
||||
|
||||
**开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。
|
||||
**开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。
|
||||
|
||||
下面配置文件示例中包含了系统参数和各个模型配置:
|
||||
这个配置文件中包含了系统参数和各个模型配置:
|
||||
|
||||
## 4.6.8+ 版本新配置文件示例
|
||||
|
||||
@@ -221,8 +221,6 @@ weight: 707
|
||||
- Ollama
|
||||
- BAAI - 智源研究院
|
||||
- FishAudio
|
||||
- Intern - 书生
|
||||
- Moka - Moka-AI
|
||||
- Other - 其他
|
||||
|
||||
|
||||
|
||||
@@ -23,19 +23,19 @@ weight: 707
|
||||
|
||||
### PgVector版本
|
||||
|
||||
非常轻量,适合数据量在 5000 万以下。
|
||||
体验测试首选
|
||||
|
||||
{{< table "table-hover table-striped-columns" >}}
|
||||
| 环境 | 最低配置(单节点) | 推荐配置 |
|
||||
| ---- | ---- | ---- |
|
||||
| 测试(可以把计算进程设置少一些) | 2c4g | 2c8g |
|
||||
| 测试 | 2c2g | 2c4g |
|
||||
| 100w 组向量 | 4c8g 50GB | 4c16g 50GB |
|
||||
| 500w 组向量 | 8c32g 200GB | 16c64g 200GB |
|
||||
{{< /table >}}
|
||||
|
||||
### Milvus版本
|
||||
|
||||
对于亿级以上向量性能更优秀。
|
||||
生产部署首选,对于千万级以上向量性能更优秀。
|
||||
|
||||
[点击查看 Milvus 官方推荐配置](https://milvus.io/docs/prerequisite-docker.md)
|
||||
|
||||
|
||||
@@ -19,24 +19,6 @@ images: []
|
||||
|
||||
## 二、通用问题
|
||||
|
||||
### 通过sealos部署的话,是否没有本地部署的一些限制?
|
||||

|
||||
这是索引模型的长度限制,通过任何方式部署都一样的,但不同索引模型的配置不一样,可以在后台修改参数。
|
||||
|
||||
### sealos怎么挂载 小程序配置文件
|
||||
|
||||
新增配置文件:/app/projects/app/public/xxxx.txt
|
||||
|
||||
如图:
|
||||
|
||||

|
||||
|
||||
### 数据库3306端口被占用了,启动服务失败
|
||||
|
||||

|
||||
|
||||
把端口映射改成 3307 之类的,例如 3307:3306。
|
||||
|
||||
### 本地部署的限制
|
||||
|
||||
具体内容参考https://fael3z0zfze.feishu.cn/wiki/OFpAw8XzAi36Guk8dfucrCKUnjg。
|
||||
@@ -63,6 +45,31 @@ images: []
|
||||
1. 问题补全需要经过一轮AI生成。
|
||||
2. 会进行3~5轮的查询,如果数据库性能不足,会有明显影响。
|
||||
|
||||
### 对话接口报错或返回为空(core.chat.Chat API is error or undefined)
|
||||
|
||||
1. 检查 AI 的 key 问题:通过 curl 请求看是否正常。务必用 stream=true 模式。并且 maxToken 等相关参数尽量一致。
|
||||
2. 如果是国内模型,可能是命中风控了。
|
||||
3. 查看模型请求日志,检查出入参数是否异常。
|
||||
|
||||
```sh
|
||||
# curl 例子。
|
||||
curl --location --request POST 'https://xxx.cn/v1/chat/completions' \
|
||||
--header 'Authorization: Bearer sk-xxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"model": "gpt-3.5-turbo",
|
||||
"stream": true,
|
||||
"temperature": 1,
|
||||
"max_tokens": 3000,
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "你是谁"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
### 页面中可以正常回复,API 报错
|
||||
|
||||
页面中是用 stream=true 模式,所以API也需要设置 stream=true 来进行测试。部分模型接口(国产居多)非 Stream 的兼容有点垃圾。
|
||||
@@ -108,13 +115,6 @@ FastGPT 模型配置文件中的 model 必须与 OneAPI 渠道中的模型对应
|
||||
|
||||
如果OneAPI中,没有配置对应的模型,`config.json`中也不要配置,否则容易报错。
|
||||
|
||||
### 点击模型测试失败
|
||||
|
||||
OneAPI 只会测试渠道的第一个模型,并且只会测试对话模型,向量模型无法自动测试,需要手动发起请求进行测试。[查看测试模型命令示例](/docs/development/faq/#如何检查模型问题)
|
||||
### get request url failed: Post "https://xxx dial tcp: xxxx
|
||||
|
||||
OneAPI 与模型网络不通,需要检查网络配置。
|
||||
|
||||
### Incorrect API key provided: sk-xxxx.You can find your api Key at xxx
|
||||
|
||||
OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并重启容器(先 docker-compose down 然后再 docker-compose up -d 运行一次)。
|
||||
@@ -130,112 +130,6 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并
|
||||
|
||||
## 四、常见模型问题
|
||||
|
||||
### 如何检查模型问题
|
||||
|
||||
1. 私有部署模型,先确认部署的模型是否正常。
|
||||
2. 通过 CURL 请求,直接测试上游模型是否正常运行(云端模型或私有模型均进行测试)
|
||||
3. 通过 CURL 请求,请求 OneAPI 去测试模型是否正常。
|
||||
4. 在 FastGPT 中使用该模型进行测试。
|
||||
|
||||
下面是几个测试 CURL 示例:
|
||||
|
||||
{{< tabs tabTotal="5" >}}
|
||||
{{< tab tabName="LLM模型" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl https://api.openai.com/v1/chat/completions \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $OPENAI_API_KEY" \
|
||||
-d '{
|
||||
"model": "gpt-4o",
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "You are a helpful assistant."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Hello!"
|
||||
}
|
||||
]
|
||||
}'
|
||||
|
||||
```
|
||||
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab tabName="Embedding模型" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl https://api.openai.com/v1/embeddings \
|
||||
-H "Authorization: Bearer $OPENAI_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"input": "The food was delicious and the waiter...",
|
||||
"model": "text-embedding-ada-002",
|
||||
"encoding_format": "float"
|
||||
}'
|
||||
```
|
||||
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab tabName="Rerank 模型" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://xxxx.com/api/v1/rerank' \
|
||||
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"model": "bge-rerank-m3",
|
||||
"query": "导演是谁",
|
||||
"documents": [
|
||||
"你是谁?\n我是电影《铃芽之旅》助手"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab tabName="TTS 模型" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl https://api.openai.com/v1/audio/speech \
|
||||
-H "Authorization: Bearer $OPENAI_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"model": "tts-1",
|
||||
"input": "The quick brown fox jumped over the lazy dog.",
|
||||
"voice": "alloy"
|
||||
}' \
|
||||
--output speech.mp3
|
||||
```
|
||||
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab tabName="Whisper 模型" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl https://api.openai.com/v1/audio/transcriptions \
|
||||
-H "Authorization: Bearer $OPENAI_API_KEY" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F file="@/path/to/file/audio.mp3" \
|
||||
-F model="whisper-1"
|
||||
```
|
||||
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
### 报错 - 模型响应为空/模型报错
|
||||
|
||||
该错误是由于 stream 模式下,oneapi 直接结束了流请求,并且未返回任何内容导致。
|
||||
@@ -275,7 +169,7 @@ curl --location --request POST 'https://api.openai.com/v1/chat/completions' \
|
||||
|
||||
需要模型提供商和 oneapi 同时支持工具调用才可使用,测试方法如下:
|
||||
|
||||
##### 1. 通过 `curl` 向 `oneapi` 发起第一轮 stream 模式的 tool 测试。
|
||||
1. 通过 `curl` 向 `oneapi` 发起第一轮 stream 模式的 tool 测试。
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
|
||||
@@ -310,7 +204,7 @@ curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
|
||||
}'
|
||||
```
|
||||
|
||||
##### 2. 检查响应参数
|
||||
2. 检查响应参数
|
||||
|
||||
如果能正常调用工具,会返回对应 `tool_calls` 参数。
|
||||
|
||||
@@ -348,7 +242,7 @@ curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
|
||||
}
|
||||
```
|
||||
|
||||
##### 3. 通过 `curl` 向 `oneapi` 发起第二轮 stream 模式的 tool 测试。
|
||||
3. 通过 `curl` 向 `oneapi` 发起第二轮 stream 模式的 tool 测试。
|
||||
|
||||
第二轮请求是把工具结果发送给模型。发起后会得到模型回答的结果。
|
||||
|
||||
|
||||
@@ -55,28 +55,4 @@ curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions'
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
## 自定义用户 ID
|
||||
|
||||
`v4.8.13`后支持传入自定义的用户 ID, 并且存入历史记录中。
|
||||
|
||||
```sh
|
||||
curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions' \
|
||||
--header 'Authorization: Bearer fastgpt-xxxxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"chatId": "111",
|
||||
"stream": false,
|
||||
"detail": false,
|
||||
"messages": [
|
||||
{
|
||||
"content": "导演是谁",
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"customUid": "xxxxxx"
|
||||
}'
|
||||
```
|
||||
|
||||
在历史记录中,该条记录的使用者会显示为 `xxxxxx`。
|
||||
```
|
||||
@@ -686,7 +686,7 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/getHistories
|
||||
- appId - 应用 Id
|
||||
- offset - 偏移量,即从第几条数据开始取
|
||||
- pageSize - 记录数量
|
||||
- source - 对话源。source=api,表示获取通过 API 创建的对话(不会获取到页面上的对话记录)
|
||||
- source - 对话源
|
||||
{{% /alert %}}
|
||||
|
||||
{{< /markdownify >}}
|
||||
|
||||
@@ -733,21 +733,6 @@ data 为集合的 ID。
|
||||
{{< tab tabName="请求示例" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
**4.8.19+**
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/collection/listv2' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"offset":0,
|
||||
"pageSize": 10,
|
||||
"datasetId":"6593e137231a2be9c5603ba7",
|
||||
"parentId": null,
|
||||
"searchText":""
|
||||
}'
|
||||
```
|
||||
|
||||
**4.8.19-(不再维护)**
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/collection/list' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
@@ -768,7 +753,7 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
{{< markdownify >}}
|
||||
|
||||
{{% alert icon=" " context="success" %}}
|
||||
- offset: 偏移量
|
||||
- pageNum: 页码(选填)
|
||||
- pageSize: 每页数量,最大30(选填)
|
||||
- datasetId: 知识库的ID(必填)
|
||||
- parentId: 父级Id(选填)
|
||||
@@ -788,7 +773,9 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
"statusText": "",
|
||||
"message": "",
|
||||
"data": {
|
||||
"list": [
|
||||
"pageNum": 1,
|
||||
"pageSize": 10,
|
||||
"data": [
|
||||
{
|
||||
"_id": "6593e137231a2be9c5603ba9",
|
||||
"parentId": null,
|
||||
@@ -1188,7 +1175,7 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/data/v2/l
|
||||
}'
|
||||
```
|
||||
|
||||
**4.6.7-(即将弃用)**
|
||||
**4.6.7+**
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/data/list' \
|
||||
@@ -1210,7 +1197,8 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/data/list
|
||||
|
||||
{{% alert icon=" " context="success" %}}
|
||||
|
||||
- offset: 偏移量(选填)
|
||||
- pageNum: 偏移量(选填)
|
||||
- pageNum: 页码(选填)
|
||||
- pageSize: 每页数量,最大30(选填)
|
||||
- collectionId: 集合的ID(必填)
|
||||
- searchText: 模糊搜索词(选填)
|
||||
@@ -1230,7 +1218,9 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/data/list
|
||||
"statusText": "",
|
||||
"message": "",
|
||||
"data": {
|
||||
"list": [
|
||||
"pageNum": 1,
|
||||
"pageSize": 10,
|
||||
"data": [
|
||||
{
|
||||
"_id": "65abd4b29d1448617cba61db",
|
||||
"datasetId": "65abc9bd9d1448617cba5e6c",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'V4.8.18'
|
||||
title: 'V4.8.18(进行中)'
|
||||
description: 'FastGPT V4.8.18 更新说明'
|
||||
icon: 'upgrade'
|
||||
draft: false
|
||||
@@ -9,12 +9,6 @@ weight: 806
|
||||
|
||||
## 更新指南
|
||||
|
||||
### 1. 更新镜像:
|
||||
|
||||
- 更新 fastgpt 镜像 tag: v4.8.18-fix
|
||||
- 更新 fastgpt-pro 商业版镜像 tag: v4.8.18-fix
|
||||
- Sandbox 镜像无需更新
|
||||
|
||||
### 2. 运行升级脚本
|
||||
|
||||
从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`;{{host}} 替换成**FastGPT 域名**。
|
||||
@@ -30,18 +24,14 @@ curl --location --request POST 'https://{{host}}/api/admin/initv4818' \
|
||||
|
||||
## 完整更新内容
|
||||
|
||||
1. 新增 - 支持通过 JSON 配置直接创建应用。
|
||||
2. 新增 - 支持通过 CURL 脚本快速创建 HTTP 插件。
|
||||
3. 新增 - 商业版支持部门架构权限模式。
|
||||
4. 新增 - 支持配置自定跨域安全策略,默认全开。
|
||||
5. 新增 - 补充私有部署,模型问题排查文档。
|
||||
6. 优化 - HTTP Body 增加特殊处理,解决字符串变量带换行时无法解析问题。
|
||||
7. 优化 - 分享链接随机生成用户头像。
|
||||
8. 优化 - 图片上传安全校验。并增加头像图片唯一存储,确保不会累计存储。
|
||||
9. 优化 - Mongo 全文索引表分离。
|
||||
10. 优化 - 知识库检索查询语句合并,同时减少查库数量。
|
||||
11. 优化 - 文件编码检测,减少 CSV 文件乱码概率。
|
||||
12. 优化 - 异步读取文件内容,减少进程阻塞。
|
||||
13. 优化 - 文件阅读,HTML 直接下载,不允许在线阅读。
|
||||
14. 修复 - HTML 文件上传,base64 图片无法自动转图片链接。
|
||||
15. 修复 - 插件计费错误。
|
||||
1. 新增 - 支持部门架构权限模式。
|
||||
2. 新增 - 支持配置自定跨域安全策略,默认全开。
|
||||
3. 优化 - 分享链接随机生成用户头像。
|
||||
4. 优化 - 图片上传安全校验。并增加头像图片唯一存储,确保不会累计存储。
|
||||
5. 优化 - Mongo 全文索引表分离。
|
||||
6. 优化 - 知识库检索查询语句合并,同时减少查库数量。
|
||||
7. 优化 - 文件编码检测,减少 CSV 文件乱码概率。
|
||||
8. 优化 - 异步读取文件内容,减少进程阻塞。
|
||||
9. 优化 - 文件阅读,HTML 直接下载,不允许在线阅读。
|
||||
10. 修复 - HTML 文件上传,base64 图片无法自动转图片链接。
|
||||
11. 修复 - 插件计费错误。
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
---
|
||||
title: 'V4.8.19(进行中)'
|
||||
description: 'FastGPT V4.8.19 更新说明'
|
||||
icon: 'upgrade'
|
||||
draft: false
|
||||
toc: true
|
||||
weight: 805
|
||||
---
|
||||
|
||||
## 更新指南
|
||||
|
||||
### 1. 更新镜像:
|
||||
|
||||
- 更新 fastgpt 镜像 tag: v4.8.19-beta
|
||||
- 更新 fastgpt-pro 商业版镜像 tag: v4.8.19-beta
|
||||
- Sandbox 镜像无需更新
|
||||
|
||||
### 2. 运行升级脚本
|
||||
|
||||
从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`;{{host}} 替换成**FastGPT 域名**。
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://{{host}}/api/admin/initv4819' \
|
||||
--header 'rootkey: {{rootkey}}' \
|
||||
--header 'Content-Type: application/json'
|
||||
```
|
||||
|
||||
迁移用户表的头像到成员表中。
|
||||
|
||||
## 完整更新内容
|
||||
|
||||
1. 新增 - 工作流知识库检索支持按知识库权限进行过滤。
|
||||
2. 新增 - 飞书/语雀知识库查看原文。
|
||||
3. 新增 - 流程等待插件,可以等待 n 毫秒后继续执行流程。
|
||||
4. 新增 - 飞书机器人接入,支持配置私有化飞书地址。
|
||||
5. 优化 - 成员列表分页加载。
|
||||
6. 优化 - 统一分页加载代码。
|
||||
7. 优化 - 对话页面加载时,可配置是否为独立页面。
|
||||
8. 优化 - 成员头像迁移,移动到成员表。
|
||||
9. 修复 - 语雀文件库导入时,嵌套文件内容无法展开的问题。
|
||||
10. 修复 - 工作流编排中,LLM 参数无法关闭问题。
|
||||
11. 修复 - 工作流编排中,代码运行节点还原模板问题。
|
||||
12. 修复 - HTTP 接口适配对象字符串解析。
|
||||
13. 修复 - 通过 API 上传文件(localFile)接口,图片过期标记未清除。
|
||||
14. 修复 - 工作流导入编排时,number input 类型无法覆盖。
|
||||
15. 修复 - 部分模型提供商 logo 无法正常显示。
|
||||
@@ -7,7 +7,7 @@ toc: true
|
||||
weight: 908
|
||||
---
|
||||
|
||||
## 多轮对话中如何使连续问题被问题分类节点正确的归类
|
||||
## 工作流中多轮对话场景中如何使连续问题被问题分类节点正确的归类
|
||||
|
||||
问题分类节点具有获取上下文信息的能力,当处理两个关联性较大的问题时,模型的判断准确性往往依赖于这两个问题之间的联系和模型的能力。例如,当用户先问“我该如何使用这个功能?”接着又询问“这个功能有什么限制?”时,模型借助上下文信息,就能够更精准地理解并响应。
|
||||
|
||||
@@ -15,68 +15,10 @@ weight: 908
|
||||
|
||||
建议:构建批量运行脚本进行测试,评估问题分类的准确性。
|
||||
|
||||
## 定时执行的时机问题
|
||||
## 系统编排配置中的定时执行,如果用户打开分享的连接,停留在那个页面,定时执行触发问题
|
||||
|
||||
系统编排配置中的定时执行,如果用户打开分享的连接,停留在那个页面,定时执行触发问题:
|
||||
|
||||
定时执行会在应用发布后生效,会在后台生效。
|
||||
|
||||
## V4.8.18-FIX2中提到“ 1. 修复 HTTP 节点, {{}} 格式引用变量兼容问题。建议尽快替换 / 模式取变量, {{}} 语法已弃用。”替换{{}}引用格式是仅仅只有在http节点,还是所有节点的都会有影响?
|
||||
|
||||
只有 http 节点用到这个语法。
|
||||
|
||||
## 工作流类型的应用在运行预览可以正常提问返回,但是发布免登录窗口之后有问题。
|
||||
|
||||
一般是没正确发布,在工作流右上角点击【保存并发布】。
|
||||
|
||||
## 如何解决猜你想问使用中文回答显示
|
||||
|
||||
注意需要更新到V4.8.17及以上,把猜你想问的提示词改成中文。
|
||||

|
||||
发布后,后台生效。
|
||||
|
||||
## AI对话回答要求中的Markdown语法取消
|
||||
|
||||
修改知识库默认提示词, 默认用的是标准模板提示词,会要求按 Markdown 输出,可以去除该要求:
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
|  |  |
|
||||
|
||||
## 应用在不同来源效果不一致
|
||||
|
||||
Q: 应用在调试和正式发布后,效果不一致;在 API 调用时,效果不一致。
|
||||
|
||||
A: 通常是由于上下文不一致导致,可以在对话日志中,找到对应的记录,并查看运行详情来进行比对。
|
||||
|
||||
| | | |
|
||||
| --- | --- | --- |
|
||||
|  |  |  |
|
||||
在针对知识库的回答要求里有, 要给它配置提示词,不然他就是默认的,默认的里面就有该语法。
|
||||
|
||||
## 工作流操作:一个工作流,以一个问题分类节点开始,根据不同的分类导入到不同的分支,访问相应的知识库和AI对话,AI对话返回内容后,怎么样不进入问题分类节点,而是将问题到知识库搜索,然后把历史记录一起作为背景再次AI查询。
|
||||
|
||||
做个判断器,如果是初次开始对话也就是历史记录为0,就走问题分类;不为零直接走知识库和ai。
|
||||
|
||||
## 实时对话,设置 fastgpt 定时,比如每隔 3000MS 去拿一次 webhook发送过来的消息到AI页面
|
||||
|
||||
定时执行没有这么高频率的去拿信息的,想要实现在企微里面的实时对话的机器人,
|
||||
目前通过低代码的工作流构建应该是不行的,只能自己写代码,然后去调用 FastGPT 的 APIKey 回复。企业微信似乎没有提供「自动监听」群聊消息的接口(或是通过 at 机器人这种触发消息推送)。应该只能发消息给应用,接收这个 https://developer.work.weixin.qq.com/document/path/90238 文档中的消息推送实现实时对话。或者是定时去拿群聊消息,通过这个文档所示的接口https://developer.work.weixin.qq.com/document/path/98914,然后用这个接口 https://developer.work.weixin.qq.com/document/path/90248 去推送消息。
|
||||
|
||||
## 工作流连接数据库
|
||||
|
||||
工作流提供该连接数据库功能,用这个数据库连接的 plugin 可以实现 text2SQL,但是相对危险,不建议做写入等操作。
|
||||
|
||||

|
||||
|
||||
## 关于循环体,协助理解循环体的循环条件和终止条件、循环的方式,循环体内参数调用后、在循环体内属于是局部作用域的参数还是全局作用域的参数
|
||||
|
||||
可理解为 for 函数,传一个数组,每个数据都执行一次。
|
||||
|
||||
## 公式无法正常显示
|
||||
|
||||
添加相关提示词,引导模型按 Markdown 输出公式
|
||||
|
||||
```bash
|
||||
Latex inline: \(x^2\)
|
||||
Latex block: $$e=mc^2$$
|
||||
```
|
||||
在针对知识库的回答要求里有, 要给它配置提示词,不然他就是默认的,默认的里面就有该语法。
|
||||
@@ -16,25 +16,6 @@ weight: 910
|
||||
* **文件处理模型**:用于数据处理的【增强处理】和【问答拆分】。在【增强处理】中,生成相关问题和摘要,在【问答拆分】中执行问答对生成。
|
||||
* **索引模型**:用于向量化,即通过对文本数据进行处理和组织,构建出一个能够快速查询的数据结构。
|
||||
|
||||
## 知识库支持Excel类文件的导入
|
||||
|
||||
xlsx等都可以上传的,不止支持CSV。
|
||||
|
||||
## 知识库tokens的计算方式
|
||||
|
||||
统一按gpt3.5标准。
|
||||
|
||||
## 误删除重排模型后,重排模型怎么加入到fastgpt
|
||||
|
||||

|
||||
|
||||
config.json文件里面配置后就可以勾选重排模型
|
||||
|
||||
## 线上平台上创建了应用和知识库,到期之后如果短期内不续费,数据是否会被清理。
|
||||
|
||||
免费版是三十天不登录后清空知识库,应用不会动。其他付费套餐到期后自动切免费版。
|
||||

|
||||
|
||||
## 基于知识库的查询,但是问题相关的答案过多。ai回答到一半就不继续回答。
|
||||
|
||||
FastGPT回复长度计算公式:
|
||||
@@ -56,7 +37,7 @@ FastGPT回复长度计算公式:
|
||||
|
||||

|
||||
|
||||
另外私有化部署的时候,后台配模型参数,可以在配置最大上文时,预留一些空间,比如 128000 的模型,可以只配置 120000, 剩余的空间后续会被安排给输出
|
||||
1. 私有化部署的时候,后台配模型参数,可以在配置最大上文时候,预留一些空间,比如 128000 的模型,可以只配置 120000, 剩余的空间后续会被安排给输出
|
||||
|
||||
|
||||
## 受到模型上下文的限制,有时候达不到聊天记录的轮次,连续对话字数过多就会报上下文不够的错误。
|
||||
@@ -80,4 +61,4 @@ FastGPT回复长度计算公式:
|
||||
|
||||

|
||||
|
||||
另外,私有化部署的时候,后台配模型参数,可以在配置最大上文时,预留一些空间,比如 128000 的模型,可以只配置 120000, 剩余的空间后续会被安排给输出。
|
||||
1. 私有化部署的时候,后台配模型参数,可以在配置最大上文时候,预留一些空间,比如 128000 的模型,可以只配置 120000, 剩余的空间后续会被安排给输出
|
||||
@@ -8,8 +8,4 @@ weight: 918
|
||||
|
||||
## oneapi 官网是哪个
|
||||
|
||||
只有开源的 README,没官网,GitHub: https://github.com/songquanpeng/one-api
|
||||
|
||||
## 想做多用户
|
||||
|
||||
开源版未支持多用户,仅商业版支持。
|
||||
只有开源的 README,没官网,GitHub: https://github.com/songquanpeng/one-api
|
||||
@@ -22,11 +22,10 @@ FastGPT v4.8.16 版本开始,商业版用户支持飞书知识库导入,用
|
||||
|
||||
## 2. 配置应用权限
|
||||
|
||||
创建应用后,进入应用可以配置相关权限,这里需要增加**3个权限**:
|
||||
创建应用后,进入应用可以配置相关权限,这里需要增加两个权限:
|
||||
|
||||
1. 获取云空间文件夹下的云文档清单
|
||||
2. 查看新版文档
|
||||
3. 查看、评论、编辑和管理云空间中所有文件
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "批量运行"
|
||||
description: "FastGPT 批量运行节点介绍和使用"
|
||||
title: "循环执行"
|
||||
description: "FastGPT 循环运行节点介绍和使用"
|
||||
icon: "input"
|
||||
draft: false
|
||||
toc: true
|
||||
@@ -9,15 +9,15 @@ weight: 260
|
||||
|
||||
## 节点概述
|
||||
|
||||
【**批量运行**】节点是 FastGPT V4.8.11 版本新增的一个重要功能模块。它允许工作流对数组类型的输入数据进行迭代处理,每次处理数组中的一个元素,并自动执行后续节点,直到完成整个数组的处理。
|
||||
【**循环运行**】节点是 FastGPT V4.8.11 版本新增的一个重要功能模块。它允许工作流对数组类型的输入数据进行迭代处理,每次处理数组中的一个元素,并自动执行后续节点,直到完成整个数组的处理。
|
||||
|
||||
这个节点的设计灵感来自编程语言中的循环结构,但以可视化的方式呈现。
|
||||
|
||||

|
||||

|
||||
|
||||
> 在程序中,节点可以理解为一个个 Function 或者接口。可以理解为它就是一个**步骤**。将多个节点一个个拼接起来,即可一步步的去实现最终的 AI 输出。
|
||||
|
||||
【**批量运行**】节点本质上也是一个 Function,它的主要职责是自动化地重复执行特定的工作流程。
|
||||
【**循环运行**】节点本质上也是一个 Function,它的主要职责是自动化地重复执行特定的工作流程。
|
||||
|
||||
## 核心特性
|
||||
|
||||
@@ -41,9 +41,9 @@ weight: 260
|
||||
|
||||
## 应用场景
|
||||
|
||||
【**批量运行**】节点的主要作用是通过自动化的方式扩展工作流的处理能力,使 FastGPT 能够更好地处理批量任务和复杂的数据处理流程。特别是在处理大规模数据或需要多轮迭代的场景下,批量运行节点能显著提升工作流的效率和自动化程度。
|
||||
【**循环运行**】节点的主要作用是通过自动化的方式扩展工作流的处理能力,使 FastGPT 能够更好地处理批量任务和复杂的数据处理流程。特别是在处理大规模数据或需要多轮迭代的场景下,循环运行节点能显著提升工作流的效率和自动化程度。
|
||||
|
||||
【**批量运行**】节点特别适合以下场景:
|
||||
【**循环运行**】节点特别适合以下场景:
|
||||
|
||||
1. **批量数据处理**
|
||||
- 批量翻译文本
|
||||
@@ -64,7 +64,7 @@ weight: 260
|
||||
|
||||
### 输入参数设置
|
||||
|
||||
【**批量运行**】节点需要配置两个核心输入参数:
|
||||
【**循环运行**】节点需要配置两个核心输入参数:
|
||||
|
||||
1. **数组 (必填)**:接收一个数组类型的输入,可以是:
|
||||
- 字符串数组 (`Array<string>`)
|
||||
@@ -95,7 +95,7 @@ weight: 260
|
||||
|
||||
### 批量处理数组
|
||||
|
||||
假设我们有一个包含多个文本的数组,需要对每个文本进行 AI 处理。这是批量运行节点最基础也最常见的应用场景。
|
||||
假设我们有一个包含多个文本的数组,需要对每个文本进行 AI 处理。这是循环运行节点最基础也最常见的应用场景。
|
||||
|
||||
#### 实现步骤
|
||||
|
||||
@@ -114,9 +114,9 @@ weight: 260
|
||||
return { textArray: texts };
|
||||
```
|
||||
|
||||
2. 配置批量运行节点
|
||||
2. 配置循环运行节点
|
||||
|
||||

|
||||

|
||||
|
||||
- 数组输入:选择上一步代码运行节点的输出变量 `textArray`。
|
||||
- 循环体内添加一个【AI 对话】节点,用于处理每个文本。这里我们输入的 prompt 为:`请将这段文本翻译成英文`。
|
||||
@@ -128,7 +128,7 @@ weight: 260
|
||||

|
||||
|
||||
1. 【代码运行】节点执行,生成测试数组
|
||||
2. 【批量运行】节点接收数组,开始遍历
|
||||
2. 【循环运行】节点接收数组,开始遍历
|
||||
3. 对每个数组元素:
|
||||
- 【AI 对话】节点处理当前元素
|
||||
- 【指定回复】节点输出翻译后的文本
|
||||
@@ -144,7 +144,7 @@ weight: 260
|
||||
- 需要维护上下文的连贯性
|
||||
- 翻译质量需要多轮优化
|
||||
|
||||
【**批量运行**】节点可以很好地解决这些问题。
|
||||
【**循环运行**】节点可以很好地解决这些问题。
|
||||
|
||||
#### 实现步骤
|
||||
|
||||
@@ -281,9 +281,9 @@ weight: 260
|
||||
|
||||
这里我们用到了 [Jina AI 开源的一个强大的正则表达式](https://x.com/JinaAI_/status/1823756993108304135),它能利用所有可能的边界线索和启发式方法来精确切分文本。
|
||||
|
||||
2. 配置批量运行节点
|
||||
2. 配置循环运行节点
|
||||
|
||||

|
||||

|
||||
|
||||
- 数组输入:选择上一步代码运行节点的输出变量 `chunks`。
|
||||
- 循环体内添加一个【代码运行】节点,对源文本进行格式化。
|
||||
|
||||
@@ -54,7 +54,7 @@ FastGPT 对外的 API 接口对齐了 OpenAI 官方接口,可以直接接入
|
||||
|
||||
1. **项目开源**
|
||||
|
||||
FastGPT 遵循**附加条件 Apache License 2.0 开源协议**,你可以 [Fork](https://github.com/labring/FastGPT/fork) 之后进行二次开发和发布。FastGPT 社区版将保留核心功能,商业版仅在社区版基础上使用 API 的形式进行扩展,不影响学习使用。
|
||||
FastGPT 遵循附加条件 Apache License 2.0 开源协议,你可以 [Fork](https://github.com/labring/FastGPT/fork) 之后进行二次开发和发布。FastGPT 社区版将保留核心功能,商业版仅在社区版基础上使用 API 的形式进行扩展,不影响学习使用。
|
||||
|
||||
2. **独特的 QA 结构**
|
||||
|
||||
|
||||
@@ -53,9 +53,8 @@ FastGPT 商业版软件根据不同的部署方式,分为 3 类收费模式。
|
||||
{{< table "table-hover table-striped-columns" >}}
|
||||
| 部署方式 | 特有服务 | 上线时长 | 标品价格 |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| Sealos全托管 | 1. 有效期内免费升级。<br>2. 免运维服务&数据库。 | 半天 | 10000元起/月(3个月起)<br>或<br>120000元起/年<br>8C32G 资源,额外资源另外收费。 |
|
||||
| Sealos全托管(多节点) | 1. 有效期内免费升级。<br>2. 免运维服务&数据库。 | 半天 | 22000元起/月(3个月起)<br>或<br>264000元起/年<br>32C128G 资源,额外资源另外收费。 |
|
||||
| 自有服务器部署 | 1. 6个版本免费升级支持。 | 14天内 | 具体价格和优惠可[联系咨询](https://fael3z0zfze.feishu.cn/share/base/form/shrcnRxj3utrzjywsom96Px4sud) |
|
||||
| Sealos全托管 | 1. 有效期内免费升级。<br>2. 免运维服务&数据库。 | 半天 | 6000元起/月(3个月起)<br>或<br>60000元起/年 |
|
||||
| 自有服务器部署 | 1. 6个版本免费升级支持。 | 14天内 | 具体价格可[联系咨询](https://fael3z0zfze.feishu.cn/share/base/form/shrcnRxj3utrzjywsom96Px4sud) |
|
||||
{{< /table >}}
|
||||
|
||||
{{% alert icon="🤖 " context="success" %}}
|
||||
|
||||
@@ -5,9 +5,8 @@ icon: 'currency_yen'
|
||||
draft: false
|
||||
toc: true
|
||||
weight: 1102
|
||||
type: redirect
|
||||
target: https://cloud.tryfastgpt.ai/price
|
||||
---
|
||||
|
||||
线上版价格按套餐订阅模式,具体价格和计费请查看(请正确选择版本,账号不互通):
|
||||
|
||||
- [海外版](https://cloud.tryfastgpt.ai/price)
|
||||
- [国内版](https://cloud.fastgpt.cn/price)
|
||||
线上版价格请查看:[https://cloud.tryfastgpt.ai/price](https://cloud.tryfastgpt.ai/price)
|
||||
@@ -212,7 +212,7 @@ export default async function (ctx: FunctionContext): Promise<IResponse>{
|
||||
|
||||

|
||||
|
||||
## 批量运行
|
||||
## 循环执行
|
||||
|
||||
长文反思翻译比较关键的一个部分,就是对多个文本块进行循环反思翻译
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ weight: 602
|
||||
|
||||
1. ### 创建应用模板
|
||||
|
||||
应用模板配置以及相关资源,都会在 **packages/templates/src** 目录下。
|
||||
应用模板配置以及相关资源,都会在 **projects/app/public/appMarketTemplates** 目录下。
|
||||
|
||||

|
||||
|
||||
1. 在**packages/templates/src** 目录下,创建一个文件夹,名称为模板对应的 id。
|
||||
1. 在 **projects/app/public/appMarketTemplates** 目录下,创建一个文件夹,名称为模板对应的 id。
|
||||
2. 在刚刚创建的文件夹中,再创建一个 **template.json** 文件,复制粘贴并填写如下配置:
|
||||
|
||||
```JSON
|
||||
@@ -83,4 +83,4 @@ weight: 602
|
||||
|
||||
- 写清楚模板的介绍和功能
|
||||
- 配上模板运行的效果图
|
||||
- 模板参数填写说明,需要在 PR 中写清楚。例如,有些模板需要去某个提供商申请 key,需要附上对应的地址和教程,后续我们会加入到文档中。
|
||||
- 模板参数填写说明,需要在 PR 中写清楚。例如,有些模板需要去某个提供商申请 key,需要附上对应的地址和教程,后续我们会加入到文档中。
|
||||
@@ -91,9 +91,9 @@ weight: 604
|
||||
|
||||
这个过程不仅提高了效率,还最大限度地减少了人为错误的可能性。
|
||||
|
||||
## 批量运行
|
||||
## 循环执行
|
||||
|
||||
为了处理整个长字幕文件,我们需要一个批量运行机制。这是通过一个简单但有效的判断模块实现的:
|
||||
为了处理整个长字幕文件,我们需要一个循环执行机制。这是通过一个简单但有效的判断模块实现的:
|
||||
|
||||
1. 检查当前翻译的文本块是否为最后一个。
|
||||
2. 如果不是,则将工作流重定向到格式化原文本块节点。
|
||||
|
||||
@@ -159,14 +159,6 @@ services:
|
||||
# 日志等级: debug, info, warn, error
|
||||
- LOG_LEVEL=info
|
||||
- STORE_LOG_LEVEL=warn
|
||||
# 工作流最大运行次数
|
||||
- WORKFLOW_MAX_RUN_TIMES=1000
|
||||
# 批量执行节点,最大输入长度
|
||||
- WORKFLOW_MAX_LOOP_TIMES=100
|
||||
# 自定义跨域,不配置时,默认都允许跨域(多个域名通过逗号分割)
|
||||
- ALLOWED_ORIGINS=
|
||||
# 是否开启IP限制,默认不开启
|
||||
- USE_IP_LIMIT=false
|
||||
volumes:
|
||||
- ./config.json:/app/data/config.json
|
||||
|
||||
|
||||
@@ -116,14 +116,6 @@ services:
|
||||
# 日志等级: debug, info, warn, error
|
||||
- LOG_LEVEL=info
|
||||
- STORE_LOG_LEVEL=warn
|
||||
# 工作流最大运行次数
|
||||
- WORKFLOW_MAX_RUN_TIMES=1000
|
||||
# 批量执行节点,最大输入长度
|
||||
- WORKFLOW_MAX_LOOP_TIMES=100
|
||||
# 自定义跨域,不配置时,默认都允许跨域(多个域名通过逗号分割)
|
||||
- ALLOWED_ORIGINS=
|
||||
# 是否开启IP限制,默认不开启
|
||||
- USE_IP_LIMIT=false
|
||||
volumes:
|
||||
- ./config.json:/app/data/config.json
|
||||
|
||||
|
||||
@@ -97,14 +97,6 @@ services:
|
||||
# 日志等级: debug, info, warn, error
|
||||
- LOG_LEVEL=info
|
||||
- STORE_LOG_LEVEL=warn
|
||||
# 工作流最大运行次数
|
||||
- WORKFLOW_MAX_RUN_TIMES=1000
|
||||
# 批量执行节点,最大输入长度
|
||||
- WORKFLOW_MAX_LOOP_TIMES=100
|
||||
# 自定义跨域,不配置时,默认都允许跨域(多个域名通过逗号分割)
|
||||
- ALLOWED_ORIGINS=
|
||||
# 是否开启IP限制,默认不开启
|
||||
- USE_IP_LIMIT=false
|
||||
volumes:
|
||||
- ./config.json:/app/data/config.json
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@ import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* team: 503000 */
|
||||
export enum UserErrEnum {
|
||||
unAuthRole = 'unAuthRole',
|
||||
account_psw_error = 'account_psw_error',
|
||||
binVisitor = 'binVisitor',
|
||||
balanceNotEnough = 'balanceNotEnough',
|
||||
unAuthSso = 'unAuthSso'
|
||||
}
|
||||
const errList = [
|
||||
{
|
||||
statusText: UserErrEnum.account_psw_error,
|
||||
message: i18nT('common:code_error.account_error')
|
||||
statusText: UserErrEnum.binVisitor,
|
||||
message: i18nT('common:code_error.user_error.bin_visitor')
|
||||
},
|
||||
{
|
||||
statusText: UserErrEnum.balanceNotEnough,
|
||||
|
||||
@@ -5,6 +5,6 @@ export const getErrText = (err: any, def = ''): any => {
|
||||
typeof err === 'string'
|
||||
? err
|
||||
: err?.response?.data?.message || err?.response?.message || err?.message || def;
|
||||
// msg && console.log('error =>', msg);
|
||||
msg && console.log('error =>', msg);
|
||||
return replaceSensitiveText(msg);
|
||||
};
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
import parse from '@bany/curl-to-json';
|
||||
|
||||
type RequestMethod = 'get' | 'post' | 'put' | 'delete' | 'patch';
|
||||
const methodMap: { [K in RequestMethod]: string } = {
|
||||
get: 'GET',
|
||||
post: 'POST',
|
||||
put: 'PUT',
|
||||
delete: 'DELETE',
|
||||
patch: 'PATCH'
|
||||
};
|
||||
|
||||
export const parseCurl = (curlContent: string) => {
|
||||
const parsed = parse(curlContent);
|
||||
|
||||
if (!parsed.url) {
|
||||
throw new Error('url not found');
|
||||
}
|
||||
|
||||
const newParams = Object.keys(parsed.params || {}).map((key) => ({
|
||||
key,
|
||||
value: parsed.params?.[key],
|
||||
type: 'string'
|
||||
}));
|
||||
const newHeaders = Object.keys(parsed.header || {}).map((key) => ({
|
||||
key,
|
||||
value: parsed.header?.[key],
|
||||
type: 'string'
|
||||
}));
|
||||
const newBody = JSON.stringify(parsed.data, null, 2);
|
||||
const bodyArray = Object.keys(parsed.data || {}).map((key) => ({
|
||||
key,
|
||||
value: parsed.data?.[key],
|
||||
type: 'string'
|
||||
}));
|
||||
|
||||
return {
|
||||
url: parsed.url,
|
||||
method: methodMap[parsed.method?.toLowerCase() as RequestMethod] || 'GET',
|
||||
params: newParams,
|
||||
headers: newHeaders,
|
||||
body: newBody,
|
||||
bodyArray
|
||||
};
|
||||
};
|
||||
@@ -40,7 +40,7 @@ export type FastGPTConfigFileType = {
|
||||
|
||||
export type FastGPTFeConfigsType = {
|
||||
show_emptyChat?: boolean;
|
||||
register_method?: ['email' | 'phone' | 'sync'];
|
||||
register_method?: ['email' | 'phone'];
|
||||
login_method?: ['email' | 'phone']; // Attention: login method is diffrent with oauth
|
||||
find_password_method?: ['email' | 'phone'];
|
||||
bind_notification_method?: ['email' | 'phone'];
|
||||
@@ -76,6 +76,7 @@ export type FastGPTFeConfigsType = {
|
||||
wecom?: {
|
||||
corpid?: string;
|
||||
agentid?: string;
|
||||
secret?: string;
|
||||
};
|
||||
microsoft?: {
|
||||
clientId?: string;
|
||||
|
||||
@@ -23,8 +23,6 @@ export type ModelProviderIdType =
|
||||
| 'Ollama'
|
||||
| 'BAAI'
|
||||
| 'FishAudio'
|
||||
| 'Intern'
|
||||
| 'Moka'
|
||||
| 'Other';
|
||||
|
||||
export type ModelProviderType = {
|
||||
@@ -145,16 +143,6 @@ export const ModelProviderList: ModelProviderType[] = [
|
||||
name: 'FishAudio',
|
||||
avatar: 'model/fishaudio'
|
||||
},
|
||||
{
|
||||
id: 'Intern',
|
||||
name: i18nT('common:model_intern'),
|
||||
avatar: 'model/intern'
|
||||
},
|
||||
{
|
||||
id: 'Moka',
|
||||
name: i18nT('common:model_moka'),
|
||||
avatar: 'model/moka'
|
||||
},
|
||||
{
|
||||
id: 'Other',
|
||||
name: i18nT('common:model_other'),
|
||||
|
||||
@@ -33,7 +33,7 @@ export const defaultWhisperConfig: AppWhisperConfigType = {
|
||||
export const defaultQGConfig: AppQGConfigType = {
|
||||
open: false,
|
||||
model: 'gpt-4o-mini',
|
||||
customPrompt: ''
|
||||
customPrompt: PROMPT_QUESTION_GUIDE
|
||||
};
|
||||
|
||||
export const defaultChatInputGuideConfig = {
|
||||
|
||||
4
packages/global/core/app/type.d.ts
vendored
@@ -12,9 +12,8 @@ import { TeamTagSchema as TeamTagsSchemaType } from '@fastgpt/global/support/use
|
||||
import { StoreEdgeItemType } from '../workflow/type/edge';
|
||||
import { AppPermission } from '../../support/permission/app/controller';
|
||||
import { ParentIdType } from '../../common/parentFolder/type';
|
||||
import { FlowNodeInputTypeEnum } from '../../core/workflow/node/constant';
|
||||
import { FlowNodeInputTypeEnum } from 'core/workflow/node/constant';
|
||||
import { WorkflowTemplateBasicType } from '@fastgpt/global/core/workflow/type';
|
||||
import { SourceMemberType } from '../../support/user/type';
|
||||
|
||||
export type AppSchema = {
|
||||
_id: string;
|
||||
@@ -64,7 +63,6 @@ export type AppListItemType = {
|
||||
permission: AppPermission;
|
||||
inheritPermission?: boolean;
|
||||
private?: boolean;
|
||||
sourceMember: SourceMemberType;
|
||||
};
|
||||
|
||||
export type AppDetailType = AppSchema & {
|
||||
|
||||
@@ -5,8 +5,6 @@ import type { FlowNodeInputItemType } from '../workflow/type/io.d';
|
||||
import { getAppChatConfig } from '../workflow/utils';
|
||||
import { StoreNodeItemType } from '../workflow/type/node';
|
||||
import { DatasetSearchModeEnum } from '../dataset/constants';
|
||||
import { WorkflowTemplateBasicType } from '../workflow/type';
|
||||
import { AppTypeEnum } from './constants';
|
||||
|
||||
export const getDefaultAppForm = (): AppSimpleEditFormType => {
|
||||
return {
|
||||
@@ -129,20 +127,3 @@ export const appWorkflow2Form = ({
|
||||
|
||||
return defaultAppForm;
|
||||
};
|
||||
|
||||
export const getAppType = (config?: WorkflowTemplateBasicType | AppSimpleEditFormType) => {
|
||||
if (!config) return '';
|
||||
|
||||
if ('aiSettings' in config) {
|
||||
return AppTypeEnum.simple;
|
||||
}
|
||||
|
||||
if (!('nodes' in config)) return '';
|
||||
if (config.nodes.some((node) => node.flowNodeType === 'workflowStart')) {
|
||||
return AppTypeEnum.workflow;
|
||||
}
|
||||
if (config.nodes.some((node) => node.flowNodeType === 'pluginInput')) {
|
||||
return AppTypeEnum.plugin;
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
3
packages/global/core/app/version.d.ts
vendored
@@ -1,7 +1,5 @@
|
||||
import { TeamMemberStatusEnum } from 'support/user/team/constant';
|
||||
import { StoreEdgeItemType } from '../workflow/type/edge';
|
||||
import { AppChatConfigType, AppSchema } from './type';
|
||||
import { SourceMemberType } from 'support/user/type';
|
||||
|
||||
export type AppVersionSchemaType = {
|
||||
_id: string;
|
||||
@@ -22,5 +20,4 @@ export type VersionListItemType = {
|
||||
time: Date;
|
||||
isPublish: boolean | undefined;
|
||||
tmbId: string;
|
||||
sourceMember: SourceMemberType;
|
||||
};
|
||||
|
||||
1
packages/global/core/dataset/apiDataset.d.ts
vendored
@@ -5,7 +5,6 @@ export type APIFileItem = {
|
||||
type: 'file' | 'folder';
|
||||
updateTime: Date;
|
||||
createTime: Date;
|
||||
hasChild?: boolean;
|
||||
};
|
||||
|
||||
export type APIFileServer = {
|
||||
|
||||
2
packages/global/core/dataset/type.d.ts
vendored
@@ -11,7 +11,6 @@ import {
|
||||
import { DatasetPermission } from '../../support/permission/dataset/controller';
|
||||
import { Permission } from '../../support/permission/controller';
|
||||
import { APIFileServer, FeishuServer, YuqueServer } from './apiDataset';
|
||||
import { SourceMemberType } from 'support/user/type';
|
||||
|
||||
export type DatasetSchemaType = {
|
||||
_id: string;
|
||||
@@ -166,7 +165,6 @@ export type DatasetListItemType = {
|
||||
vectorModel: VectorModelItemType;
|
||||
inheritPermission: boolean;
|
||||
private?: boolean;
|
||||
sourceMember?: SourceMemberType;
|
||||
};
|
||||
|
||||
export type DatasetItemType = Omit<DatasetSchemaType, 'vectorModel' | 'agentModel'> & {
|
||||
|
||||
@@ -34,7 +34,7 @@ export function getSourceNameIcon({
|
||||
}
|
||||
} catch (error) {}
|
||||
|
||||
return 'file/fill/file';
|
||||
return 'file/fill/manual';
|
||||
}
|
||||
|
||||
/* get dataset data default index */
|
||||
|
||||
@@ -152,7 +152,6 @@ export enum NodeInputKeyEnum {
|
||||
datasetSearchExtensionModel = 'datasetSearchExtensionModel',
|
||||
datasetSearchExtensionBg = 'datasetSearchExtensionBg',
|
||||
collectionFilterMatch = 'collectionFilterMatch',
|
||||
authTmbId = 'authTmbId',
|
||||
|
||||
// concat dataset
|
||||
datasetQuoteList = 'system_datasetQuoteList',
|
||||
|
||||
@@ -41,10 +41,6 @@ export type ChatDispatchProps = {
|
||||
teamId: string;
|
||||
tmbId: string; // App tmbId
|
||||
};
|
||||
runningUserInfo: {
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
};
|
||||
uid: string; // Who run this workflow
|
||||
|
||||
chatId?: string;
|
||||
|
||||
@@ -339,7 +339,6 @@ export function replaceEditorVariable({
|
||||
const output = node.outputs.find((output) => output.id === id);
|
||||
if (output) return formatVariableValByType(output.value, output.valueType);
|
||||
|
||||
// Use the node's input as the variable value(Example: HTTP data will reference its own dynamic input)
|
||||
const input = node.inputs.find((input) => input.key === id);
|
||||
if (input) return getReferenceVariableValue({ value: input.value, nodes, variables });
|
||||
})();
|
||||
|
||||
@@ -89,13 +89,6 @@ export const DatasetSearchModule: FlowNodeTemplateType = {
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
key: NodeInputKeyEnum.authTmbId,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.hidden],
|
||||
label: '',
|
||||
valueType: WorkflowIOValueTypeEnum.boolean,
|
||||
value: false
|
||||
},
|
||||
{
|
||||
...Input_Template_UserChatInput,
|
||||
toolDescription: i18nT('workflow:content_to_search')
|
||||
|
||||
3
packages/global/core/workflow/type/io.d.ts
vendored
@@ -49,9 +49,8 @@ export type FlowNodeInputItemType = InputComponentPropsType & {
|
||||
debugLabel?: string;
|
||||
description?: string; // field desc
|
||||
required?: boolean;
|
||||
enum?: string;
|
||||
|
||||
toolDescription?: string; // If this field is not empty, it is entered as a tool
|
||||
enum?: string;
|
||||
|
||||
// render components params
|
||||
canEdit?: boolean; // dynamic inputs
|
||||
|
||||
1
packages/global/core/workflow/type/node.d.ts
vendored
@@ -89,7 +89,6 @@ export type NodeTemplateListItemType = {
|
||||
hasTokenFee?: boolean; // 是否配置积分
|
||||
instructions?: string; // 使用说明
|
||||
courseUrl?: string; // 教程链接
|
||||
sourceMember?: SourceMember;
|
||||
};
|
||||
|
||||
export type NodeTemplateListType = {
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
"openai": "4.61.0",
|
||||
"openapi-types": "^12.1.3",
|
||||
"json5": "^2.2.3",
|
||||
"timezones-list": "^3.0.2",
|
||||
"@bany/curl-to-json": "^1.2.8"
|
||||
"timezones-list": "^3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
|
||||
@@ -12,7 +12,6 @@ export type CreateTeamProps = {
|
||||
avatar?: string;
|
||||
defaultTeam?: boolean;
|
||||
memberName?: string;
|
||||
memberAvatar?: string;
|
||||
};
|
||||
export type UpdateTeamProps = Omit<ThirdPartyAccountType, 'externalWorkflowVariable'> & {
|
||||
name?: string;
|
||||
|
||||
@@ -5,6 +5,8 @@ export const OrgMemberCollectionName = 'team_org_members';
|
||||
|
||||
export const getOrgChildrenPath = (org: OrgSchemaType) => `${org.path}/${org.pathId}`;
|
||||
|
||||
export enum SyncOrgSourceEnum {
|
||||
wecom = 'wecom'
|
||||
}
|
||||
// export enum OrgMemberRole {
|
||||
// owner = 'owner',
|
||||
// admin = 'admin',
|
||||
// member = 'member'
|
||||
// }
|
||||
|
||||
@@ -13,7 +13,6 @@ type OrgSchemaType = {
|
||||
};
|
||||
|
||||
type OrgMemberSchemaType = {
|
||||
_id: string;
|
||||
teamId: string;
|
||||
orgId: string;
|
||||
tmbId: string;
|
||||
@@ -21,6 +20,6 @@ type OrgMemberSchemaType = {
|
||||
|
||||
type OrgType = Omit<OrgSchemaType, 'avatar'> & {
|
||||
avatar: string;
|
||||
permission: TeamPermission;
|
||||
members: OrgMemberSchemaType[];
|
||||
permission: TeamPermission;
|
||||
};
|
||||
|
||||
1
packages/global/support/user/team/type.d.ts
vendored
@@ -44,7 +44,6 @@ export type TeamMemberSchema = {
|
||||
name: string;
|
||||
role: `${TeamMemberRoleEnum}`;
|
||||
status: `${TeamMemberStatusEnum}`;
|
||||
avatar: string;
|
||||
defaultTeam: boolean;
|
||||
};
|
||||
|
||||
|
||||
10
packages/global/support/user/type.d.ts
vendored
@@ -1,12 +1,12 @@
|
||||
import { TeamPermission } from '../permission/user/controller';
|
||||
import { UserStatusEnum } from './constant';
|
||||
import { TeamMemberStatusEnum } from './team/constant';
|
||||
import { TeamTmbItemType } from './team/type';
|
||||
|
||||
export type UserModelSchema = {
|
||||
_id: string;
|
||||
username: string;
|
||||
password: string;
|
||||
avatar: string;
|
||||
promotionRate: number;
|
||||
inviterId?: string;
|
||||
openaiKey: string;
|
||||
@@ -22,7 +22,7 @@ export type UserModelSchema = {
|
||||
export type UserType = {
|
||||
_id: string;
|
||||
username: string;
|
||||
avatar: string; // it should be team member's avatar after 4.8.18
|
||||
avatar: string;
|
||||
timezone: string;
|
||||
promotionRate: UserModelSchema['promotionRate'];
|
||||
team: TeamTmbItemType;
|
||||
@@ -30,9 +30,3 @@ export type UserType = {
|
||||
notificationAccount?: string;
|
||||
permission: TeamPermission;
|
||||
};
|
||||
|
||||
export type SourceMemberType = {
|
||||
name: string;
|
||||
avatar: string;
|
||||
status: `${TeamMemberStatusEnum}`;
|
||||
};
|
||||
|
||||
@@ -12,8 +12,7 @@ const staticPluginList = [
|
||||
'DingTalkWebhook',
|
||||
'WeWorkWebhook',
|
||||
'google',
|
||||
'bing',
|
||||
'delay'
|
||||
'bing'
|
||||
];
|
||||
// Run in worker thread (Have npm packages)
|
||||
const packagePluginList = [
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import { delay } from '@fastgpt/global/common/system/utils';
|
||||
|
||||
type Props = {
|
||||
ms: number;
|
||||
};
|
||||
type Response = Promise<Number>;
|
||||
|
||||
const main = async ({ ms }: Props): Response => {
|
||||
if (typeof ms !== 'number' || ms <= 0 || ms > 300000) {
|
||||
return ms;
|
||||
}
|
||||
|
||||
await delay(ms);
|
||||
|
||||
return ms;
|
||||
};
|
||||
|
||||
export default main;
|
||||
@@ -1,318 +0,0 @@
|
||||
{
|
||||
"author": "collin",
|
||||
"version": "4817",
|
||||
"name": "流程等待",
|
||||
"avatar": "core/workflow/template/sleep",
|
||||
"intro": "让工作流等待指定时间后运行",
|
||||
"showStatus": true,
|
||||
"weight": 1,
|
||||
|
||||
"isTool": true,
|
||||
"templateType": "tools",
|
||||
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "pluginInput",
|
||||
"name": "workflow:template.plugin_start",
|
||||
"intro": "workflow:intro_plugin_input",
|
||||
"avatar": "core/workflow/template/workflowStart",
|
||||
"flowNodeType": "pluginInput",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 627.6352390819724,
|
||||
"y": -165.05298493910118
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"renderTypeList": ["numberInput", "reference"],
|
||||
"selectedTypeIndex": 0,
|
||||
"valueType": "number",
|
||||
"canEdit": true,
|
||||
"key": "延迟时长",
|
||||
"label": "延迟时长",
|
||||
"description": "需要暂停的时间,单位毫秒",
|
||||
"defaultValue": 1000,
|
||||
"list": [
|
||||
{
|
||||
"label": "",
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"maxFiles": 5,
|
||||
"canSelectFile": true,
|
||||
"canSelectImg": true,
|
||||
"required": true,
|
||||
"toolDescription": "需要暂停的时间,单位毫秒",
|
||||
"max": 300000,
|
||||
"min": 1
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "ms",
|
||||
"valueType": "number",
|
||||
"key": "延迟时长",
|
||||
"label": "延迟时长",
|
||||
"type": "hidden"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "pluginOutput",
|
||||
"name": "common:core.module.template.self_output",
|
||||
"intro": "workflow:intro_custom_plugin_output",
|
||||
"avatar": "core/workflow/template/pluginOutput",
|
||||
"flowNodeType": "pluginOutput",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 1921.839722563351,
|
||||
"y": -160.05298493910115
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "any",
|
||||
"canEdit": true,
|
||||
"key": "result",
|
||||
"label": "result",
|
||||
"isToolOutput": true,
|
||||
"description": "",
|
||||
"required": true,
|
||||
"value": ["zCJC6zw7c14i", "httpRawResponse"]
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "pluginConfig",
|
||||
"name": "common:core.module.template.system_config",
|
||||
"intro": "",
|
||||
"avatar": "core/workflow/template/systemConfig",
|
||||
"flowNodeType": "pluginConfig",
|
||||
"position": {
|
||||
"x": 184.66337662472682,
|
||||
"y": -216.05298493910115
|
||||
},
|
||||
"version": "4811",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "zCJC6zw7c14i",
|
||||
"name": "HTTP 请求",
|
||||
"intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
|
||||
"avatar": "core/workflow/template/httpRequest",
|
||||
"flowNodeType": "httpRequest468",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1154.4041630064592,
|
||||
"y": -455.0529849391012
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "common:core.module.input.description.HTTP Dynamic Input",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpMethod",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"value": "POST",
|
||||
"required": true,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpTimeout",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "number",
|
||||
"label": "",
|
||||
"value": 30,
|
||||
"min": 5,
|
||||
"max": 600,
|
||||
"required": true,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpReqUrl",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"description": "common:core.module.input.description.Http Request Url",
|
||||
"placeholder": "https://api.ai.com/getInventory",
|
||||
"required": false,
|
||||
"value": "delay",
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpHeader",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"description": "common:core.module.input.description.Http Request Header",
|
||||
"placeholder": "common:core.module.input.description.Http Request Header",
|
||||
"required": false,
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpParams",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"required": false,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpJsonBody",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": "{\n\"ms\": {{$pluginInput.ms$}}\n}",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpFormBody",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"required": false,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpContentType",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"value": "json",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "error",
|
||||
"key": "error",
|
||||
"label": "workflow:request_error",
|
||||
"description": "HTTP请求错误信息,成功时返回空",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "httpRawResponse",
|
||||
"key": "httpRawResponse",
|
||||
"required": true,
|
||||
"label": "workflow:raw_response",
|
||||
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
|
||||
"valueType": "any",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "输出字段提取",
|
||||
"customFieldConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
},
|
||||
"description": "可以通过 JSONPath 语法来提取响应值中的指定字段",
|
||||
"valueDesc": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "pluginInput",
|
||||
"target": "zCJC6zw7c14i",
|
||||
"sourceHandle": "pluginInput-source-right",
|
||||
"targetHandle": "zCJC6zw7c14i-target-left"
|
||||
},
|
||||
{
|
||||
"source": "zCJC6zw7c14i",
|
||||
"target": "pluginOutput",
|
||||
"sourceHandle": "zCJC6zw7c14i-source-right",
|
||||
"targetHandle": "pluginOutput-target-left"
|
||||
}
|
||||
],
|
||||
"chatConfig": {
|
||||
"welcomeText": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
||||
import { ApiRequestProps } from '../../type/next';
|
||||
|
||||
export function parsePaginationRequest(req: ApiRequestProps) {
|
||||
const {
|
||||
pageSize = 10,
|
||||
pageNum = 1,
|
||||
offset = 0
|
||||
} = Object.keys(req.body).includes('pageSize')
|
||||
? req.body
|
||||
: Object.keys(req.query).includes('pageSize')
|
||||
? req.query
|
||||
: {};
|
||||
if (!pageSize || (pageNum === undefined && offset === undefined)) {
|
||||
throw new Error(CommonErrEnum.missingParams);
|
||||
}
|
||||
return {
|
||||
pageSize: Number(pageSize),
|
||||
offset: offset ? Number(offset) : (Number(pageNum) - 1) * Number(pageSize)
|
||||
};
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import type { NextApiResponse, NextApiRequest } from 'next';
|
||||
import NextCors from 'nextjs-cors';
|
||||
|
||||
export async function withNextCors(req: NextApiRequest, res: NextApiResponse) {
|
||||
const methods = ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'];
|
||||
const methods = ['GET', 'eHEAD', 'PUT', 'PATCH', 'POST', 'DELETE'];
|
||||
|
||||
const allowedOrigins = process.env.ALLOWED_ORIGINS?.split(',');
|
||||
const origin = req.headers.origin;
|
||||
|
||||
@@ -99,13 +99,7 @@ export const useApiDatasetRequest = ({ apiServer }: { apiServer: APIFileServer }
|
||||
if (files.some((file) => !file.id || !file.name || typeof file.type === 'undefined')) {
|
||||
return Promise.reject('Invalid file data format');
|
||||
}
|
||||
|
||||
const formattedFiles = files.map((file) => ({
|
||||
...file,
|
||||
hasChild: file.type === 'folder'
|
||||
}));
|
||||
|
||||
return formattedFiles;
|
||||
return files;
|
||||
};
|
||||
|
||||
const getFileContent = async ({ teamId, apiFileId }: { teamId: string; apiFileId: string }) => {
|
||||
|
||||
@@ -284,7 +284,7 @@ export async function searchDatasetData(props: SearchDatasetDataProps) {
|
||||
{
|
||||
_id: { $in: collectionIdList }
|
||||
},
|
||||
'_id name fileId rawLink apiFileId externalFileId externalFileUrl',
|
||||
'_id name fileId rawLink externalFileId externalFileUrl',
|
||||
{ ...readFromSecondary }
|
||||
).lean()
|
||||
]);
|
||||
@@ -525,7 +525,7 @@ export async function searchDatasetData(props: SearchDatasetDataProps) {
|
||||
{
|
||||
_id: { $in: searchResults.map((item) => item.collectionId) }
|
||||
},
|
||||
'_id name fileId rawLink apiFileId externalFileId externalFileUrl',
|
||||
'_id name fileId rawLink externalFileId externalFileUrl',
|
||||
{ ...readFromSecondary }
|
||||
).lean()
|
||||
]);
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
import { getTmbInfoByTmbId } from '../../support/user/team/controller';
|
||||
import { getResourcePermission } from '../../support/permission/controller';
|
||||
import { PerResourceTypeEnum } from '@fastgpt/global/support/permission/constant';
|
||||
import { DatasetPermission } from '@fastgpt/global/support/permission/dataset/controller';
|
||||
|
||||
// TODO: 需要优化成批量获取权限
|
||||
export const filterDatasetsByTmbId = async ({
|
||||
datasetIds,
|
||||
tmbId
|
||||
}: {
|
||||
datasetIds: string[];
|
||||
tmbId: string;
|
||||
}) => {
|
||||
const { teamId, permission: tmbPer } = await getTmbInfoByTmbId({ tmbId });
|
||||
|
||||
// First get all permissions
|
||||
const permissions = await Promise.all(
|
||||
datasetIds.map(async (datasetId) => {
|
||||
const per = await getResourcePermission({
|
||||
teamId,
|
||||
tmbId,
|
||||
resourceId: datasetId,
|
||||
resourceType: PerResourceTypeEnum.dataset
|
||||
});
|
||||
|
||||
if (per === undefined) return false;
|
||||
|
||||
const datasetPer = new DatasetPermission({
|
||||
per,
|
||||
isOwner: tmbPer.isOwner
|
||||
});
|
||||
|
||||
return datasetPer.hasReadPer;
|
||||
})
|
||||
);
|
||||
|
||||
// Then filter datasetIds based on permissions
|
||||
return datasetIds.filter((_, index) => permissions[index]);
|
||||
};
|
||||
@@ -210,7 +210,7 @@ export const runToolWithToolChoice = async (
|
||||
properties[item.key] = {
|
||||
...jsonSchema,
|
||||
description: item.toolDescription || '',
|
||||
enum: item.enum?.split('\n').filter(Boolean) || undefined
|
||||
enum: item.enum?.split('\n').filter(Boolean) || []
|
||||
};
|
||||
});
|
||||
|
||||
@@ -227,7 +227,6 @@ export const runToolWithToolChoice = async (
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// Filter histories by maxToken
|
||||
const filterMessages = (
|
||||
await filterGPTMessageByMaxTokens({
|
||||
|
||||
@@ -17,7 +17,6 @@ import { ChatNodeUsageType } from '@fastgpt/global/support/wallet/bill/type';
|
||||
import { checkTeamReRankPermission } from '../../../../support/permission/teamLimit';
|
||||
import { MongoDataset } from '../../../dataset/schema';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
import { filterDatasetsByTmbId } from '../../../dataset/utils';
|
||||
|
||||
type DatasetSearchProps = ModuleDispatchProps<{
|
||||
[NodeInputKeyEnum.datasetSelectList]: SelectedDatasetType;
|
||||
@@ -30,7 +29,6 @@ type DatasetSearchProps = ModuleDispatchProps<{
|
||||
[NodeInputKeyEnum.datasetSearchExtensionModel]: string;
|
||||
[NodeInputKeyEnum.datasetSearchExtensionBg]: string;
|
||||
[NodeInputKeyEnum.collectionFilterMatch]: string;
|
||||
[NodeInputKeyEnum.authTmbId]: boolean;
|
||||
}>;
|
||||
export type DatasetSearchResponse = DispatchNodeResultType<{
|
||||
[NodeOutputKeyEnum.datasetQuoteQA]: SearchDataResponseItemType[];
|
||||
@@ -41,7 +39,6 @@ export async function dispatchDatasetSearch(
|
||||
): Promise<DatasetSearchResponse> {
|
||||
const {
|
||||
runningAppInfo: { teamId },
|
||||
runningUserInfo: { tmbId },
|
||||
histories,
|
||||
node,
|
||||
params: {
|
||||
@@ -55,8 +52,7 @@ export async function dispatchDatasetSearch(
|
||||
datasetSearchUsingExtensionQuery,
|
||||
datasetSearchExtensionModel,
|
||||
datasetSearchExtensionBg,
|
||||
collectionFilterMatch,
|
||||
authTmbId = false
|
||||
collectionFilterMatch
|
||||
}
|
||||
} = props as DatasetSearchProps;
|
||||
|
||||
@@ -68,20 +64,18 @@ export async function dispatchDatasetSearch(
|
||||
return Promise.reject(i18nT('common:core.chat.error.Select dataset empty'));
|
||||
}
|
||||
|
||||
const emptyResult = {
|
||||
quoteQA: [],
|
||||
[DispatchNodeResponseKeyEnum.nodeResponse]: {
|
||||
totalPoints: 0,
|
||||
query: '',
|
||||
limit,
|
||||
searchMode
|
||||
},
|
||||
nodeDispatchUsages: [],
|
||||
[DispatchNodeResponseKeyEnum.toolResponses]: []
|
||||
};
|
||||
|
||||
if (!userChatInput) {
|
||||
return emptyResult;
|
||||
return {
|
||||
quoteQA: [],
|
||||
[DispatchNodeResponseKeyEnum.nodeResponse]: {
|
||||
totalPoints: 0,
|
||||
query: '',
|
||||
limit,
|
||||
searchMode
|
||||
},
|
||||
nodeDispatchUsages: [],
|
||||
[DispatchNodeResponseKeyEnum.toolResponses]: []
|
||||
};
|
||||
}
|
||||
|
||||
// query extension
|
||||
@@ -89,24 +83,13 @@ export async function dispatchDatasetSearch(
|
||||
? getLLMModel(datasetSearchExtensionModel)
|
||||
: undefined;
|
||||
|
||||
const [{ concatQueries, rewriteQuery, aiExtensionResult }, datasetIds] = await Promise.all([
|
||||
datasetSearchQueryExtension({
|
||||
query: userChatInput,
|
||||
extensionModel,
|
||||
extensionBg: datasetSearchExtensionBg,
|
||||
histories: getHistories(6, histories)
|
||||
}),
|
||||
authTmbId
|
||||
? filterDatasetsByTmbId({
|
||||
datasetIds: datasets.map((item) => item.datasetId),
|
||||
tmbId
|
||||
})
|
||||
: Promise.resolve(datasets.map((item) => item.datasetId))
|
||||
]);
|
||||
const { concatQueries, rewriteQuery, aiExtensionResult } = await datasetSearchQueryExtension({
|
||||
query: userChatInput,
|
||||
extensionModel,
|
||||
extensionBg: datasetSearchExtensionBg,
|
||||
histories: getHistories(6, histories)
|
||||
});
|
||||
|
||||
if (datasetIds.length === 0) {
|
||||
return emptyResult;
|
||||
}
|
||||
// console.log(concatQueries, rewriteQuery, aiExtensionResult);
|
||||
|
||||
// get vector
|
||||
@@ -127,7 +110,7 @@ export async function dispatchDatasetSearch(
|
||||
model: vectorModel.model,
|
||||
similarity,
|
||||
limit,
|
||||
datasetIds,
|
||||
datasetIds: datasets.map((item) => item.datasetId),
|
||||
searchMode,
|
||||
usingReRank: usingReRank && (await checkTeamReRankPermission(teamId)),
|
||||
collectionFilterMatch
|
||||
|
||||
@@ -487,16 +487,16 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
if (input.key === dynamicInput?.key) return;
|
||||
|
||||
// Skip some special key
|
||||
if (
|
||||
[NodeInputKeyEnum.childrenNodeIdList, NodeInputKeyEnum.httpJsonBody].includes(
|
||||
input.key as any
|
||||
)
|
||||
) {
|
||||
if (input.key === NodeInputKeyEnum.childrenNodeIdList) {
|
||||
params[input.key] = input.value;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// replace {{$xx.xx$}} and {{xx}} variables
|
||||
// replace {{xx}} variables
|
||||
// let value = replaceVariable(input.value, variables);
|
||||
|
||||
// replace {{$xx.xx$}} variables
|
||||
let value = replaceEditorVariable({
|
||||
text: input.value,
|
||||
nodes: runtimeNodes,
|
||||
@@ -606,11 +606,6 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
};
|
||||
}
|
||||
|
||||
// Error
|
||||
if (dispatchRes?.responseData?.error) {
|
||||
addLog.warn('workflow error', dispatchRes.responseData.error);
|
||||
}
|
||||
|
||||
return {
|
||||
node,
|
||||
runStatus: 'run',
|
||||
|
||||
@@ -72,7 +72,6 @@ export const dispatchRunPlugin = async (props: RunPluginProps): Promise<RunPlugi
|
||||
showStatus: false
|
||||
};
|
||||
});
|
||||
|
||||
const runtimeVariables = {
|
||||
...filterSystemVariables(props.variables),
|
||||
appId: String(plugin.id)
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { ModuleDispatchProps } from '@fastgpt/global/core/workflow/runtime/
|
||||
import {
|
||||
NodeInputKeyEnum,
|
||||
NodeOutputKeyEnum,
|
||||
VARIABLE_NODE_ID,
|
||||
WorkflowIOValueTypeEnum
|
||||
} from '@fastgpt/global/core/workflow/constants';
|
||||
import {
|
||||
@@ -17,9 +16,7 @@ import { DispatchNodeResultType } from '@fastgpt/global/core/workflow/runtime/ty
|
||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||
import {
|
||||
textAdaptGptResponse,
|
||||
replaceEditorVariable,
|
||||
formatVariableValByType,
|
||||
getReferenceVariableValue
|
||||
replaceEditorVariable
|
||||
} from '@fastgpt/global/core/workflow/runtime/utils';
|
||||
import { ContentTypes } from '@fastgpt/global/core/workflow/constants';
|
||||
import { uploadFileFromBase64Img } from '../../../../common/file/gridfs/controller';
|
||||
@@ -100,86 +97,22 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
|
||||
const concatVariables = {
|
||||
...variables,
|
||||
...body,
|
||||
// ...dynamicInput,
|
||||
...systemVariables
|
||||
};
|
||||
const allVariables: Record<string, any> = {
|
||||
const allVariables = {
|
||||
[NodeInputKeyEnum.addInputParam]: concatVariables,
|
||||
...concatVariables
|
||||
};
|
||||
|
||||
// General data for variable substitution(Exclude: json body)
|
||||
const replaceStringVariables = (text: string) => {
|
||||
return replaceEditorVariable({
|
||||
text,
|
||||
nodes: runtimeNodes,
|
||||
variables: allVariables
|
||||
});
|
||||
};
|
||||
/* Replace the JSON string to reduce parsing errors
|
||||
1. Replace undefined values with null
|
||||
2. Replace newline strings
|
||||
*/
|
||||
const replaceJsonBodyString = (text: string) => {
|
||||
const valToStr = (val: any) => {
|
||||
if (val === undefined) return 'null';
|
||||
if (val === null) return 'null';
|
||||
|
||||
if (typeof val === 'object') return JSON.stringify(val);
|
||||
|
||||
if (typeof val === 'string') {
|
||||
try {
|
||||
const parsed = JSON.parse(val);
|
||||
if (typeof parsed === 'object') {
|
||||
return JSON.stringify(parsed);
|
||||
}
|
||||
return val;
|
||||
} catch (error) {
|
||||
const str = JSON.stringify(val);
|
||||
return str.startsWith('"') && str.endsWith('"') ? str.slice(1, -1) : str;
|
||||
}
|
||||
}
|
||||
|
||||
return String(val);
|
||||
};
|
||||
|
||||
// 1. Replace {{key.key}} variables
|
||||
const regex1 = /\{\{\$([^.]+)\.([^$]+)\$\}\}/g;
|
||||
const matches1 = [...text.matchAll(regex1)];
|
||||
matches1.forEach((match) => {
|
||||
const nodeId = match[1];
|
||||
const id = match[2];
|
||||
|
||||
const variableVal = (() => {
|
||||
if (nodeId === VARIABLE_NODE_ID) {
|
||||
return variables[id];
|
||||
}
|
||||
// Find upstream node input/output
|
||||
const node = runtimeNodes.find((node) => node.nodeId === nodeId);
|
||||
if (!node) return;
|
||||
|
||||
const output = node.outputs.find((output) => output.id === id);
|
||||
if (output) return formatVariableValByType(output.value, output.valueType);
|
||||
|
||||
const input = node.inputs.find((input) => input.key === id);
|
||||
if (input)
|
||||
return getReferenceVariableValue({ value: input.value, nodes: runtimeNodes, variables });
|
||||
})();
|
||||
|
||||
const formatVal = valToStr(variableVal);
|
||||
|
||||
const regex = new RegExp(`\\{\\{\\$(${nodeId}\\.${id})\\$\\}\\}`, 'g');
|
||||
text = text.replace(regex, () => formatVal);
|
||||
});
|
||||
|
||||
// 2. Replace {{key}} variables
|
||||
const regex2 = /{{([^}]+)}}/g;
|
||||
const matches2 = text.match(regex2) || [];
|
||||
const uniqueKeys2 = [...new Set(matches2.map((match) => match.slice(2, -2)))];
|
||||
for (const key of uniqueKeys2) {
|
||||
text = text.replace(new RegExp(`{{(${key})}}`, 'g'), () => valToStr(allVariables[key]));
|
||||
}
|
||||
|
||||
return text.replace(/(".*?")\s*:\s*undefined\b/g, '$1: null');
|
||||
return replaceVariable(
|
||||
replaceEditorVariable({
|
||||
text,
|
||||
nodes: runtimeNodes,
|
||||
variables: allVariables
|
||||
}),
|
||||
allVariables
|
||||
);
|
||||
};
|
||||
|
||||
httpReqUrl = replaceStringVariables(httpReqUrl);
|
||||
@@ -243,12 +176,15 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
|
||||
}
|
||||
if (!httpJsonBody) return {};
|
||||
if (httpContentType === ContentTypes.json) {
|
||||
httpJsonBody = replaceJsonBodyString(httpJsonBody);
|
||||
console.log(httpJsonBody);
|
||||
return json5.parse(httpJsonBody);
|
||||
}
|
||||
httpJsonBody = replaceStringVariables(httpJsonBody);
|
||||
|
||||
// Raw text, xml
|
||||
const replaceJsonBody = httpJsonBody.replace(/(".*?")\s*:\s*undefined\b/g, '$1: null');
|
||||
|
||||
// Json body, parse and return
|
||||
const jsonParse = json5.parse(replaceJsonBody);
|
||||
const removeSignJson = removeUndefinedSign(jsonParse);
|
||||
return removeSignJson;
|
||||
}
|
||||
httpJsonBody = replaceStringVariables(httpJsonBody);
|
||||
return httpJsonBody.replaceAll(UNDEFINED_SIGN, 'null');
|
||||
} catch (error) {
|
||||
@@ -399,40 +335,40 @@ async function fetchData({
|
||||
};
|
||||
}
|
||||
|
||||
// function replaceVariable(text: string, obj: Record<string, any>) {
|
||||
// for (const [key, value] of Object.entries(obj)) {
|
||||
// if (value === undefined) {
|
||||
// text = text.replace(new RegExp(`{{(${key})}}`, 'g'), UNDEFINED_SIGN);
|
||||
// } else {
|
||||
// const replacement = JSON.stringify(value);
|
||||
// const unquotedReplacement =
|
||||
// replacement.startsWith('"') && replacement.endsWith('"')
|
||||
// ? replacement.slice(1, -1)
|
||||
// : replacement;
|
||||
// text = text.replace(new RegExp(`{{(${key})}}`, 'g'), () => unquotedReplacement);
|
||||
// }
|
||||
// }
|
||||
// return text || '';
|
||||
// }
|
||||
// function removeUndefinedSign(obj: Record<string, any>) {
|
||||
// for (const key in obj) {
|
||||
// if (obj[key] === UNDEFINED_SIGN) {
|
||||
// obj[key] = undefined;
|
||||
// } else if (Array.isArray(obj[key])) {
|
||||
// obj[key] = obj[key].map((item: any) => {
|
||||
// if (item === UNDEFINED_SIGN) {
|
||||
// return undefined;
|
||||
// } else if (typeof item === 'object') {
|
||||
// removeUndefinedSign(item);
|
||||
// }
|
||||
// return item;
|
||||
// });
|
||||
// } else if (typeof obj[key] === 'object') {
|
||||
// removeUndefinedSign(obj[key]);
|
||||
// }
|
||||
// }
|
||||
// return obj;
|
||||
// }
|
||||
function replaceVariable(text: string, obj: Record<string, any>) {
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
if (value === undefined) {
|
||||
text = text.replace(new RegExp(`{{(${key})}}`, 'g'), UNDEFINED_SIGN);
|
||||
} else {
|
||||
const replacement = JSON.stringify(value);
|
||||
const unquotedReplacement =
|
||||
replacement.startsWith('"') && replacement.endsWith('"')
|
||||
? replacement.slice(1, -1)
|
||||
: replacement;
|
||||
text = text.replace(new RegExp(`{{(${key})}}`, 'g'), () => unquotedReplacement);
|
||||
}
|
||||
}
|
||||
return text || '';
|
||||
}
|
||||
function removeUndefinedSign(obj: Record<string, any>) {
|
||||
for (const key in obj) {
|
||||
if (obj[key] === UNDEFINED_SIGN) {
|
||||
obj[key] = undefined;
|
||||
} else if (Array.isArray(obj[key])) {
|
||||
obj[key] = obj[key].map((item: any) => {
|
||||
if (item === UNDEFINED_SIGN) {
|
||||
return undefined;
|
||||
} else if (typeof item === 'object') {
|
||||
removeUndefinedSign(item);
|
||||
}
|
||||
return item;
|
||||
});
|
||||
} else if (typeof obj[key] === 'object') {
|
||||
removeUndefinedSign(obj[key]);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
// Replace some special response from system plugin
|
||||
async function replaceSystemPluginResponse({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { MongoTeamMember } from '../../user/team/teamMemberSchema';
|
||||
import { checkTeamAIPoints } from '../teamLimit';
|
||||
import { UserErrEnum } from '@fastgpt/global/common/error/code/user';
|
||||
import { UserModelSchema } from '@fastgpt/global/support/user/type';
|
||||
import { TeamSchema } from '@fastgpt/global/support/user/team/type';
|
||||
import { TeamErrEnum } from '@fastgpt/global/common/error/code/team';
|
||||
|
||||
export async function getUserChatInfoAndAuthTeamPoints(tmbId: string) {
|
||||
const tmb = await MongoTeamMember.findById(tmbId, 'userId teamId')
|
||||
@@ -18,7 +18,7 @@ export async function getUserChatInfoAndAuthTeamPoints(tmbId: string) {
|
||||
])
|
||||
.lean();
|
||||
|
||||
if (!tmb) return Promise.reject(TeamErrEnum.notUser);
|
||||
if (!tmb) return Promise.reject(UserErrEnum.binVisitor);
|
||||
|
||||
await checkTeamAIPoints(tmb.team._id);
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import { ParentIdType } from '@fastgpt/global/common/parentFolder/type';
|
||||
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
||||
import { MemberGroupSchemaType } from '@fastgpt/global/support/permission/memberGroup/type';
|
||||
import { TeamMemberSchema } from '@fastgpt/global/support/user/team/type';
|
||||
import { UserModelSchema } from '@fastgpt/global/support/user/type';
|
||||
import { OrgSchemaType } from '@fastgpt/global/support/user/team/org/type';
|
||||
import { getOrgIdSetWithParentByTmbId } from './org/controllers';
|
||||
|
||||
@@ -150,9 +151,13 @@ export const getClbsAndGroupsWithInfo = async ({
|
||||
$exists: true
|
||||
}
|
||||
})
|
||||
.populate<{ tmb: TeamMemberSchema }>({
|
||||
.populate<{ tmb: TeamMemberSchema & { user: UserModelSchema } }>({
|
||||
path: 'tmb',
|
||||
select: 'name userId avatar'
|
||||
select: 'name userId role',
|
||||
populate: {
|
||||
path: 'user',
|
||||
select: 'avatar'
|
||||
}
|
||||
})
|
||||
.lean(),
|
||||
MongoResourcePermission.find({
|
||||
|
||||
@@ -47,11 +47,14 @@ export const OrgSchema = new Schema(
|
||||
OrgSchema.virtual('members', {
|
||||
ref: OrgMemberCollectionName,
|
||||
localField: '_id',
|
||||
foreignField: 'orgId',
|
||||
match: function (this: OrgSchemaType) {
|
||||
return { teamId: this.teamId };
|
||||
}
|
||||
foreignField: 'orgId'
|
||||
});
|
||||
// OrgSchema.virtual('permission', {
|
||||
// ref: ResourcePermissionCollectionName,
|
||||
// localField: '_id',
|
||||
// foreignField: 'orgId',
|
||||
// justOne: true
|
||||
// });
|
||||
|
||||
try {
|
||||
OrgSchema.index({
|
||||
|
||||
@@ -41,7 +41,7 @@ export async function getUserDetail({
|
||||
return {
|
||||
_id: user._id,
|
||||
username: user.username,
|
||||
avatar: tmb.avatar,
|
||||
avatar: user.avatar,
|
||||
timezone: user.timezone,
|
||||
promotionRate: user.promotionRate,
|
||||
team: tmb,
|
||||
|
||||
@@ -3,6 +3,7 @@ const { Schema } = connectionMongo;
|
||||
import { hashStr } from '@fastgpt/global/common/string/tools';
|
||||
import type { UserModelSchema } from '@fastgpt/global/support/user/type';
|
||||
import { UserStatusEnum, userStatusMap } from '@fastgpt/global/support/user/constant';
|
||||
import { getRandomUserAvatar } from '@fastgpt/global/support/user/utils';
|
||||
|
||||
export const userCollectionName = 'users';
|
||||
|
||||
@@ -32,6 +33,11 @@ const UserSchema = new Schema({
|
||||
type: Date,
|
||||
default: () => new Date()
|
||||
},
|
||||
avatar: {
|
||||
type: String,
|
||||
default: () => getRandomUserAvatar()
|
||||
},
|
||||
|
||||
promotionRate: {
|
||||
type: Number,
|
||||
default: 15
|
||||
@@ -56,10 +62,7 @@ const UserSchema = new Schema({
|
||||
ref: userCollectionName
|
||||
},
|
||||
fastgpt_sem: Object,
|
||||
sourceDomain: String,
|
||||
|
||||
/** @deprecated */
|
||||
avatar: String
|
||||
sourceDomain: String
|
||||
});
|
||||
|
||||
try {
|
||||
|
||||
@@ -37,7 +37,7 @@ async function getTeamMember(match: Record<string, any>): Promise<TeamTmbItemTyp
|
||||
teamAvatar: tmb.team.avatar,
|
||||
teamName: tmb.team.name,
|
||||
memberName: tmb.name,
|
||||
avatar: tmb.avatar,
|
||||
avatar: tmb.team.avatar,
|
||||
balance: tmb.team.balance,
|
||||
tmbId: String(tmb._id),
|
||||
teamDomain: tmb.team?.teamDomain,
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
TeamMemberCollectionName,
|
||||
TeamCollectionName
|
||||
} from '@fastgpt/global/support/user/team/constant';
|
||||
import { getRandomUserAvatar } from '@fastgpt/global/support/user/utils';
|
||||
|
||||
const TeamMemberSchema = new Schema({
|
||||
teamId: {
|
||||
@@ -20,10 +19,6 @@ const TeamMemberSchema = new Schema({
|
||||
ref: userCollectionName,
|
||||
required: true
|
||||
},
|
||||
avatar: {
|
||||
type: String,
|
||||
default: () => getRandomUserAvatar()
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
default: 'Member'
|
||||
@@ -44,6 +39,7 @@ const TeamMemberSchema = new Schema({
|
||||
// Abandoned
|
||||
role: {
|
||||
type: String
|
||||
// enum: Object.keys(TeamMemberRoleMap) // disable enum validation for old data
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import { SourceMemberType } from '@fastgpt/global/support/user/type';
|
||||
import { MongoTeam } from './team/teamSchema';
|
||||
import { MongoTeamMember } from './team/teamMemberSchema';
|
||||
import { ClientSession } from '../../common/mongo';
|
||||
|
||||
/* export dataset limit */
|
||||
export const updateExportDatasetLimit = async (teamId: string) => {
|
||||
@@ -70,41 +67,3 @@ export const checkWebSyncLimit = async ({
|
||||
return Promise.reject(`每个团队,每 ${limitMinutes} 分钟仅使用一次同步功能。`);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This function will add a property named sourceMember to the list passed in.
|
||||
* @param list The list to add the sourceMember property to. [TmbId] property is required.
|
||||
* @error If member is not found, this item will be skipped.
|
||||
* @returns The list with the sourceMember property added.
|
||||
*/
|
||||
export async function addSourceMember<T extends { tmbId: string }>({
|
||||
list,
|
||||
session
|
||||
}: {
|
||||
list: T[];
|
||||
session?: ClientSession;
|
||||
}): Promise<Array<T & { sourceMember: SourceMemberType }>> {
|
||||
if (!Array.isArray(list)) return [];
|
||||
|
||||
const tmbList = await MongoTeamMember.find(
|
||||
{
|
||||
_id: { $in: list.map((item) => String(item.tmbId)) }
|
||||
},
|
||||
'tmbId name avatar status',
|
||||
{
|
||||
session
|
||||
}
|
||||
).lean();
|
||||
|
||||
return list
|
||||
.map((item) => {
|
||||
const tmb = tmbList.find((tmb) => String(tmb._id) === String(item.tmbId));
|
||||
if (!tmb) return;
|
||||
|
||||
return {
|
||||
...item,
|
||||
sourceMember: { name: tmb.name, avatar: tmb.avatar, status: tmb.status }
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as Array<T & { sourceMember: SourceMemberType }>;
|
||||
}
|
||||
|
||||
15
packages/web/common/fetch/type.d.ts
vendored
@@ -1,13 +1,8 @@
|
||||
import { RequireOnlyOne } from '@fastgpt/global/common/type/utils';
|
||||
|
||||
type PaginationProps<T = {}> = T & {
|
||||
pageSize: number | string;
|
||||
} & RequireOnlyOne<{
|
||||
offset: number | string;
|
||||
pageNum: number | string;
|
||||
}>;
|
||||
|
||||
type PaginationResponse<T = {}> = {
|
||||
export type PaginationProps<T = {}> = T & {
|
||||
offset: number;
|
||||
pageSize: number;
|
||||
};
|
||||
export type PaginationResponse<T = any> = {
|
||||
total: number;
|
||||
list: T[];
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ function AvatarGroup({
|
||||
<Flex position="relative">
|
||||
{avatars.slice(0, max).map((avatar, index) => (
|
||||
<Avatar
|
||||
key={index}
|
||||
key={avatar + groupId}
|
||||
src={avatar}
|
||||
position={index > 0 ? 'absolute' : 'relative'}
|
||||
left={index > 0 ? `${index * 15}px` : 0}
|
||||
|
||||
@@ -142,7 +142,6 @@ export const iconPaths = {
|
||||
'core/app/ttsFill': () => import('./icons/core/app/ttsFill.svg'),
|
||||
'core/app/type/httpPlugin': () => import('./icons/core/app/type/httpPlugin.svg'),
|
||||
'core/app/type/httpPluginFill': () => import('./icons/core/app/type/httpPluginFill.svg'),
|
||||
'core/app/type/jsonImport': () => import('./icons/core/app/type/jsonImport.svg'),
|
||||
'core/app/type/plugin': () => import('./icons/core/app/type/plugin.svg'),
|
||||
'core/app/type/pluginFill': () => import('./icons/core/app/type/pluginFill.svg'),
|
||||
'core/app/type/pluginLight': () => import('./icons/core/app/type/pluginLight.svg'),
|
||||
@@ -270,7 +269,6 @@ export const iconPaths = {
|
||||
import('./icons/core/workflow/template/datasource.svg'),
|
||||
'core/workflow/template/duckduckgo': () =>
|
||||
import('./icons/core/workflow/template/duckduckgo.svg'),
|
||||
'core/workflow/template/sleep': () => import('./icons/core/workflow/template/sleep.svg'),
|
||||
'core/workflow/template/extractJson': () =>
|
||||
import('./icons/core/workflow/template/extractJson.svg'),
|
||||
'core/workflow/template/fetchUrl': () => import('./icons/core/workflow/template/fetchUrl.svg'),
|
||||
@@ -387,8 +385,6 @@ export const iconPaths = {
|
||||
'model/sparkDesk': () => import('./icons/model/sparkDesk.svg'),
|
||||
'model/stepfun': () => import('./icons/model/stepfun.svg'),
|
||||
'model/yi': () => import('./icons/model/yi.svg'),
|
||||
'model/intern': () => import('./icons/model/intern.svg'),
|
||||
'model/moka': () => import('./icons/model/moka.svg'),
|
||||
more: () => import('./icons/more.svg'),
|
||||
moreLine: () => import('./icons/moreLine.svg'),
|
||||
out: () => import('./icons/out.svg'),
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none">
|
||||
<g clip-path="url(#clip0_16784_2993)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.5271 4.37083L25.4043 8.01175C26.3626 8.91164 26.8417 9.36158 27.1828 9.89648C27.4727 10.3511 27.6882 10.849 27.8211 11.3715C27.9775 11.9863 27.9775 12.6436 27.9775 13.9582V19.4935C27.0071 19.026 25.919 18.764 24.7697 18.764C20.6828 18.764 17.3698 22.077 17.3698 26.1639C17.3698 27.502 17.7249 28.7571 18.3461 29.8401H12.1799C9.29446 29.8401 7.85176 29.8401 6.75362 29.2697C5.82822 28.789 5.07369 28.0344 4.59299 27.1091C4.02255 26.0109 4.02255 24.5682 4.02255 21.6828V10.3173C4.02255 7.43186 4.02255 5.98915 4.59299 4.89101C5.07369 3.96561 5.82822 3.21108 6.75362 2.73038C7.85176 2.15994 9.29447 2.15994 12.1799 2.15994H15.943C17.1489 2.15994 17.7519 2.15994 18.3216 2.29333C18.806 2.40673 19.2711 2.59087 19.7019 2.83981C20.2085 3.1326 20.6481 3.54535 21.5271 4.37083ZM19.1105 6.20351C18.3195 5.4451 17.924 5.0659 17.5846 5.05216C17.315 5.04124 17.0548 5.15224 16.8761 5.3544C16.6511 5.60893 16.6511 6.15685 16.6511 7.25268V8.50383C16.6511 10.1068 16.6511 10.9083 16.963 11.5205C17.2374 12.0591 17.6753 12.4969 18.2138 12.7713C18.8261 13.0833 19.6276 13.0833 21.2305 13.0833H22.6697C23.8233 13.0833 24.4001 13.0833 24.6566 12.8505C24.8602 12.6658 24.9678 12.3979 24.9487 12.1238C24.9247 11.7782 24.5084 11.379 23.6757 10.5806L19.1105 6.20351Z" fill="url(#paint0_linear_16784_2993)"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.5057 21.6108C23.8901 20.1169 26.0117 20.1169 26.3961 21.6108C26.6044 22.4202 27.4368 22.9007 28.2419 22.6764C29.7278 22.2624 30.7886 24.0997 29.6871 25.1796C29.0903 25.7646 29.0903 26.7258 29.6871 27.3108C30.7886 28.3907 29.7278 30.228 28.2419 29.814C27.4368 29.5897 26.6044 30.0703 26.3961 30.8796C26.0117 32.3735 23.8901 32.3735 23.5057 30.8796C23.2974 30.0703 22.4651 29.5897 21.66 29.814C20.174 30.228 19.1133 28.3907 20.2148 27.3108C20.8116 26.7258 20.8116 25.7646 20.2148 25.1796C19.1133 24.0997 20.174 22.2624 21.66 22.6764C22.4651 22.9007 23.2974 22.4202 23.5057 21.6108ZM26.8127 26.2452C26.8127 27.2734 25.9791 28.107 24.9509 28.107C23.9227 28.107 23.0891 27.2734 23.0891 26.2452C23.0891 25.217 23.9227 24.3834 24.9509 24.3834C25.9791 24.3834 26.8127 25.217 26.8127 26.2452Z" fill="url(#paint1_linear_16784_2993)"/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_16784_2993" x1="17.0824" y1="2.15994" x2="17.0824" y2="32" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#BAC6D8"/>
|
||||
<stop offset="1" stop-color="#9FA9C2"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_16784_2993" x1="17.0824" y1="2.15994" x2="17.0824" y2="32" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#BAC6D8"/>
|
||||
<stop offset="1" stop-color="#9FA9C2"/>
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_16784_2993">
|
||||
<rect width="32" height="32" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.9 KiB |
@@ -1,7 +0,0 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
width="200" height="200">
|
||||
<path d="M-70.54222222-70.54222222m582.54222222 0l0 0q582.54222222 0 582.54222222 582.54222222l0 0q0 582.54222222-582.54222222 582.54222222l0 0q-582.54222222 0-582.54222222-582.54222222l0 0q0-582.54222222 582.54222222-582.54222222Z"
|
||||
fill="#1296db"/>
|
||||
<path d="M422.64477924 243.86730561H243.86730561v536.26538878h178.77747363V243.86730561zM780.13269439 243.86730561h-178.77747363v536.26538878H780.13269439V243.86730561z"
|
||||
fill="#ffffff"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 593 B |
|
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 17 KiB |
@@ -1,20 +0,0 @@
|
||||
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.6719 37.9311C13.6719 37.9311 17.7467 37.4782 17.9732 37.4027C18.1997 37.3272 22.4255 37.5537 22.4255 37.5537L25.1414 38.2332L27.6308 39.1392L28.3102 39.3656L32.0076 38.0066L36.4599 37.3271L39.4777 37.4027L41.816 37.7047L42.7976 38.0066L42.722 42.0813L40.6836 41.5529L36.7598 41.2509L34.0439 41.4773L31.7056 42.0061L29.5937 42.6853L28.0837 43.2893L24.9149 42.0813L21.0666 41.3265H16.6142L13.6719 41.8549V37.9311Z" fill="#1B3882" fill-opacity="0.5"/>
|
||||
<path d="M28.0723 43.9999C21.2124 40.2227 13.9268 42.4879 13.8534 42.5111L13.0312 42.7731V37.572L13.4674 37.4315C13.7841 37.3287 21.3298 34.9694 28.6783 39.0149L28.0723 40.1179C22.175 36.8716 15.9652 38.09 14.2896 38.5095V41.0891C16.479 40.5691 22.6447 39.5727 28.6783 42.8947L28.0723 43.9979V43.9999Z" fill="#1B3882"/>
|
||||
<path d="M27.9869 44.0003L27.3809 42.8976C33.4145 39.5754 39.5802 40.5715 41.7696 41.0915V38.5122C40.096 38.0906 33.8842 36.8743 27.9869 40.1208L27.3809 39.0176C34.7294 34.9721 42.2752 37.3314 42.5916 37.4342L43.028 37.5747V42.7779L42.206 42.5115C42.1344 42.4883 34.8489 40.2235 27.9869 44.0003Z" fill="#1B3882"/>
|
||||
<path d="M35.8849 32.1384C35.887 31.6833 35.7276 31.2932 35.4047 30.9535C35.0859 30.6305 34.7 30.4774 34.2554 30.49C33.8003 30.5215 33.4123 30.7039 33.0852 31.0227C32.7664 31.4085 32.6112 31.8112 32.6133 32.2684C32.6112 32.7067 32.7664 33.0968 33.0789 33.4177C33.3977 33.7574 33.7877 33.9126 34.2491 33.8811C34.6979 33.8832 35.0838 33.7008 35.4005 33.3485C35.7234 32.9961 35.8828 32.5914 35.887 32.1363L35.8849 32.1384Z" fill="#1B3882" fill-opacity="0.5"/>
|
||||
<path d="M23.1787 33.3504C23.5016 32.9981 23.661 32.6122 23.6589 32.155C23.661 31.6999 23.5016 31.2763 23.1829 30.9198C22.841 30.6304 22.4593 30.4941 22.0315 30.5067C21.5617 30.5549 21.1737 30.7205 20.8613 31.0058C20.5425 31.3581 20.3831 31.7775 20.3789 32.2515C20.3789 32.7066 20.5404 33.0967 20.8591 33.4196C21.1675 33.7594 21.5554 33.9125 22.0147 33.8831C22.4887 33.8684 22.8725 33.7028 23.1765 33.3504H23.1787Z" fill="#1B3882" fill-opacity="0.5"/>
|
||||
<path d="M27.9635 37.9078C26.7031 37.9078 25.4658 37.8029 24.5179 37.5596C21.9677 36.9053 19.9376 35.7246 18.3123 33.9483C16.6241 32.1007 16.5171 30.3202 16.4039 28.4348C16.3891 28.1936 16.3745 27.9482 16.3556 27.6987C16.2046 25.612 15.2189 22.3509 15.2085 22.3194L15.1309 22.0636L15.2881 21.8476C16.7394 19.872 18.5283 18.4606 20.7618 17.5294C22.8128 16.6738 25.2539 16.2271 28.2257 16.1621C33.1729 15.8727 38.5669 17.93 41.054 21.0569L41.2116 21.254L40.0852 26.5075C40.0728 26.7906 39.9888 28.2691 39.5819 31.2912C39.1037 34.8312 34.7311 36.8571 32.485 37.4317C31.3442 37.7253 29.6308 37.9078 27.9614 37.9078H27.9635ZM16.3095 22.267C16.5527 23.1038 17.2867 25.7441 17.4231 27.619C17.4419 27.8728 17.4566 28.1244 17.4713 28.3698C17.5804 30.2069 17.6684 31.6582 19.1008 33.2269C20.5814 34.8459 22.4395 35.9259 24.7821 36.5257C26.7681 37.0354 30.348 36.878 32.2208 36.3957C33.8335 35.9826 38.1097 34.2314 38.5249 31.1444C38.9633 27.8958 39.0199 26.4299 39.022 26.4152V26.3691L40.062 21.5246C38.4263 18.383 37.4554 17.7392 35.3749 16.9548C33.1813 16.1264 30.5074 17.0911 28.2781 17.2232H28.2592C22.5759 17.347 18.4087 15.5245 16.3074 22.2649L16.3095 22.267Z" fill="#1B3882"/>
|
||||
<path d="M39.1368 21.9314C39.5416 22.9736 39.7136 23.4958 40.0932 24.4501C40.0932 24.4501 41.0976 22.8374 41.4144 21.6839C41.7332 20.5178 41.538 19.033 41.2884 17.6447C40.6616 15.3148 40.1748 15.1344 38.2938 13.7544C37.4591 13.1819 36.5153 12.6744 35.4479 12.2277C33.1389 11.3574 30.8194 10.875 28.4852 10.7743C26.172 10.7345 23.8379 11.0805 21.4995 11.8082C20.4132 12.1857 19.4443 12.6387 18.5865 13.163C16.632 14.4276 15.2709 16.2081 14.5138 18.4941C14.3104 19.3539 13.9874 20.1802 14.0671 20.9772C14.432 24.6325 16.8165 26.2369 16.6529 25.356C16.4411 24.2194 16.5774 23.5483 16.8689 22.4619C17.4226 20.4067 18.7333 18.8883 20.8032 17.9215H20.8095C21.2122 17.8083 23.2528 16.6486 25.9623 18.0348C26.6816 18.3431 27.94 19.1778 28.5691 19.1589C29.2004 19.14 30.1084 18.5318 30.769 18.1187C32.0106 17.3406 33.1871 17.0743 34.7411 17.5671C36.9998 18.278 38.386 19.8845 39.1368 21.9334V21.9314Z" fill="#1B3882"/>
|
||||
<path d="M5.81212 20.1084L7.5108 20.6075L9.45912 20.5068L10.8579 19.5568L12.3574 18.2083L13.4563 16.7088L14.8552 15.2597L16.2036 14.4103L18.0512 14.0098L16.8014 16.2076L15.7528 17.2562L13.5549 20.3034L12.5566 21.8029L11.4074 22.6019L9.759 23.7008C9.759 23.7008 8.30984 24.0008 8.16096 24.0511C8.01204 24.1014 6.81248 24.3006 6.81248 24.3006L5.76388 24.2503L4.96484 24.0008L5.71352 22.5013L5.8142 21.4023V20.1042L5.81212 20.1084Z" fill="#1B3882" fill-opacity="0.5"/>
|
||||
<path d="M10.1579 11.4685L10.0069 12.6157L9.60842 13.4168L9.10929 14.1655L7.85938 14.9142L9.35886 15.6629L11.0072 16.313L12.7059 16.6632L13.4547 16.7136L15.254 15.4637L17.152 13.7649L16.5019 13.5657L14.1551 13.3161L12.4061 12.666L11.1561 12.018L10.1579 11.4685Z" fill="#1B3882" fill-opacity="0.5"/>
|
||||
<path d="M6.36581 24.7249C5.83729 24.7249 5.28153 24.6934 4.69853 24.6326L3.59961 24.5067L4.14069 24.1586L4.43009 23.8461C4.46993 23.7853 4.58529 23.584 4.77613 23.1604V23.1562C5.08441 22.4935 5.19137 21.3841 5.09701 19.8594L5.03197 18.8339L5.82261 19.4882C6.64893 20.1719 7.68493 20.3355 8.98729 19.9831C10.1512 19.6518 11.4179 18.5654 12.7475 16.7577C13.9702 14.9981 15.7297 13.8048 17.9821 13.2092L18.1939 13.1526L19.6179 14.262L18.3386 14.1697C18.2191 14.2851 18.0995 14.4088 17.9905 14.5451L17.9653 14.5766L17.9318 14.6059C17.1977 15.9104 16.147 17.1981 15.0964 18.6074L15.0817 18.6325C14.9202 18.9157 14.7545 19.2093 14.5742 19.5008V19.5155L14.5154 19.6098C13.4396 21.3589 12.2568 22.6696 10.9985 23.5085C9.84293 24.318 8.28893 24.7269 6.36581 24.7269V24.7249ZM5.45561 23.8063C7.62621 23.9468 9.31861 23.6029 10.493 22.7766L10.5014 22.7703C11.6402 22.0132 12.7244 20.8115 13.7248 19.2009C13.7437 19.1463 13.7709 19.1002 13.8003 19.0646C13.9786 18.7773 14.1463 18.4815 14.3099 18.1942V18.19C15.0208 16.8269 15.8388 15.6147 16.751 14.5766C15.39 15.1764 14.312 16.0677 13.4773 17.2694L13.471 17.2799C12.0009 19.2827 10.6126 20.4466 9.22845 20.8409C8.00581 21.1701 6.93205 21.1114 6.02185 20.6668C6.04073 21.9209 5.89813 22.8626 5.58985 23.5274C5.54369 23.6322 5.49965 23.7245 5.45981 23.8063H5.45561Z" fill="#1B3882"/>
|
||||
<path d="M6.46611 24.7247C5.93763 24.7247 5.38187 24.6932 4.79883 24.6324L4.89111 23.7495C7.38255 24.0116 9.29939 23.6845 10.5913 22.7764L10.6017 22.7701C11.7405 22.013 12.8247 20.8113 13.8251 19.2007C13.8607 19.1021 13.9174 19.035 13.9677 18.991L14.5486 19.6621C14.6367 19.5845 14.6745 19.4796 14.6807 19.4062L14.6724 19.5132L14.6157 19.6076C13.5399 21.3566 12.3571 22.6674 11.0988 23.5062C9.94323 24.3157 8.38923 24.7247 6.46611 24.7247Z" fill="#1B3882"/>
|
||||
<path d="M14.0572 16.2124C13.8685 16.225 13.6797 16.2355 13.4909 16.2418C11.9957 16.2942 10.3997 15.8769 8.73667 15.0024C10.1774 14.0712 10.578 13.01 10.5213 12.0537C10.8653 12.3263 11.2239 12.5654 11.5972 12.7689C14.0425 14.1467 16.6263 14.3648 21.0429 13.1296L20.743 12.2928C16.5465 13.4505 14.2732 13.2596 12.0271 11.9929C11.3896 11.6469 10.7982 11.1813 10.2697 10.6129L10.2089 10.5479L9.29871 9.56226L9.47067 10.829C9.49583 10.9338 10.018 13.4064 7.63355 14.6123L6.91211 14.9772L7.60839 15.3903C9.55875 16.5501 11.4504 17.1373 13.233 17.1373L14.0572 16.2145V16.2124Z" fill="#1B3882"/>
|
||||
<path d="M25.2919 29.8378C25.0151 29.8378 24.7551 29.6658 24.6271 29.3764C24.0336 28.0216 23.5681 27.4574 22.8655 26.6039C22.1545 25.742 20.6404 24.2823 20.3908 24.0705C20.0574 23.7874 19.963 23.4015 20.1622 23.1352C20.2629 23.003 20.5607 22.7367 21.1731 23.1435C22.4146 23.9656 25.1703 26.4382 25.9148 28.4242C26.1874 29.1457 25.9148 29.6364 25.5499 29.7853C25.4639 29.821 25.3779 29.8356 25.2898 29.8356L25.2919 29.8378Z" fill="#1B3882"/>
|
||||
<path d="M30.6502 29.8713C30.5621 29.8713 30.4719 29.8545 30.3839 29.8168C30.019 29.6637 29.7547 29.1688 30.0357 28.4515C30.8054 26.476 33.5925 24.039 34.8446 23.2316C35.4633 22.8332 35.7569 23.1016 35.8554 23.2358C36.0525 23.5042 35.954 23.888 35.6163 24.167C35.3647 24.3767 33.8317 25.8132 33.1102 26.6689C32.3972 27.5141 31.9253 28.0719 31.3129 29.4204C31.1829 29.7056 30.9249 29.8734 30.6523 29.8734L30.6502 29.8713Z" fill="#1B3882"/>
|
||||
<path d="M33.3855 8.21144C33.4043 7.18172 32.9031 6.29461 31.8817 5.5522C30.8437 4.82448 29.6042 4.45748 28.1635 4.447C26.7227 4.43648 25.4875 4.79092 24.4703 5.51444C23.4469 6.24428 22.9247 7.12088 22.9121 8.14224C22.9163 8.461 22.9436 8.75253 22.9834 9.02513C26.8024 7.79621 30.2229 7.89685 33.2387 9.32925C33.3205 8.94753 33.3708 8.57632 33.3855 8.20932V8.21144Z" fill="#1B3882" fill-opacity="0.5"/>
|
||||
<path d="M17.4187 28.9379L17.3998 28.8939C17.3495 28.7786 17.3055 28.6611 17.2698 28.5458L17.1629 28.2018L16.4561 28.2249L16.4016 28.8184C16.4058 28.8414 16.4183 28.8981 16.4309 28.9988V29.0197C16.4372 29.0554 16.4393 29.0847 16.4456 29.1141C16.4561 29.4287 16.3617 29.6782 16.1478 29.8984C15.9444 30.1144 15.6781 30.2109 15.3278 30.1962C14.8937 30.1794 14.749 30.0054 14.6777 29.8754C14.4869 29.5314 14.4743 29.3469 14.4848 29.2651C14.512 29.0407 14.5581 28.8037 14.6232 28.5646C14.7238 28.1913 14.6483 27.7572 14.3946 27.277L14.1345 26.7841C14.0359 26.5975 13.95 26.3626 13.8787 26.0858C13.8241 25.853 13.8388 25.574 13.9206 25.2532C13.994 24.97 14.1513 24.7478 14.4009 24.5716C14.6504 24.4038 14.9482 24.343 15.3027 24.3891L15.3299 24.3933H15.3572C15.7053 24.3954 15.9905 24.429 16.2087 24.4877C16.1478 24.148 16.1289 23.7935 16.1604 23.4328C15.9318 23.3364 15.7011 23.2692 15.4683 23.2378H15.4558L15.2838 23.2231C14.7658 23.1748 14.2603 23.2902 13.7822 23.567C13.2873 23.8564 12.9538 24.2843 12.7923 24.84C12.6539 25.3245 12.6371 25.8236 12.7399 26.3206C12.7525 26.3961 12.7693 26.4842 12.7986 26.5681C12.8762 26.8135 13.0041 27.0861 13.1803 27.3797C13.4487 27.8222 13.5305 27.9669 13.5536 28.0152L13.562 28.0319C13.5955 28.0928 13.6019 28.185 13.5788 28.3067L13.5704 28.3465C13.5452 28.4828 13.5201 28.6108 13.5096 28.659C13.2999 29.2022 13.2789 29.7034 13.4445 30.1417C13.6123 30.6073 13.908 30.947 14.3275 31.1568C14.5707 31.2763 14.8518 31.3518 15.1643 31.3832C15.3341 31.4 15.5124 31.4021 15.699 31.3916C16.3051 31.3602 16.7979 31.0728 17.123 30.5674C17.4418 30.0872 17.5445 29.5545 17.4334 28.9862L17.425 28.9379H17.4187Z" fill="#1B3882"/>
|
||||
<path d="M43.4628 24.106C43.2992 23.5565 42.9592 23.1308 42.4516 22.8393H42.4496C41.9948 22.5792 41.508 22.4723 41.0004 22.5205C40.9816 22.5205 40.9628 22.5247 40.944 22.5268L40.776 22.5478H40.7616C40.4384 22.6002 40.1156 22.7219 39.801 22.9043C39.8031 22.9295 39.8073 22.9567 39.8115 22.9819C39.8408 23.3028 39.8262 23.6195 39.7716 23.9277L39.9541 23.8543C40.1868 23.76 40.5036 23.6824 40.9208 23.6195L40.944 23.6153C41.2628 23.5502 41.5376 23.609 41.806 23.804C42.0888 24.0095 42.28 24.2654 42.3888 24.5821C42.4792 24.8799 42.4916 25.1357 42.4288 25.3622C42.3512 25.6453 42.2632 25.897 42.1664 26.1088C42.0512 26.3521 41.9336 26.5891 41.8184 26.8051C41.6444 27.128 41.5816 27.4783 41.634 27.8432C41.678 28.1619 41.724 28.4262 41.7764 28.6527C41.8144 28.81 41.7912 29.0113 41.7092 29.2504L41.7052 29.2609C41.638 29.4748 41.2772 29.5901 41.0676 29.6405C40.5896 29.7537 40.3756 29.5797 40.2476 29.4223C40.0296 29.1413 39.9268 28.8373 39.9331 28.4954L39.9415 28.3968C39.952 28.2983 39.9625 28.2479 39.9667 28.2291L39.9519 27.6167L39.1676 27.6356L39.0838 27.9711C39.0544 28.0865 39.0166 28.1997 38.9684 28.3129L38.9474 28.3612L38.939 28.4136C38.8468 28.9715 38.9621 29.5021 39.2788 29.9928L39.2872 30.0033C39.6332 30.5024 40.128 30.7771 40.7176 30.7981C40.8748 30.8065 41.0276 30.8023 41.1724 30.7897C41.5208 30.7583 41.8312 30.666 42.0972 30.5171C42.4896 30.3011 42.7684 29.955 42.932 29.4874C43.0872 29.0281 43.0556 28.529 42.8396 28.0026L42.7872 27.6922L42.7832 27.6691C42.758 27.558 42.7684 27.4489 42.8104 27.3399C42.8924 27.1448 43.0032 26.9183 43.1396 26.6604C43.318 26.3458 43.4332 26.0795 43.496 25.8529C43.5276 25.7523 43.5488 25.6642 43.5548 25.5761C43.6368 25.0833 43.6052 24.5905 43.4584 24.1102L43.4628 24.106Z" fill="#1B3882"/>
|
||||
<path d="M33.7641 9.18672C33.8249 8.8512 33.8606 8.53452 33.8731 8.21784C33.8941 7.0392 33.3258 6.02 32.1807 5.1874C31.0755 4.41144 29.7396 4.013 28.2108 4.0004C26.6777 3.98572 25.3481 4.3758 24.2554 5.15176C23.1125 5.96756 22.5253 6.97212 22.5106 8.13812V8.14864C22.5127 8.3814 22.5274 8.6142 22.5568 8.85748C22.4498 8.9854 22.3911 9.12592 22.3848 9.27692V9.29368C22.3848 9.68796 22.4414 10.0822 22.5609 10.4639L22.563 10.4744C22.7266 10.9568 23.0076 11.416 23.3998 11.8397L23.5131 11.9613L24.5449 12.0766C25.4257 12.5884 26.6022 12.8631 28.0493 12.8882C28.1122 12.8882 28.1751 12.8882 28.2359 12.8882C29.3034 12.8882 30.2366 12.7582 31.0126 12.5024L31.0336 12.494C31.3251 12.3808 31.6082 12.2444 31.8787 12.0872C32.7008 12.1647 33.3174 11.76 33.6341 10.9358L33.7117 10.8519L33.7075 10.7344C33.8291 10.3612 34.043 9.62924 33.762 9.18672H33.7641ZM24.7693 5.87528C25.7046 5.21048 26.8581 4.87912 28.2024 4.8896C29.5466 4.90008 30.7127 5.24612 31.6627 5.91092C32.5666 6.56736 32.9986 7.31816 32.9839 8.19268C32.9776 8.35416 32.965 8.51984 32.942 8.6918C31.4152 8.05216 29.7857 7.7334 28.0598 7.7334C26.577 7.7334 25.0251 7.97036 23.4103 8.44224C23.404 8.34156 23.3998 8.24092 23.3977 8.14232C23.4103 7.26572 23.8591 6.52332 24.7693 5.87528ZM32.9756 10.0445L32.6756 10.6925C32.6756 10.6925 32.2835 11.2588 31.8556 11.1874L31.69 11.1602L31.5474 11.2483C31.2873 11.4098 31.0105 11.5482 30.7232 11.6593C29.9996 11.8963 29.1042 12.0096 28.064 11.9949C26.7763 11.9697 25.7445 11.739 24.9958 11.3049C24.9727 11.2902 24.9496 11.2755 24.9286 11.265L24.8406 11.2105L23.9472 11.112C23.7773 10.9127 23.5361 10.4933 23.5361 10.4933L23.2908 9.78232C23.2908 9.78232 23.2782 9.48032 23.2761 9.41112C26.8916 8.27236 30.1674 8.36672 33.0133 9.69216C33.0175 9.7446 32.9756 10.0445 32.9756 10.0445ZM33.2419 10.7051V10.6988L33.2482 10.7051H33.2419Z" fill="#1B3882"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 14 KiB |
@@ -1,5 +1,5 @@
|
||||
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g >
|
||||
<g clip-path="url(#clip0_28116_23027)">
|
||||
<path d="M13.7936 8H13.7456L13.6836 13.23H13.7276C17.1576 13.23 19.8196 15.944 25.6076 25.722L25.9576 26.316L25.9816 26.356L29.2216 21.48L29.1976 21.442C28.4896 20.2828 27.7574 19.1386 27.0016 18.01C26.2575 16.8963 25.4736 15.8096 24.6516 14.752C20.8256 9.864 17.6256 8 13.7936 8Z" fill="url(#paint0_linear_28116_23027)"/>
|
||||
<path d="M13.7455 8C9.89953 8.02 6.49353 10.516 4.03953 14.34C4.03284 14.3513 4.02617 14.3627 4.01953 14.374L8.52753 16.836L8.54953 16.802C9.98553 14.636 11.7695 13.254 13.6855 13.232H13.7275L13.7915 8H13.7455Z" fill="url(#paint1_linear_28116_23027)"/>
|
||||
<path d="M4.03906 14.3401L4.01706 14.3741C2.40106 16.8941 1.19706 19.9901 0.549062 23.3281L0.539062 23.3721L5.60706 24.5721L5.61506 24.5281C6.15506 21.5941 7.18706 18.8721 8.52706 16.8381L8.54906 16.8041L4.03906 14.3401Z" fill="url(#paint2_linear_28116_23027)"/>
|
||||
@@ -70,5 +70,8 @@
|
||||
<stop offset="0.2765" stop-color="#0867DF"/>
|
||||
<stop offset="1" stop-color="#0471E9"/>
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_28116_23027">
|
||||
<rect width="48" height="48" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.3 KiB |
@@ -1,24 +0,0 @@
|
||||
<svg viewBox="0 0 45 26" xmlns="http://www.w3.org/2000/svg" version="1.1">
|
||||
<!-- Generator: Sketch 55 (78076) - https://sketchapp.com -->
|
||||
|
||||
<title>Group</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g>
|
||||
<title>Layer 1</title>
|
||||
<g fill-rule="evenodd" fill="none" id="组件">
|
||||
<g id="页脚">
|
||||
<g id="Group">
|
||||
<g id="Page-1">
|
||||
<path fill="#0C8CF6" id="Fill-1" d="m20.9587,24.53226l-4.85075,-7.2592l2.16824,-1.44214l4.128,6.1776l9.34013,-13.9776l2.16824,1.44214l-10.06287,15.0592c-0.68757,1.02916 -2.20343,1.02916 -2.89099,0"/>
|
||||
<polygon points="68.33575105667114,19.651321411132812 64.82147645950317,11.577018737792969 64.11480379104614,23.955184936523438 59.74661684036255,23.955184936523438 60.87459993362427,3.1465225219726562 65.50557374954224,3.1465225219726562 70.11526155471802,13.803489685058594 74.72494173049927,3.1465225219726562 79.35287141799927,3.1465225219726562 80.4812970161438,23.955184936523438 76.11614656448364,23.955184936523438 75.40946626663208,11.577018737792969 71.89519929885864,19.651321411132812 " fill="#FFFFFF" id="Fill-3"/>
|
||||
<path fill="#FFFFFF" id="Fill-5" d="m90.0524,20.24468c0.89258,0 1.59187,-0.29683 2.09745,-0.8905c0.50601,-0.59366 0.75879,-1.64233 0.75879,-3.14686c0,-1.50324 -0.25278,-2.5571 -0.75879,-3.16074c-0.50558,-0.60363 -1.20487,-0.90566 -2.09745,-0.90566c-0.87303,0 -1.57232,0.31156 -2.09788,0.9347c-0.52599,0.624 -0.78833,1.6679 -0.78833,3.1317c0,1.50453 0.25757,2.5532 0.77357,3.14686c0.51556,0.59367 1.22007,0.8905 2.11264,0.8905m0,-11.9626c1.03113,0 1.99364,0.14387 2.88621,0.4303c0.89258,0.28687 1.66093,0.74707 2.30593,1.38017c0.64414,0.63397 1.14971,1.4547 1.51717,2.46393c0.36702,1.00924 0.55074,2.22647 0.55074,3.65084c0,1.42523 -0.18372,2.64246 -0.55074,3.65126c-0.36746,1.00967 -0.87303,1.83084 -1.51717,2.46437c-0.645,0.63353 -1.41335,1.0933 -2.30593,1.38017c-0.89257,0.28643 -1.85508,0.4303 -2.88621,0.4303c-1.05198,0 -2.01839,-0.14387 -2.90098,-0.4303c-0.88302,-0.28687 -1.64659,-0.74664 -2.29116,-1.38017c-0.645,-0.63353 -1.15057,-1.4547 -1.5176,-2.46437c-0.36745,-1.0088 -0.55031,-2.22603 -0.55031,-3.65126c0,-1.40444 0.18286,-2.60694 0.55031,-3.6062c0.36703,-0.99927 0.8726,-1.82044 1.5176,-2.46394c0.64457,-0.64263 1.40814,-1.1128 2.29116,-1.41006c0.88259,-0.29684 1.849,-0.44504 2.90098,-0.44504"/>
|
||||
<polygon points="100.08356142044067,23.955101013183594 104.57641267776489,23.955101013183594 104.57641267776489,2.682769775390625 100.08356142044067,2.682769775390625 " fill="#FFFFFF" id="Fill-7"/>
|
||||
<polygon points="104.54623079299927,15.940773010253906 109.77919435501099,8.459709167480469 114.86709260940552,8.459709167480469 109.48557710647583,15.732772827148438 115.46258211135864,23.955272674560547 110.4037823677063,23.955272674560547 " fill="#FFFFFF" id="Fill-9"/>
|
||||
<path fill="#FFFFFF" id="Fill-10" d="m124.83454,17.15783c-0.1985,-0.03986 -0.40698,-0.06413 -0.62459,-0.0741c-0.21891,-0.00996 -0.40698,-0.01516 -0.56595,-0.01516c-0.83307,0 -1.50717,0.12913 -2.02273,0.3861c-0.51644,0.25696 -0.774,0.70243 -0.774,1.33553c0,0.39607 0.09425,0.70807 0.28319,0.93513c0.18763,0.2275 0.42088,0.39607 0.69886,0.5044c0.27754,0.1092 0.56985,0.17334 0.8778,0.19284c0.30752,0.01993 0.56986,0.0299 0.78877,0.0299c0.39612,0 0.84263,-0.0494 1.33865,-0.14864l0,-3.146zm-1.54713,-3.26516c0.15853,0 0.37179,0.00476 0.63978,0.0143c0.26756,0.0104 0.56943,0.02556 0.90735,0.04506c-0.01998,-0.7722 -0.21457,-1.3247 -0.82743,-1.63063c-0.51296,-0.25567 -1.19618,-0.36703 -2.02925,-0.36703c-0.45606,0 -0.98162,0.0546 -1.57667,0.16336c-0.59505,0.10877 -1.24005,0.27214 -1.93413,0.48967l-0.4756,-1.63237c-0.05994,-0.21796 -0.14464,-0.53473 -0.25323,-0.94986c-0.10945,-0.416 -0.18372,-0.7423 -0.22325,-0.97977c0.99161,-0.3367 1.92936,-0.57893 2.81194,-0.72757c0.88259,-0.1482 1.68091,-0.2223 2.39497,-0.2223c2.10222,0 3.72884,0.50007 4.87985,1.4989c1.15014,0.9997 1.72565,2.75427 1.72565,4.95084l0,8.69743c-0.77357,0.2184 -1.66614,0.43073 -2.67773,0.6383c-1.01202,0.208 -2.10309,0.312 -3.27278,0.312c-1.032,0 -1.96931,-0.08927 -2.81237,-0.26737c-0.84306,-0.1781 -1.56668,-0.47493 -2.17172,-0.8905c-0.60548,-0.41556 -1.07109,-0.9594 -1.39859,-1.6328c-0.32706,-0.67253 -0.4908,-1.4937 -0.4908,-2.4635c0,-0.96936 0.20283,-1.781 0.60981,-2.43403c0.40655,-0.65347 0.9321,-1.17303 1.57711,-1.5587c0.64456,-0.3861 1.36861,-0.6578 2.17215,-0.8164c0.8031,-0.15773 1.61141,-0.23703 2.42494,-0.23703l0,0z"/>
|
||||
<path fill="#0C8CF6" id="Fill-11" d="m11.28274,23.05203l-7.29219,0l13.20144,-19.75653l3.64631,5.45653l-9.55556,14.3zm32.60399,-0.0949l-14.82457,-22.18536c-0.688,-1.02917 -2.20343,-1.02917 -2.89143,0l-3.76662,5.6368l-3.76619,-5.6368c-0.688,-1.02917 -2.20343,-1.02917 -2.89143,0l-14.82457,22.18536c-0.76966,1.1518 0.05776,2.6949 1.44549,2.6949l9.38008,0c0.58115,0 1.12321,-0.28946 1.4455,-0.77176l14.42324,-21.58477l13.20187,19.75653l-7.29219,0l-4.34344,-6.5l-1.56624,2.34347l3.99943,5.98477c0.32185,0.4823 0.86435,0.77176 1.4455,0.77176l9.38008,0c1.38773,0 2.21515,-1.5431 1.44549,-2.6949l0,0z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.9 KiB |
@@ -1,7 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
|
||||
<path d="M10 20C15.5229 20 20 15.5229 20 10C20 4.47712 15.5229 0 10 0C4.47712 0 0 4.47712 0 10C0 15.5229 4.47712 20 10 20Z" fill="#003425"/>
|
||||
<path d="M15.0705 12.0408C15.0705 11.8535 14.9961 11.6738 14.8636 11.5413C14.7311 11.4088 14.5515 11.3344 14.3641 11.3344C14.1768 11.3344 13.9971 11.4088 13.8646 11.5413C13.7321 11.6738 13.6577 11.8535 13.6577 12.0408V15.6829C13.6577 15.8702 13.7321 16.0499 13.8646 16.1824C13.9971 16.3149 14.1768 16.3893 14.3641 16.3893C14.5515 16.3893 14.7311 16.3149 14.8636 16.1824C14.9961 16.0499 15.0705 15.8702 15.0705 15.6829V12.0408Z" fill="white"/>
|
||||
<path d="M14.067 4.44512C13.9963 4.38501 13.9145 4.33941 13.8262 4.31092C13.7379 4.28243 13.6448 4.27162 13.5524 4.27909C13.4599 4.28656 13.3698 4.31218 13.2872 4.35448C13.2047 4.39677 13.1312 4.45492 13.0711 4.5256L9.12344 9.16752C9.02533 9.28249 8.96687 9.426 8.95672 9.5768C8.95112 9.61248 8.94824 9.6488 8.94824 9.68608V15.6202C8.94824 15.8075 9.02267 15.9872 9.15514 16.1197C9.28762 16.2521 9.46729 16.3266 9.65464 16.3266C9.84199 16.3266 10.0217 16.2521 10.1541 16.1197C10.2866 15.9872 10.361 15.8075 10.361 15.6202V9.8928L14.1474 5.44096C14.2076 5.37029 14.2532 5.28847 14.2816 5.20018C14.3101 5.11189 14.3209 5.01885 14.3135 4.92637C14.306 4.8339 14.2804 4.7438 14.2381 4.66123C14.1958 4.57865 14.1376 4.50522 14.067 4.44512Z" fill="white"/>
|
||||
<path d="M5.33941 4.12558C5.2806 4.05384 5.20823 3.99438 5.12644 3.9506C5.04465 3.90683 4.95504 3.87959 4.86272 3.87045C4.77041 3.8613 4.67719 3.87043 4.58841 3.89731C4.49962 3.92419 4.41699 3.96829 4.34525 4.0271C4.2735 4.08591 4.21405 4.15828 4.17027 4.24007C4.12649 4.32186 4.09926 4.41147 4.09011 4.50379C4.08097 4.5961 4.09009 4.68932 4.11697 4.7781C4.14385 4.86689 4.18796 4.94952 4.24677 5.02126L7.04389 8.43326C7.16266 8.57818 7.33414 8.66997 7.5206 8.68846C7.70705 8.70694 7.89321 8.6506 8.03813 8.53182C8.18304 8.41305 8.27484 8.24157 8.29332 8.05511C8.31181 7.86866 8.25546 7.6825 8.13669 7.53758L5.33925 4.12558H5.33941Z" fill="white"/>
|
||||
<path d="M15.3376 10.1726C15.5666 10.1726 15.7862 10.0817 15.9481 9.91972C16.11 9.7578 16.201 9.53818 16.201 9.30918C16.201 9.08018 16.11 8.86056 15.9481 8.69864C15.7862 8.53671 15.5666 8.44574 15.3376 8.44574C15.1086 8.44574 14.8889 8.53671 14.727 8.69864C14.5651 8.86056 14.4741 9.08018 14.4741 9.30918C14.4741 9.53818 14.5651 9.7578 14.727 9.91972C14.8889 10.0817 15.1086 10.1726 15.3376 10.1726Z" fill="#00FF25"/>
|
||||
<g clip-path="url(#clip0_19_444)">
|
||||
<path d="M10 20C15.5229 20 20 15.5229 20 10C20 4.47712 15.5229 0 10 0C4.47712 0 0 4.47712 0 10C0 15.5229 4.47712 20 10 20Z" fill="#003425"/>
|
||||
<path d="M15.0705 12.0408C15.0705 11.8535 14.9961 11.6738 14.8636 11.5413C14.7311 11.4088 14.5515 11.3344 14.3641 11.3344C14.1768 11.3344 13.9971 11.4088 13.8646 11.5413C13.7321 11.6738 13.6577 11.8535 13.6577 12.0408V15.6829C13.6577 15.8702 13.7321 16.0499 13.8646 16.1824C13.9971 16.3149 14.1768 16.3893 14.3641 16.3893C14.5515 16.3893 14.7311 16.3149 14.8636 16.1824C14.9961 16.0499 15.0705 15.8702 15.0705 15.6829V12.0408Z" fill="white"/>
|
||||
<path d="M14.067 4.44512C13.9963 4.38501 13.9145 4.33941 13.8262 4.31092C13.7379 4.28243 13.6448 4.27162 13.5524 4.27909C13.4599 4.28656 13.3698 4.31218 13.2872 4.35448C13.2047 4.39677 13.1312 4.45492 13.0711 4.5256L9.12344 9.16752C9.02533 9.28249 8.96687 9.426 8.95672 9.5768C8.95112 9.61248 8.94824 9.6488 8.94824 9.68608V15.6202C8.94824 15.8075 9.02267 15.9872 9.15514 16.1197C9.28762 16.2521 9.46729 16.3266 9.65464 16.3266C9.84199 16.3266 10.0217 16.2521 10.1541 16.1197C10.2866 15.9872 10.361 15.8075 10.361 15.6202V9.8928L14.1474 5.44096C14.2076 5.37029 14.2532 5.28847 14.2816 5.20018C14.3101 5.11189 14.3209 5.01885 14.3135 4.92637C14.306 4.8339 14.2804 4.7438 14.2381 4.66123C14.1958 4.57865 14.1376 4.50522 14.067 4.44512Z" fill="white"/>
|
||||
<path d="M5.33941 4.12558C5.2806 4.05384 5.20823 3.99438 5.12644 3.9506C5.04465 3.90683 4.95504 3.87959 4.86272 3.87045C4.77041 3.8613 4.67719 3.87043 4.58841 3.89731C4.49962 3.92419 4.41699 3.96829 4.34525 4.0271C4.2735 4.08591 4.21405 4.15828 4.17027 4.24007C4.12649 4.32186 4.09926 4.41147 4.09011 4.50379C4.08097 4.5961 4.09009 4.68932 4.11697 4.7781C4.14385 4.86689 4.18796 4.94952 4.24677 5.02126L7.04389 8.43326C7.16266 8.57818 7.33414 8.66997 7.5206 8.68846C7.70705 8.70694 7.89321 8.6506 8.03813 8.53182C8.18304 8.41305 8.27484 8.24157 8.29332 8.05511C8.31181 7.86866 8.25546 7.6825 8.13669 7.53758L5.33925 4.12558H5.33941Z" fill="white"/>
|
||||
<path d="M15.3376 10.1726C15.5666 10.1726 15.7862 10.0817 15.9481 9.91972C16.11 9.7578 16.201 9.53818 16.201 9.30918C16.201 9.08018 16.11 8.86056 15.9481 8.69864C15.7862 8.53671 15.5666 8.44574 15.3376 8.44574C15.1086 8.44574 14.8889 8.53671 14.727 8.69864C14.5651 8.86056 14.4741 9.08018 14.4741 9.30918C14.4741 9.53818 14.5651 9.7578 14.727 9.91972C14.8889 10.0817 15.1086 10.1726 15.3376 10.1726Z" fill="#00FF25"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_19_444">
|
||||
<rect width="20" height="20" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -4,23 +4,13 @@ import { Box, Icon } from '@chakra-ui/react';
|
||||
import { iconPaths } from './constants';
|
||||
import type { IconNameType } from './type.d';
|
||||
|
||||
const iconCache: Record<string, any> = {};
|
||||
|
||||
const MyIcon = ({ name, w = 'auto', h = 'auto', ...props }: { name: IconNameType } & IconProps) => {
|
||||
const [IconComponent, setIconComponent] = useState<any>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (iconCache[name]) {
|
||||
setIconComponent(iconCache[name]);
|
||||
return;
|
||||
}
|
||||
|
||||
iconPaths[name]?.()
|
||||
.then((icon) => {
|
||||
const component = { as: icon.default };
|
||||
// Store in cache
|
||||
iconCache[name] = component;
|
||||
setIconComponent(component);
|
||||
setIconComponent({ as: icon.default });
|
||||
})
|
||||
.catch((error) => console.log(error));
|
||||
}, [name]);
|
||||
@@ -40,4 +30,4 @@ const MyIcon = ({ name, w = 'auto', h = 'auto', ...props }: { name: IconNameType
|
||||
);
|
||||
};
|
||||
|
||||
export default MyIcon;
|
||||
export default React.memo(MyIcon);
|
||||
|
||||
@@ -31,7 +31,7 @@ const HttpInput = ({
|
||||
|
||||
const onChangeInput = useCallback(
|
||||
(editorState: EditorState, editor: LexicalEditor) => {
|
||||
const text = editorStateToText(editor);
|
||||
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
|
||||
setCurrentValue(text);
|
||||
onChange?.(text);
|
||||
},
|
||||
@@ -39,7 +39,7 @@ const HttpInput = ({
|
||||
);
|
||||
const onBlurInput = useCallback(
|
||||
(editor: LexicalEditor) => {
|
||||
const text = editorStateToText(editor);
|
||||
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
|
||||
onBlur?.(text);
|
||||
},
|
||||
[onBlur]
|
||||
|
||||
@@ -75,7 +75,6 @@ const MyModal = ({
|
||||
py={'10px'}
|
||||
fontSize={'md'}
|
||||
fontWeight={'bold'}
|
||||
minH={['46px', '53px']}
|
||||
>
|
||||
{iconSrc && (
|
||||
<>
|
||||
|
||||