4.6.8-alpha (#804)
* perf: redirect request and err log replace perf: dataset openapi feat: session fix: retry input error feat: 468 doc sub page feat: standard sub perf: rerank tip perf: rerank tip perf: api sdk perf: openapi sub plan perf: sub ui fix: ts * perf: init log * fix: variable select * sub page * icon * perf: llm model config * perf: menu ux * perf: system store * perf: publish app name * fix: init data * perf: flow edit ux * fix: value type format and ux * fix prompt editor default value (#13) * fix prompt editor default value * fix prompt editor update when not focus * add key with variable --------- Co-authored-by: Archer <545436317@qq.com> * fix: value type * doc * i18n * import path * home page * perf: mongo session running * fix: ts * perf: use toast * perf: flow edit * perf: sse response * slider ui * fetch error * fix prompt editor rerender when not focus by key defaultvalue (#14) * perf: prompt editor * feat: dataset search concat * perf: doc * fix:ts * perf: doc * fix json editor onblur value (#15) * faq * vector model default config * ipv6 --------- Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
@@ -78,7 +78,7 @@ COPY --from=builder /app/projects/$name/package.json ./package.json
|
||||
COPY --from=workerDeps /app/worker /app/worker
|
||||
# copy config
|
||||
COPY ./projects/$name/data /app/data
|
||||
|
||||
RUN chown -R nextjs:nodejs /app/data
|
||||
|
||||
ENV NODE_ENV production
|
||||
ENV NEXT_TELEMETRY_DISABLED 1
|
||||
|
@@ -208,10 +208,6 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||
</a>
|
||||
|
||||
## Translations
|
||||
|
||||
[](https://fink.inlang.com/github.com/labring/FastGPT?ref=badge)
|
||||
|
||||
## 使用协议
|
||||
|
||||
本仓库遵循 [FastGPT Open Source License](./LICENSE) 开源协议。
|
||||
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 155 KiB |
@@ -13,153 +13,7 @@ weight: 708
|
||||
|
||||
这个配置文件中包含了系统级参数、AI 对话的模型、function 模型等……
|
||||
|
||||
|
||||
## 旧版本配置文件
|
||||
|
||||
以下配置适合 4.6.6-alpha 之前
|
||||
|
||||
```json
|
||||
{
|
||||
"SystemParams": {
|
||||
"vectorMaxProcess": 15, // 向量生成最大进程,结合数据库性能和 key 来设置
|
||||
"qaMaxProcess": 15, // QA 生成最大进程,结合数据库性能和 key 来设置
|
||||
"pgHNSWEfSearch": 100 // pg vector 索引参数,越大精度高但速度慢
|
||||
},
|
||||
"ChatModels": [ // 对话模型
|
||||
{
|
||||
"model": "gpt-3.5-turbo-1106",
|
||||
"name": "GPT35-1106",
|
||||
"price": 0, // 除以 100000 后等于1个token的价格
|
||||
"maxContext": 16000, // 最大上下文长度
|
||||
"maxResponse": 4000, // 最大回复长度
|
||||
"quoteMaxToken": 2000, // 最大引用内容长度
|
||||
"maxTemperature": 1.2, // 最大温度值
|
||||
"censor": false, // 是否开启敏感词过滤(商业版)
|
||||
"vision": false, // 支持图片输入
|
||||
"defaultSystemChatPrompt": ""
|
||||
},
|
||||
{
|
||||
"model": "gpt-3.5-turbo-16k",
|
||||
"name": "GPT35-16k",
|
||||
"maxContext": 16000,
|
||||
"maxResponse": 16000,
|
||||
"price": 0,
|
||||
"quoteMaxToken": 8000,
|
||||
"maxTemperature": 1.2,
|
||||
"censor": false,
|
||||
"vision": false,
|
||||
"defaultSystemChatPrompt": ""
|
||||
},
|
||||
{
|
||||
"model": "gpt-4",
|
||||
"name": "GPT4-8k",
|
||||
"maxContext": 8000,
|
||||
"maxResponse": 8000,
|
||||
"price": 0,
|
||||
"quoteMaxToken": 4000,
|
||||
"maxTemperature": 1.2,
|
||||
"censor": false,
|
||||
"vision": false,
|
||||
"defaultSystemChatPrompt": ""
|
||||
},
|
||||
{
|
||||
"model": "gpt-4-vision-preview",
|
||||
"name": "GPT4-Vision",
|
||||
"maxContext": 128000,
|
||||
"maxResponse": 4000,
|
||||
"price": 0,
|
||||
"quoteMaxToken": 100000,
|
||||
"maxTemperature": 1.2,
|
||||
"censor": false,
|
||||
"vision": true,
|
||||
"defaultSystemChatPrompt": ""
|
||||
}
|
||||
],
|
||||
"QAModels": [ // QA 生成模型
|
||||
{
|
||||
"model": "gpt-3.5-turbo-16k",
|
||||
"name": "GPT35-16k",
|
||||
"maxContext": 16000,
|
||||
"maxResponse": 16000,
|
||||
"price": 0
|
||||
}
|
||||
],
|
||||
"CQModels": [ // 问题分类模型
|
||||
{
|
||||
"model": "gpt-3.5-turbo-1106",
|
||||
"name": "GPT35-1106",
|
||||
"maxContext": 16000,
|
||||
"maxResponse": 4000,
|
||||
"price": 0,
|
||||
"toolChoice": true, // 是否支持openai的 toolChoice, 不支持的模型需要设置为 false,会走提示词生成
|
||||
"functionPrompt": ""
|
||||
},
|
||||
{
|
||||
"model": "gpt-4",
|
||||
"name": "GPT4-8k",
|
||||
"maxContext": 8000,
|
||||
"maxResponse": 8000,
|
||||
"price": 0,
|
||||
"toolChoice": true,
|
||||
"functionPrompt": ""
|
||||
}
|
||||
],
|
||||
"ExtractModels": [ // 内容提取模型
|
||||
{
|
||||
"model": "gpt-3.5-turbo-1106",
|
||||
"name": "GPT35-1106",
|
||||
"maxContext": 16000,
|
||||
"maxResponse": 4000,
|
||||
"price": 0,
|
||||
"toolChoice": true,
|
||||
"functionPrompt": ""
|
||||
}
|
||||
],
|
||||
"QGModels": [ // 生成下一步指引
|
||||
{
|
||||
"model": "gpt-3.5-turbo-1106",
|
||||
"name": "GPT35-1106",
|
||||
"maxContext": 1600,
|
||||
"maxResponse": 4000,
|
||||
"price": 0
|
||||
}
|
||||
],
|
||||
"VectorModels": [ // 向量模型
|
||||
{
|
||||
"model": "text-embedding-ada-002",
|
||||
"name": "Embedding-2",
|
||||
"price": 0.2,
|
||||
"defaultToken": 700,
|
||||
"maxToken": 3000
|
||||
}
|
||||
],
|
||||
"ReRankModels": [], // 重排模型,暂时填空数组
|
||||
"AudioSpeechModels": [
|
||||
{
|
||||
"model": "tts-1",
|
||||
"name": "OpenAI TTS1",
|
||||
"price": 0,
|
||||
"baseUrl": "",
|
||||
"key": "",
|
||||
"voices": [
|
||||
{ "label": "Alloy", "value": "alloy", "bufferId": "openai-Alloy" },
|
||||
{ "label": "Echo", "value": "echo", "bufferId": "openai-Echo" },
|
||||
{ "label": "Fable", "value": "fable", "bufferId": "openai-Fable" },
|
||||
{ "label": "Onyx", "value": "onyx", "bufferId": "openai-Onyx" },
|
||||
{ "label": "Nova", "value": "nova", "bufferId": "openai-Nova" },
|
||||
{ "label": "Shimmer", "value": "shimmer", "bufferId": "openai-Shimmer" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"WhisperModel": {
|
||||
"model": "whisper-1",
|
||||
"name": "Whisper1",
|
||||
"price": 0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 4.6.6-alpha 版本完整配置参数
|
||||
## 4.6.8 以前版本完整配置参数
|
||||
|
||||
**使用时,请务必去除注释!**
|
||||
|
||||
@@ -315,6 +169,134 @@ weight: 708
|
||||
}
|
||||
```
|
||||
|
||||
## 4.6.8 新配置文件
|
||||
|
||||
llm模型全部合并
|
||||
|
||||
```json
|
||||
{
|
||||
"systemEnv": {
|
||||
"openapiPrefix": "fastgpt",
|
||||
"vectorMaxProcess": 15,
|
||||
"qaMaxProcess": 15,
|
||||
"pgHNSWEfSearch": 100
|
||||
},
|
||||
"llmModels": [
|
||||
{
|
||||
"model": "gpt-3.5-turbo-1106", // 模型名
|
||||
"name": "gpt-3.5-turbo", // 别名
|
||||
"maxContext": 16000, // 最大上下文
|
||||
"maxResponse": 4000, // 最大回复
|
||||
"quoteMaxToken": 13000, // 最大引用内容
|
||||
"maxTemperature": 1.2, // 最大温度
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"censor": false,
|
||||
"vision": false, // 是否支持图片输入
|
||||
"datasetProcess": false, // 是否设置为知识库处理模型
|
||||
"toolChoice": true, // 是否支持工具选择
|
||||
"functionCall": false, // 是否支持函数调用
|
||||
"customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
|
||||
"customExtractPrompt": "", // 自定义内容提取提示词
|
||||
"defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
|
||||
"defaultConfig":{} // 对话默认配置(比如 GLM4 的 top_p
|
||||
},
|
||||
{
|
||||
"model": "gpt-3.5-turbo-16k",
|
||||
"name": "gpt-3.5-turbo-16k",
|
||||
"maxContext": 16000,
|
||||
"maxResponse": 16000,
|
||||
"quoteMaxToken": 13000,
|
||||
"maxTemperature": 1.2,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"censor": false,
|
||||
"vision": false,
|
||||
"datasetProcess": true,
|
||||
"toolChoice": true,
|
||||
"functionCall": false,
|
||||
"customCQPrompt": "",
|
||||
"customExtractPrompt": "",
|
||||
"defaultSystemChatPrompt": "",
|
||||
"defaultConfig":{}
|
||||
},
|
||||
{
|
||||
"model": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-turbo",
|
||||
"maxContext": 125000,
|
||||
"maxResponse": 125000,
|
||||
"quoteMaxToken": 100000,
|
||||
"maxTemperature": 1.2,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"censor": false,
|
||||
"vision": false,
|
||||
"datasetProcess": false,
|
||||
"toolChoice": true,
|
||||
"functionCall": false,
|
||||
"customCQPrompt": "",
|
||||
"customExtractPrompt": "",
|
||||
"defaultSystemChatPrompt": "",
|
||||
"defaultConfig":{}
|
||||
},
|
||||
{
|
||||
"model": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision",
|
||||
"maxContext": 128000,
|
||||
"maxResponse": 4000,
|
||||
"quoteMaxToken": 100000,
|
||||
"maxTemperature": 1.2,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"censor": false,
|
||||
"vision": false,
|
||||
"datasetProcess": false,
|
||||
"toolChoice": true,
|
||||
"functionCall": false,
|
||||
"customCQPrompt": "",
|
||||
"customExtractPrompt": "",
|
||||
"defaultSystemChatPrompt": "",
|
||||
"defaultConfig":{}
|
||||
}
|
||||
],
|
||||
"vectorModels": [
|
||||
{
|
||||
"model": "text-embedding-ada-002",
|
||||
"name": "Embedding-2",
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"defaultToken": 700,
|
||||
"maxToken": 3000,
|
||||
"weight": 100,
|
||||
"defaultConfig":{} // 默认配置。例如,如果希望使用 embedding3-large 的话,可以传入 dimensions:1024,来返回1024维度的向量。(目前必须小于1536维度)
|
||||
}
|
||||
],
|
||||
"reRankModels": [],
|
||||
"audioSpeechModels": [
|
||||
{
|
||||
"model": "tts-1",
|
||||
"name": "OpenAI TTS1",
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"voices": [
|
||||
{ "label": "Alloy", "value": "alloy", "bufferId": "openai-Alloy" },
|
||||
{ "label": "Echo", "value": "echo", "bufferId": "openai-Echo" },
|
||||
{ "label": "Fable", "value": "fable", "bufferId": "openai-Fable" },
|
||||
{ "label": "Onyx", "value": "onyx", "bufferId": "openai-Onyx" },
|
||||
{ "label": "Nova", "value": "nova", "bufferId": "openai-Nova" },
|
||||
{ "label": "Shimmer", "value": "shimmer", "bufferId": "openai-Shimmer" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"whisperModel": {
|
||||
"model": "whisper-1",
|
||||
"name": "Whisper1",
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 特殊模型
|
||||
|
||||
### ReRank 接入
|
||||
|
@@ -59,10 +59,10 @@ Authorization 为 sk-aaabbbcccdddeeefffggghhhiiijjjkkk。model 为刚刚在 One
|
||||
|
||||
## 接入 FastGPT
|
||||
|
||||
修改 config.json 配置文件,在 ChatModels 中加入 chatglm2, 在 VectorModels 中加入 M3E 模型:
|
||||
修改 config.json 配置文件,在 llmModels 中加入 chatglm2, 在 vectorModels 中加入 M3E 模型:
|
||||
|
||||
```json
|
||||
"ChatModels": [
|
||||
"llmModels": [
|
||||
//其他对话模型
|
||||
{
|
||||
"model": "chatglm2",
|
||||
@@ -74,7 +74,7 @@ Authorization 为 sk-aaabbbcccdddeeefffggghhhiiijjjkkk。model 为刚刚在 One
|
||||
"defaultSystemChatPrompt": ""
|
||||
}
|
||||
],
|
||||
"VectorModels": [
|
||||
"vectorModels": [
|
||||
{
|
||||
"model": "text-embedding-ada-002",
|
||||
"name": "Embedding-2",
|
||||
|
@@ -99,10 +99,10 @@ Authorization 为 sk-aaabbbcccdddeeefffggghhhiiijjjkkk。model 为刚刚在 One
|
||||
|
||||
## 接入 FastGPT
|
||||
|
||||
修改 config.json 配置文件,在 ChatModels 中加入 chatglm2 模型:
|
||||
修改 config.json 配置文件,在 llmModels 中加入 chatglm2 模型:
|
||||
|
||||
```json
|
||||
"ChatModels": [
|
||||
"llmModels": [
|
||||
//已有模型
|
||||
{
|
||||
"model": "chatglm2",
|
||||
|
@@ -94,10 +94,14 @@ curl -O https://raw.githubusercontent.com/labring/FastGPT/main/files/deploy/fast
|
||||
curl -O https://raw.githubusercontent.com/labring/FastGPT/main/projects/app/data/config.json
|
||||
```
|
||||
|
||||
## 三、修改 docker-compose.yml 的环境变量
|
||||
|
||||
## 三、启动容器
|
||||
修改`docker-compose.yml`中的`OPENAI_BASE_URL`(API 接口的地址,需要加/v1)和`CHAT_API_KEY`(API 接口的凭证)。
|
||||
|
||||
修改`docker-compose.yml`中的`OPENAI_BASE_URL`和`CHAT_API_KEY`即可,对应为 API 的地址(别忘记加/v1)和 key。
|
||||
使用 OneAPI 的话,OPENAI_BASE_URL=OneAPI访问地址/v1;CHAT_API_KEY=令牌
|
||||
|
||||
|
||||
## 四、启动容器
|
||||
|
||||
```bash
|
||||
# 在 docker-compose.yml 同级目录下执行
|
||||
@@ -105,7 +109,39 @@ docker-compose pull
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## 四、访问 FastGPT
|
||||
## 四、初始化 Mongo 副本集(4.6.8以前可忽略)
|
||||
|
||||
FastGPT 4.6.8 后使用了 MongoDB 的事务,需要运行在副本集上。副本集没法自动化初始化,需手动操作。
|
||||
|
||||
```bash
|
||||
# 查看 mongo 容器是否正常运行
|
||||
docker ps
|
||||
# 进入容器
|
||||
docker exec -it mongo bash
|
||||
|
||||
# 连接数据库
|
||||
mongo
|
||||
|
||||
# 初始化副本集。
|
||||
rs.initiate({
|
||||
_id: "rs0",
|
||||
members: [
|
||||
{ _id: 0, host: "mongo:27017" }
|
||||
]
|
||||
})
|
||||
# 检查状态。如果提示 rs0 状态,则代表运行成功
|
||||
rs.status()
|
||||
|
||||
# 初始化用户
|
||||
use admin
|
||||
db.createUser({
|
||||
user: "admin",
|
||||
pwd: "password",
|
||||
roles: [{ role: "root", db: "admin" }]
|
||||
});
|
||||
```
|
||||
|
||||
## 五、访问 FastGPT
|
||||
|
||||
目前可以通过 `ip:3000` 直接访问(注意防火墙)。登录用户名为 `root`,密码为`docker-compose.yml`环境变量里设置的 `DEFAULT_ROOT_PSW`。
|
||||
|
||||
|
@@ -48,6 +48,16 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并
|
||||
1. 关闭翻译
|
||||
2. 检查配置文件是否正常加载,如果没有正常加载会导致缺失系统信息,在某些操作下会导致空指针。
|
||||
|
||||
## 私有部署问题
|
||||
|
||||
### 知识库索引没有进度
|
||||
|
||||
先看日志报错信息。
|
||||
|
||||
1. 可以对话,但是索引没有进度:没有配置向量模型(vectorModels)
|
||||
2. 不能对话,也不能索引:API调用失败。可能是没连上OneAPI或OenAI
|
||||
3. 有进度,但是非常慢:api key不行,OpenAI的免费号,一分钟只有3次还是60次。一天上限200次。
|
||||
|
||||
## Docker 部署常见问题
|
||||
|
||||
### 如何更新?
|
@@ -48,6 +48,8 @@ git clone git@github.com:<github_username>/FastGPT.git
|
||||
|
||||
第一次开发,需要先部署数据库,建议本地开发可以随便找一台 2C2G 的轻量小数据库实践。数据库部署教程:[Docker 快速部署](/docs/development/docker/)。部署完了,可以本地访问其数据库。
|
||||
|
||||
Mongo 数据库需要修改副本集的`host`,从原来的`mongo:27017`修改为`ip:27017`。
|
||||
|
||||
### 4. 初始配置
|
||||
|
||||
以下文件均在 `projects/app` 路径下。
|
||||
|
@@ -11,6 +11,10 @@ weight: 708
|
||||
* [One API](https://github.com/songquanpeng/one-api) 是一个 OpenAI 接口管理 & 分发系统,可以通过标准的 OpenAI API 格式访问所有的大模型,开箱即用。
|
||||
* FastGPT 可以通过接入 OneAPI 来实现对不同大模型的支持。OneAPI 的部署方法也很简单。
|
||||
|
||||
## FastGPT 与 OneAPI 关系
|
||||
|
||||

|
||||
|
||||
## MySQL 版本
|
||||
|
||||
MySQL 版本支持多实例,高并发。
|
||||
@@ -50,7 +54,14 @@ BATCH_UPDATE_ENABLED=true
|
||||
BATCH_UPDATE_INTERVAL=60
|
||||
```
|
||||
|
||||
## One API使用步骤
|
||||
## One API使用教程
|
||||
|
||||
### 概念
|
||||
|
||||
1. 渠道:
|
||||
1. OneApi 中一个渠道对应一个 `Api Key`,这个 `Api Key` 可以是GPT、微软、ChatGLM、文心一言的。一个`Api Key`通常可以调用同一个厂商的多个模型。
|
||||
2. OneAPI 会根据请求传入的`模型`来决定使用哪一个`Key`,如果一个模型对应了多个`Key`,则会随机调用。
|
||||
2. 令牌:访问 OneAPI 所需的凭证,只需要这`1`个凭证即可访问`OneAPI`上配置的模型。因此`FastGPT`中,只需要配置`OneAPI`的`baseurl`和`令牌`即可。
|
||||
|
||||
### 1. 登录 One API
|
||||
|
||||
@@ -68,7 +79,11 @@ BATCH_UPDATE_INTERVAL=60
|
||||
创建一个令牌
|
||||

|
||||
|
||||
### 3. 修改 FastGPT 的环境变量
|
||||
### 3. 修改账号余额
|
||||
|
||||
OneAPI 默认 root 用户只有 200刀,可以自行修改编辑。
|
||||
|
||||
### 4. 修改 FastGPT 的环境变量
|
||||
|
||||
有了 One API 令牌后,FastGPT 可以通过修改 `baseurl` 和 `key` 去请求到 One API,再由 One API 去请求不同的模型。修改下面两个环境变量:
|
||||
|
||||
@@ -92,21 +107,29 @@ CHAT_API_KEY=sk-xxxxxx
|
||||
可以在 `/projects/app/src/data/config.json` 里找到配置文件(本地开发需要复制成 config.local.json),配置文件中有一项是对话模型配置:
|
||||
|
||||
```json
|
||||
"ChatModels": [
|
||||
"llmModels": [
|
||||
...
|
||||
{
|
||||
"model": "ERNIE-Bot", // 这里的模型需要对应 One API 的模型
|
||||
"name": "文心一言", // 对外展示的名称
|
||||
"maxContext": 8000, // 最大长下文 token,无论什么模型都按 GPT35 的计算。GPT 外的模型需要自行大致计算下这个值。可以调用官方接口去比对 Token 的倍率,然后在这里粗略计算。
|
||||
"maxResponse": 4000, // 最大回复 token
|
||||
// 例如:文心一言的中英文 token 基本是 1:1,而 GPT 的中文 Token 是 2:1,如果文心一言官方最大 Token 是 4000,那么这里就可以填 8000,保险点就填 7000.
|
||||
"quoteMaxToken": 2000, // 引用知识库的最大 Token
|
||||
"maxTemperature": 1, // 最大温度
|
||||
"vision": false, // 是否开启图片识别
|
||||
"defaultSystemChatPrompt": "" // 默认的系统提示词
|
||||
"maxContext": 16000, // 最大上下文
|
||||
"maxResponse": 4000, // 最大回复
|
||||
"quoteMaxToken": 13000, // 最大引用内容
|
||||
"maxTemperature": 1.2, // 最大温度
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"censor": false,
|
||||
"vision": false, // 是否支持图片输入
|
||||
"datasetProcess": false, // 是否设置为知识库处理模型
|
||||
"toolChoice": true, // 是否支持工具选择
|
||||
"functionCall": false, // 是否支持函数调用
|
||||
"customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
|
||||
"customExtractPrompt": "", // 自定义内容提取提示词
|
||||
"defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
|
||||
"defaultConfig":{} // 对话默认配置(比如 GLM4 的 top_p
|
||||
}
|
||||
...
|
||||
],
|
||||
```
|
||||
|
||||
添加完后,重启 FastGPT 即可在选择文心一言模型进行对话。
|
||||
添加完后,重启 FastGPT 即可在选择文心一言模型进行对话。**添加向量模型也是类似操作,增加到 `vectorModels`里。**
|
||||
|
@@ -11,6 +11,13 @@ weight: 706
|
||||
|
||||

|
||||
|
||||
## 多模型支持
|
||||
|
||||
FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI 、Azure 、国内主流模型和本地模型等。
|
||||
|
||||
可参考:[Sealos 快速部署 OneAPI](/docs/development/one-api)
|
||||
|
||||
|
||||
## 一键部署
|
||||
Sealos 的服务器在国外,不需要额外处理网络问题,无需服务器、无需魔法、无需域名,支持高并发 & 动态伸缩。点击以下按钮即可一键部署 👇
|
||||
|
||||
|
@@ -20,7 +20,8 @@ curl --location --request POST 'https://{{host}}/api/admin/initv467' \
|
||||
```
|
||||
|
||||
初始化说明:
|
||||
1. 将 images 重新关联到数据集(不初始化也问题不大,就是可能会留下永久脏数据)
|
||||
1. 将 images 重新关联到数据集
|
||||
2. 设置 pg 表的 null 值。
|
||||
|
||||
|
||||
## V4.6.7 更新说明
|
||||
|
27
docSite/content/docs/development/upgrading/468.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
title: 'V4.6.8(进行中)'
|
||||
description: 'FastGPT V4.6.7'
|
||||
icon: 'upgrade'
|
||||
draft: false
|
||||
toc: true
|
||||
weight: 828
|
||||
---
|
||||
|
||||
## docker 部署 - 更新 Mongo
|
||||
|
||||
开启 Mongo 副本集模式。需要进入 mongo 执行一次 init,参考[初始化Mongo副本集](/docs/development/docker/#四初始化-mongo-副本集),这个比较麻烦,初始化后可以用 mongoshell 之类的连接试试,看能不能连接上。
|
||||
|
||||
## Sealos 部署 - 无需更新 Mongo
|
||||
|
||||
## 修改配置文件
|
||||
|
||||
去除了重复的模型配置,LLM模型都合并到一个属性中:[点击查看最新的配置文件](/docs/development/configuration/)
|
||||
|
||||
## V4.6.8 更新说明
|
||||
|
||||
1. 新增 - 知识库搜索合并模块。
|
||||
1. 优化 - LLM 模型配置,不再区分对话、分类、提取模型。同时支持模型的默认参数,避免不同模型参数冲突,可通过`defaultConfig`传入默认的配置。
|
||||
2. 优化 - HTTP 模块,支持输出字符串自动序列化(JSON可自动转成字符串)
|
||||
3. 优化 - 流响应,参考了`ChatNextWeb`的流,更加丝滑。此外,之前提到的乱码、中断,刷新后又正常了,可能会修复)
|
||||
4. 修复 - 语音输入文件无法上传。
|
||||
5. 修复 - 对话框重新生成无法使用。
|
@@ -30,20 +30,15 @@ FastGPT 从 V4 版本开始采用新的交互方式来构建 AI 应用。使用
|
||||
|
||||
### 模块分类
|
||||
|
||||
从功能上,模块可以分为 3 类:
|
||||
从功能上,模块可以分为 2 类:
|
||||
|
||||
1. **只读模块**:全局变量、用户引导。
|
||||
2. **系统模块**:聊天记录(无输入,直接从数据库取)、用户问题(流程入口)。
|
||||
3. **功能模块**:知识库搜索、AI 对话等剩余模块。(这些模块都有输入和输出,可以自由组合)。
|
||||
1. **系统模块**:用户引导(配置一些对话框信息)、用户问题(流程入口)。
|
||||
2. **功能模块**:知识库搜索、AI 对话等剩余模块。(这些模块都有输入和输出,可以自由组合)。
|
||||
|
||||
### 模块的组成
|
||||
|
||||
每个模块会包含 3 个核心部分:固定参数、外部输入(左边有个圆圈)和输出(右边有个圆圈)。
|
||||
|
||||
+ 对于只读模块,只需要根据提示填写即可,不参与流程运行。
|
||||
+ 对于系统模块,通常只有固定参数和输出,主要需要关注输出到哪个位置。
|
||||
+ 对于功能模块,通常这 3 部分都是重要的,以下图的 AI 对话为例:
|
||||
|
||||

|
||||
|
||||
- 对话模型、温度、回复上限、系统提示词和限定词为固定参数,同时系统提示词和限定词也可以作为外部输入,意味着如果你有输入流向了系统提示词,那么原本填写的内容就会被**覆盖**。
|
||||
@@ -56,6 +51,7 @@ FastGPT 从 V4 版本开始采用新的交互方式来构建 AI 应用。使用
|
||||
|
||||
1. 仅关心**已连接的**外部输入,即左边的圆圈被连接了。
|
||||
2. 当连接内容都有值时触发。
|
||||
3. **可以多个输出连接到一个输入,后续的值会覆盖前面的值。**
|
||||
|
||||
#### 示例 1:
|
||||
|
||||
@@ -87,3 +83,16 @@ FastGPT 从 V4 版本开始采用新的交互方式来构建 AI 应用。使用
|
||||
1. 建议从左往右阅读。
|
||||
2. 从 **用户问题** 模块开始。用户问题模块,代表的是用户发送了一段文本,触发任务开始。
|
||||
3. 关注【AI 对话】和【指定回复】模块,这两个模块是输出答案的地方。
|
||||
|
||||
## FAQ
|
||||
|
||||
### 想合并多个输出结果怎么实现?
|
||||
|
||||
1. 文本加工,可以对字符串进行合并。
|
||||
2. 知识库搜索合并,可以合并多个知识库搜索结果
|
||||
3. 其他结果,无法直接合并,可以考虑传入到`HTTP`模块中进行合并,使用`[Laf](https://laf.run/)`可以快速实现一个无服务器HTTP接口。
|
||||
|
||||
### 模块为什么有2个用户问题
|
||||
|
||||
左侧的`用户问题`是指该模块所需的输入。右侧的`用户问题`是为了方便后续的连线,输出的值和传入的用户问题一样。
|
||||
|
||||
|
@@ -38,7 +38,7 @@ HTTP 模块会向对应的地址发送一个 `POST/GET` 请求,携带部分`
|
||||
|
||||
### 嵌套对象使用
|
||||
|
||||
**入参**
|
||||
#### 入参
|
||||
|
||||
假设我们设计了`3个`输入。
|
||||
|
||||
@@ -58,7 +58,7 @@ HTTP 模块会向对应的地址发送一个 `POST/GET` 请求,携带部分`
|
||||
}
|
||||
```
|
||||
|
||||
**出参**
|
||||
#### 出参
|
||||
|
||||
假设接口的输出结构为:
|
||||
|
||||
@@ -66,18 +66,46 @@ HTTP 模块会向对应的地址发送一个 `POST/GET` 请求,携带部分`
|
||||
{
|
||||
"message": "测试",
|
||||
"data":{
|
||||
"name": "name",
|
||||
"age": 10
|
||||
"user": {
|
||||
"name": "xxx",
|
||||
"age": 12
|
||||
},
|
||||
"list": [
|
||||
{
|
||||
"name": "xxx",
|
||||
"age": 50
|
||||
},
|
||||
[{ "test": 22 }]
|
||||
],
|
||||
"psw": "xxx"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
那么,自定出参的`key`可以设置为:
|
||||
最终得到的解析为:
|
||||
|
||||
- message (string)
|
||||
- data.name (string)
|
||||
- data.age (number)
|
||||
```json
|
||||
{
|
||||
"user": { "name": "xxx", "age": 12 },
|
||||
"user.name": "xxx",
|
||||
"user.age": 12,
|
||||
"list": [ { "name": "xxx", "age": 50 }, [{ "test": 22 }] ],
|
||||
"list[0]": { "name": "xxx", "age": 50 },
|
||||
"list[0].name": "xxx",
|
||||
"list[0].age": 50,
|
||||
"list[1]": [ { "test": 22 } ],
|
||||
"list[1][0]": { "test": 22 },
|
||||
"list[1][0].test": 22,
|
||||
"psw": "xxx"
|
||||
}
|
||||
```
|
||||
|
||||
你可以使用`json`里对应的`key`来获取值。
|
||||
|
||||
|
||||
### 格式化输出
|
||||
|
||||
FastGPT v4.6.8 后,加入了出参格式化功能,主要以`json`格式化成`字符串`为主。如果你的输出类型选择了`字符串`,则会将`HTTP`对应`key`的值,转成`json`字符串进行输出。因此,未来你可以直接从`HTTP`接口输出内容至`文本加工`中,然后拼接适当的提示词,最终输入给`AI对话`。
|
||||
|
||||
## POST 示例
|
||||
|
||||
|
@@ -27,10 +27,7 @@ services:
|
||||
- 27017:27017
|
||||
networks:
|
||||
- fastgpt
|
||||
environment:
|
||||
# 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
|
||||
- MONGO_INITDB_ROOT_USERNAME=username
|
||||
- MONGO_INITDB_ROOT_PASSWORD=password
|
||||
command: --replSet rs0
|
||||
volumes:
|
||||
- ./mongo/data:/data/db
|
||||
fastgpt:
|
||||
@@ -55,63 +52,11 @@ services:
|
||||
- TOKEN_KEY=any
|
||||
- ROOT_KEY=root_key
|
||||
- FILE_TOKEN_KEY=filetoken
|
||||
# mongo 配置,不需要改. 如果连不上,可能需要去掉 ?authSource=admin
|
||||
- MONGODB_URI=mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
# mongo 配置,不需要改. 用户名admin,密码password,是执行 db.createUser 时的账号和密码。
|
||||
- MONGODB_URI=mongodb://admin:password@mongo:27017/fastgpt?authSource=admin
|
||||
# pg配置. 不需要改
|
||||
- PG_URL=postgresql://username:password@pg:5432/postgres
|
||||
volumes:
|
||||
- ./config.json:/app/data/config.json
|
||||
networks:
|
||||
fastgpt:
|
||||
# host 版本, 不推荐。
|
||||
# version: '3.3'
|
||||
# services:
|
||||
# pg:
|
||||
# image: ankane/pgvector:v0.5.0 # dockerhub
|
||||
# # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.5.0 # 阿里云
|
||||
# container_name: pg
|
||||
# restart: always
|
||||
# ports: # 生产环境建议不要暴露
|
||||
# - 5432:5432
|
||||
# environment:
|
||||
# # 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
|
||||
# - POSTGRES_USER=username
|
||||
# - POSTGRES_PASSWORD=password
|
||||
# - POSTGRES_DB=postgres
|
||||
# volumes:
|
||||
# - ./pg/data:/var/lib/postgresql/data
|
||||
# mongo:
|
||||
# image: mongo:5.0.18
|
||||
# # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 # 阿里云
|
||||
# container_name: mongo
|
||||
# restart: always
|
||||
# ports: # 生产环境建议不要暴露
|
||||
# - 27017:27017
|
||||
# environment:
|
||||
# # 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
|
||||
# - MONGO_INITDB_ROOT_USERNAME=username
|
||||
# - MONGO_INITDB_ROOT_PASSWORD=password
|
||||
# volumes:
|
||||
# - ./mongo/data:/data/db
|
||||
# - ./mongo/logs:/var/log/mongodb
|
||||
# fastgpt:
|
||||
# # image: ghcr.io/labring/fastgpt:latest # github
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest # 阿里云
|
||||
# network_mode: host
|
||||
# restart: always
|
||||
# container_name: fastgpt
|
||||
# environment:
|
||||
# # root 密码,用户名为: root
|
||||
# - DEFAULT_ROOT_PSW=1234
|
||||
# # 中转地址,如果是用官方号,不需要管
|
||||
# - OPENAI_BASE_URL=https://api.openai.com/v1
|
||||
# - CHAT_API_KEY=sk-xxxx
|
||||
# - DB_MAX_LINK=5 # database max link
|
||||
# # token加密凭证(随便填,作为登录凭证)
|
||||
# - TOKEN_KEY=any
|
||||
# # root key, 最高权限,可以内部接口互相调用
|
||||
# - ROOT_KEY=root_key
|
||||
# # mongo 配置,不需要改
|
||||
# - MONGODB_URI=mongodb://username:password@0.0.0.0:27017/fastgpt?authSource=admin
|
||||
# # pg配置. 不需要改
|
||||
# - PG_URL=postgresql://username:password@0.0.0.0:5432/postgres
|
||||
|
23
packages/global/common/system/types/index.d.ts
vendored
@@ -1,3 +1,4 @@
|
||||
import { StandSubPlanLevelMapType, SubPlanType } from '../../../support/wallet/sub/type';
|
||||
import type {
|
||||
ChatModelItemType,
|
||||
FunctionModelItemType,
|
||||
@@ -7,16 +8,14 @@ import type {
|
||||
WhisperModelType,
|
||||
ReRankModelItemType
|
||||
} from '../../../core/ai/model.d';
|
||||
import { SubTypeEnum } from '../../../support/wallet/sub/constants';
|
||||
|
||||
/* fastgpt main */
|
||||
export type FastGPTConfigFileType = {
|
||||
feConfigs: FastGPTFeConfigsType;
|
||||
systemEnv: SystemEnvType;
|
||||
chatModels: ChatModelItemType[];
|
||||
qaModels: LLMModelItemType[];
|
||||
cqModels: FunctionModelItemType[];
|
||||
extractModels: FunctionModelItemType[];
|
||||
qgModels: LLMModelItemType[];
|
||||
subPlans?: SubPlanType;
|
||||
llmModels: ChatModelItemType[];
|
||||
vectorModels: VectorModelItemType[];
|
||||
reRankModels: ReRankModelItemType[];
|
||||
audioSpeechModels: AudioSpeechModelType[];
|
||||
@@ -51,10 +50,6 @@ export type FastGPTFeConfigsType = {
|
||||
favicon?: string;
|
||||
customApiDomain?: string;
|
||||
customSharePageDomain?: string;
|
||||
subscription?: {
|
||||
datasetStoreFreeSize?: number;
|
||||
datasetStorePrice?: number;
|
||||
};
|
||||
|
||||
uploadFileMaxSize?: number;
|
||||
};
|
||||
@@ -66,8 +61,8 @@ export type SystemEnvType = {
|
||||
pgHNSWEfSearch: number;
|
||||
};
|
||||
|
||||
declare global {
|
||||
var feConfigs: FastGPTFeConfigsType;
|
||||
var systemEnv: SystemEnvType;
|
||||
var systemInitd: boolean;
|
||||
}
|
||||
// declare global {
|
||||
// var feConfigs: FastGPTFeConfigsType;
|
||||
// var systemEnv: SystemEnvType;
|
||||
// var systemInitd: boolean;
|
||||
// }
|
||||
|
22
packages/global/core/ai/model.d.ts
vendored
@@ -3,20 +3,24 @@ export type LLMModelItemType = {
|
||||
name: string;
|
||||
maxContext: number;
|
||||
maxResponse: number;
|
||||
inputPrice: number;
|
||||
outputPrice: number;
|
||||
};
|
||||
export type ChatModelItemType = LLMModelItemType & {
|
||||
quoteMaxToken: number;
|
||||
maxTemperature: number;
|
||||
|
||||
inputPrice: number;
|
||||
outputPrice: number;
|
||||
|
||||
censor?: boolean;
|
||||
vision?: boolean;
|
||||
defaultSystemChatPrompt?: string;
|
||||
};
|
||||
datasetProcess?: boolean;
|
||||
|
||||
export type FunctionModelItemType = LLMModelItemType & {
|
||||
functionCall: boolean;
|
||||
toolChoice: boolean;
|
||||
functionPrompt: string;
|
||||
|
||||
customCQPrompt: string;
|
||||
customExtractPrompt: string;
|
||||
|
||||
defaultSystemChatPrompt?: string;
|
||||
defaultConfig?: Record<string, any>;
|
||||
};
|
||||
|
||||
export type VectorModelItemType = {
|
||||
@@ -27,6 +31,8 @@ export type VectorModelItemType = {
|
||||
outputPrice: number;
|
||||
maxToken: number;
|
||||
weight: number;
|
||||
hidden?: boolean;
|
||||
defaultConfig?: Record<string, any>;
|
||||
};
|
||||
|
||||
export type ReRankModelItemType = {
|
||||
|
@@ -3,11 +3,22 @@ import type { LLMModelItemType, VectorModelItemType } from './model.d';
|
||||
export const defaultQAModels: LLMModelItemType[] = [
|
||||
{
|
||||
model: 'gpt-3.5-turbo-16k',
|
||||
name: 'GPT35-16k',
|
||||
name: 'gpt-3.5-turbo-16k',
|
||||
maxContext: 16000,
|
||||
maxResponse: 16000,
|
||||
quoteMaxToken: 13000,
|
||||
maxTemperature: 1.2,
|
||||
inputPrice: 0,
|
||||
outputPrice: 0
|
||||
outputPrice: 0,
|
||||
censor: false,
|
||||
vision: false,
|
||||
datasetProcess: true,
|
||||
toolChoice: true,
|
||||
functionCall: false,
|
||||
customCQPrompt: '',
|
||||
customExtractPrompt: '',
|
||||
defaultSystemChatPrompt: '',
|
||||
defaultConfig: {}
|
||||
}
|
||||
];
|
||||
|
||||
|
4
packages/global/core/app/api.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import type { ChatModelItemType } from '../ai/model.d';
|
||||
import type { LLMModelItemType } from '../ai/model.d';
|
||||
import { AppTypeEnum } from './constants';
|
||||
import { AppSchema, AppSimpleEditFormType } from './type';
|
||||
|
||||
@@ -22,5 +22,5 @@ export interface AppUpdateParams {
|
||||
export type FormatForm2ModulesProps = {
|
||||
formData: AppSimpleEditFormType;
|
||||
chatModelMaxToken: number;
|
||||
chatModelList: ChatModelItemType[];
|
||||
llmModelList: LLMModelItemType[];
|
||||
};
|
||||
|
@@ -91,7 +91,7 @@ export const appModules2Form = ({
|
||||
);
|
||||
defaultAppForm.dataset.limit = findInputValueByKey(
|
||||
module.inputs,
|
||||
ModuleInputKeyEnum.datasetLimit
|
||||
ModuleInputKeyEnum.datasetMaxTokens
|
||||
);
|
||||
defaultAppForm.dataset.searchMode =
|
||||
findInputValueByKey(module.inputs, ModuleInputKeyEnum.datasetSearchMode) ||
|
||||
|
95
packages/global/core/dataset/search/utils.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import { countPromptTokens } from '../../../common/string/tiktoken';
|
||||
import { SearchScoreTypeEnum } from '../constants';
|
||||
import { SearchDataResponseItemType } from '../type';
|
||||
|
||||
/* dataset search result concat */
|
||||
export const datasetSearchResultConcat = (
|
||||
arr: { k: number; list: SearchDataResponseItemType[] }[]
|
||||
): SearchDataResponseItemType[] => {
|
||||
arr = arr.filter((item) => item.list.length > 0);
|
||||
|
||||
if (arr.length === 0) return [];
|
||||
if (arr.length === 1) return arr[0].list;
|
||||
|
||||
const map = new Map<string, SearchDataResponseItemType & { rrfScore: number }>();
|
||||
|
||||
// rrf
|
||||
arr.forEach((item) => {
|
||||
const k = item.k;
|
||||
|
||||
item.list.forEach((data, index) => {
|
||||
const rank = index + 1;
|
||||
const score = 1 / (k + rank);
|
||||
|
||||
const record = map.get(data.id);
|
||||
if (record) {
|
||||
// 合并两个score,有相同type的score,取最大值
|
||||
const concatScore = [...record.score];
|
||||
for (const dataItem of data.score) {
|
||||
const sameScore = concatScore.find((item) => item.type === dataItem.type);
|
||||
if (sameScore) {
|
||||
sameScore.value = Math.max(sameScore.value, dataItem.value);
|
||||
} else {
|
||||
concatScore.push(dataItem);
|
||||
}
|
||||
}
|
||||
|
||||
map.set(data.id, {
|
||||
...record,
|
||||
score: concatScore,
|
||||
rrfScore: record.rrfScore + score
|
||||
});
|
||||
} else {
|
||||
map.set(data.id, {
|
||||
...data,
|
||||
rrfScore: score
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// sort
|
||||
const mapArray = Array.from(map.values());
|
||||
const results = mapArray.sort((a, b) => b.rrfScore - a.rrfScore);
|
||||
|
||||
return results.map((item, index) => {
|
||||
// if SearchScoreTypeEnum.rrf exist, reset score
|
||||
const rrfScore = item.score.find((item) => item.type === SearchScoreTypeEnum.rrf);
|
||||
if (rrfScore) {
|
||||
rrfScore.value = item.rrfScore;
|
||||
rrfScore.index = index;
|
||||
} else {
|
||||
item.score.push({
|
||||
type: SearchScoreTypeEnum.rrf,
|
||||
value: item.rrfScore,
|
||||
index
|
||||
});
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
delete item.rrfScore;
|
||||
return item;
|
||||
});
|
||||
};
|
||||
|
||||
export const filterSearchResultsByMaxChars = (
|
||||
list: SearchDataResponseItemType[],
|
||||
maxTokens: number
|
||||
) => {
|
||||
const results: SearchDataResponseItemType[] = [];
|
||||
let totalTokens = 0;
|
||||
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const item = list[i];
|
||||
totalTokens += countPromptTokens(item.q + item.a);
|
||||
if (totalTokens > maxTokens + 500) {
|
||||
break;
|
||||
}
|
||||
results.push(item);
|
||||
if (totalTokens > maxTokens) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return results.length === 0 ? list.slice(0, 1) : results;
|
||||
};
|
@@ -35,6 +35,7 @@ export function getSourceNameIcon({
|
||||
return 'file/fill/manual';
|
||||
}
|
||||
|
||||
/* get dataset data default index */
|
||||
export function getDefaultIndex(props?: { q?: string; a?: string; dataId?: string }) {
|
||||
const { q = '', a, dataId } = props || {};
|
||||
const qaStr = `${q}\n${a}`.trim();
|
||||
|
@@ -61,7 +61,7 @@ export enum ModuleInputKeyEnum {
|
||||
// dataset
|
||||
datasetSelectList = 'datasets',
|
||||
datasetSimilarity = 'similarity',
|
||||
datasetLimit = 'limit',
|
||||
datasetMaxTokens = 'limit',
|
||||
datasetSearchMode = 'searchMode',
|
||||
datasetSearchUsingReRank = 'usingReRank',
|
||||
datasetParamsModal = 'datasetParamsModal',
|
||||
|
@@ -45,7 +45,10 @@ export enum FlowNodeTypeEnum {
|
||||
questionInput = 'questionInput',
|
||||
historyNode = 'historyNode',
|
||||
chatNode = 'chatNode',
|
||||
|
||||
datasetSearchNode = 'datasetSearchNode',
|
||||
datasetConcatNode = 'datasetConcatNode',
|
||||
|
||||
answerNode = 'answerNode',
|
||||
classifyQuestion = 'classifyQuestion',
|
||||
contentExtract = 'contentExtract',
|
||||
|
2
packages/global/core/module/node/type.d.ts
vendored
@@ -106,6 +106,6 @@ export type AIChatModuleProps = {
|
||||
export type DatasetModuleProps = {
|
||||
[ModuleInputKeyEnum.datasetSelectList]: SelectedDatasetType;
|
||||
[ModuleInputKeyEnum.datasetSimilarity]: number;
|
||||
[ModuleInputKeyEnum.datasetLimit]: number;
|
||||
[ModuleInputKeyEnum.datasetMaxTokens]: number;
|
||||
[ModuleInputKeyEnum.datasetStartReRank]: boolean;
|
||||
};
|
||||
|
@@ -7,6 +7,7 @@ export const Input_Template_Switch: FlowNodeInputItemType = {
|
||||
key: ModuleInputKeyEnum.switch,
|
||||
type: FlowNodeInputTypeEnum.target,
|
||||
label: 'core.module.input.label.switch',
|
||||
description: 'core.module.input.description.Trigger',
|
||||
valueType: ModuleIOValueTypeEnum.any,
|
||||
showTargetInApp: true,
|
||||
showTargetInPlugin: true
|
||||
@@ -27,8 +28,8 @@ export const Input_Template_History: FlowNodeInputItemType = {
|
||||
|
||||
export const Input_Template_UserChatInput: FlowNodeInputItemType = {
|
||||
key: ModuleInputKeyEnum.userChatInput,
|
||||
type: FlowNodeInputTypeEnum.hidden,
|
||||
label: 'core.module.input.label.user question',
|
||||
type: FlowNodeInputTypeEnum.custom,
|
||||
label: '',
|
||||
required: true,
|
||||
valueType: ModuleIOValueTypeEnum.string,
|
||||
showTargetInApp: true,
|
||||
@@ -56,3 +57,13 @@ export const Input_Template_DynamicInput: FlowNodeInputItemType = {
|
||||
showTargetInPlugin: true,
|
||||
hideInApp: true
|
||||
};
|
||||
|
||||
export const Input_Template_Dataset_Quote: FlowNodeInputItemType = {
|
||||
key: ModuleInputKeyEnum.aiChatDatasetQuote,
|
||||
type: FlowNodeInputTypeEnum.target,
|
||||
label: '知识库引用',
|
||||
description: 'core.module.Dataset quote.Input description',
|
||||
valueType: ModuleIOValueTypeEnum.datasetQuote,
|
||||
showTargetInApp: true,
|
||||
showTargetInPlugin: true
|
||||
};
|
||||
|
@@ -1,52 +0,0 @@
|
||||
import {
|
||||
FlowNodeInputTypeEnum,
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../node/constant';
|
||||
import { FlowModuleTemplateType } from '../../../type';
|
||||
import {
|
||||
ModuleIOValueTypeEnum,
|
||||
ModuleInputKeyEnum,
|
||||
ModuleTemplateTypeEnum
|
||||
} from '../../../constants';
|
||||
|
||||
export const HistoryModule: FlowModuleTemplateType = {
|
||||
id: FlowNodeTypeEnum.historyNode,
|
||||
templateType: ModuleTemplateTypeEnum.systemInput,
|
||||
flowType: FlowNodeTypeEnum.historyNode,
|
||||
avatar: '/imgs/module/history.png',
|
||||
name: '聊天记录(弃用)',
|
||||
intro: '聊天记录,该模块已被弃用',
|
||||
inputs: [
|
||||
{
|
||||
key: ModuleInputKeyEnum.historyMaxAmount,
|
||||
type: FlowNodeInputTypeEnum.numberInput,
|
||||
label: '最长记录数',
|
||||
description:
|
||||
'该记录数不代表模型可接收这么多的历史记录,具体可接收多少历史记录,取决于模型的能力,通常建议不要超过20条。',
|
||||
value: 6,
|
||||
valueType: ModuleIOValueTypeEnum.number,
|
||||
min: 0,
|
||||
max: 100,
|
||||
showTargetInApp: false,
|
||||
showTargetInPlugin: false
|
||||
},
|
||||
{
|
||||
key: ModuleInputKeyEnum.history,
|
||||
type: FlowNodeInputTypeEnum.hidden,
|
||||
valueType: ModuleIOValueTypeEnum.chatHistory,
|
||||
label: '聊天记录',
|
||||
showTargetInApp: false,
|
||||
showTargetInPlugin: false
|
||||
}
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
key: ModuleInputKeyEnum.history,
|
||||
label: '聊天记录',
|
||||
valueType: ModuleIOValueTypeEnum.chatHistory,
|
||||
type: FlowNodeOutputTypeEnum.source,
|
||||
targets: []
|
||||
}
|
||||
]
|
||||
};
|
@@ -11,6 +11,7 @@ import {
|
||||
ModuleTemplateTypeEnum
|
||||
} from '../../constants';
|
||||
import {
|
||||
Input_Template_Dataset_Quote,
|
||||
Input_Template_History,
|
||||
Input_Template_Switch,
|
||||
Input_Template_UserChatInput
|
||||
@@ -108,16 +109,8 @@ export const AiChatModule: FlowModuleTemplateType = {
|
||||
showTargetInPlugin: true
|
||||
},
|
||||
Input_Template_History,
|
||||
{
|
||||
key: ModuleInputKeyEnum.aiChatDatasetQuote,
|
||||
type: FlowNodeInputTypeEnum.target,
|
||||
label: 'core.module.input.label.Quote',
|
||||
description: 'core.module.input.description.Quote',
|
||||
valueType: ModuleIOValueTypeEnum.datasetQuote,
|
||||
showTargetInApp: true,
|
||||
showTargetInPlugin: true
|
||||
},
|
||||
Input_Template_UserChatInput
|
||||
Input_Template_UserChatInput,
|
||||
Input_Template_Dataset_Quote
|
||||
],
|
||||
outputs: [
|
||||
Output_Template_UserChatInput,
|
||||
|
54
packages/global/core/module/template/system/datasetConcat.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import {
|
||||
FlowNodeInputTypeEnum,
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../node/constant';
|
||||
import { FlowModuleTemplateType } from '../../type.d';
|
||||
import {
|
||||
ModuleIOValueTypeEnum,
|
||||
ModuleInputKeyEnum,
|
||||
ModuleOutputKeyEnum,
|
||||
ModuleTemplateTypeEnum
|
||||
} from '../../constants';
|
||||
import { Input_Template_Dataset_Quote, Input_Template_Switch } from '../input';
|
||||
import { Output_Template_Finish } from '../output';
|
||||
import { getNanoid } from '../../../../common/string/tools';
|
||||
|
||||
export const getOneQuoteInputTemplate = (key = getNanoid()) => ({
|
||||
...Input_Template_Dataset_Quote,
|
||||
key,
|
||||
type: FlowNodeInputTypeEnum.hidden
|
||||
});
|
||||
|
||||
export const DatasetConcatModule: FlowModuleTemplateType = {
|
||||
id: FlowNodeTypeEnum.datasetConcatNode,
|
||||
flowType: FlowNodeTypeEnum.datasetConcatNode,
|
||||
templateType: ModuleTemplateTypeEnum.tools,
|
||||
avatar: '/imgs/module/concat.svg',
|
||||
name: '知识库搜索引用合并',
|
||||
intro: 'core.module.template.Dataset search result concat intro',
|
||||
showStatus: false,
|
||||
inputs: [
|
||||
Input_Template_Switch,
|
||||
{
|
||||
key: ModuleInputKeyEnum.datasetMaxTokens,
|
||||
type: FlowNodeInputTypeEnum.custom,
|
||||
label: '最大 Tokens',
|
||||
value: 1500,
|
||||
valueType: ModuleIOValueTypeEnum.number,
|
||||
showTargetInApp: false,
|
||||
showTargetInPlugin: false
|
||||
},
|
||||
getOneQuoteInputTemplate('defaultQuote')
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
key: ModuleOutputKeyEnum.datasetQuoteQA,
|
||||
label: 'core.module.Dataset quote.label',
|
||||
type: FlowNodeOutputTypeEnum.source,
|
||||
valueType: ModuleIOValueTypeEnum.datasetQuote,
|
||||
targets: []
|
||||
},
|
||||
Output_Template_Finish
|
||||
]
|
||||
};
|
@@ -52,7 +52,7 @@ export const DatasetSearchModule: FlowModuleTemplateType = {
|
||||
showTargetInPlugin: false
|
||||
},
|
||||
{
|
||||
key: ModuleInputKeyEnum.datasetLimit,
|
||||
key: ModuleInputKeyEnum.datasetMaxTokens,
|
||||
type: FlowNodeInputTypeEnum.hidden,
|
||||
label: '',
|
||||
value: 1500,
|
||||
@@ -106,8 +106,7 @@ export const DatasetSearchModule: FlowModuleTemplateType = {
|
||||
},
|
||||
{
|
||||
key: ModuleOutputKeyEnum.datasetQuoteQA,
|
||||
label: 'core.module.output.label.Quote',
|
||||
description: 'core.module.output.label.Quote intro',
|
||||
label: 'core.module.Dataset quote.label',
|
||||
type: FlowNodeOutputTypeEnum.source,
|
||||
valueType: ModuleIOValueTypeEnum.datasetQuote,
|
||||
targets: []
|
||||
|
@@ -6,7 +6,7 @@ export const RunPluginModule: FlowModuleTemplateType = {
|
||||
id: FlowNodeTypeEnum.pluginModule,
|
||||
templateType: ModuleTemplateTypeEnum.externalCall,
|
||||
flowType: FlowNodeTypeEnum.pluginModule,
|
||||
avatar: '/imgs/module/custom.png',
|
||||
avatar: '',
|
||||
intro: '',
|
||||
name: '',
|
||||
showStatus: false,
|
||||
|
@@ -15,7 +15,7 @@ export const UserInputModule: FlowModuleTemplateType = {
|
||||
id: FlowNodeTypeEnum.questionInput,
|
||||
templateType: ModuleTemplateTypeEnum.systemInput,
|
||||
flowType: FlowNodeTypeEnum.questionInput,
|
||||
avatar: '/imgs/module/userChatInput.png',
|
||||
avatar: '/imgs/module/userChatInput.svg',
|
||||
name: 'core.module.template.Chat entrance',
|
||||
intro: 'core.module.template.Chat entrance intro',
|
||||
inputs: [
|
||||
|
9
packages/global/core/module/type.d.ts
vendored
@@ -3,9 +3,9 @@ import { ModuleIOValueTypeEnum, ModuleTemplateTypeEnum, VariableInputEnum } from
|
||||
import { FlowNodeInputItemType, FlowNodeOutputItemType } from './node/type';
|
||||
|
||||
export type FlowModuleTemplateType = {
|
||||
id: string;
|
||||
id: string; // module id, unique
|
||||
templateType: `${ModuleTemplateTypeEnum}`;
|
||||
flowType: `${FlowNodeTypeEnum}`; // unique
|
||||
flowType: `${FlowNodeTypeEnum}`; // render node card
|
||||
avatar?: string;
|
||||
name: string;
|
||||
intro: string; // template list intro
|
||||
@@ -85,12 +85,14 @@ export type RunningModuleItemType = {
|
||||
inputs: {
|
||||
key: string;
|
||||
value?: any;
|
||||
valueType?: `${ModuleIOValueTypeEnum}`;
|
||||
}[];
|
||||
outputs: {
|
||||
key: string;
|
||||
answer?: boolean;
|
||||
response?: boolean;
|
||||
value?: any;
|
||||
valueType?: `${ModuleIOValueTypeEnum}`;
|
||||
targets: {
|
||||
moduleId: string;
|
||||
key: string;
|
||||
@@ -115,5 +117,6 @@ export type ChatDispatchProps = {
|
||||
|
||||
export type ModuleDispatchProps<T> = ChatDispatchProps & {
|
||||
outputs: RunningModuleItemType['outputs'];
|
||||
inputs: T;
|
||||
inputs: RunningModuleItemType['inputs'];
|
||||
params: T;
|
||||
};
|
||||
|
@@ -1,8 +1,14 @@
|
||||
import { FlowNodeInputTypeEnum, FlowNodeTypeEnum } from './node/constant';
|
||||
import { ModuleIOValueTypeEnum, ModuleInputKeyEnum, variableMap } from './constants';
|
||||
import {
|
||||
ModuleIOValueTypeEnum,
|
||||
ModuleInputKeyEnum,
|
||||
VariableInputEnum,
|
||||
variableMap
|
||||
} from './constants';
|
||||
import { FlowNodeInputItemType, FlowNodeOutputItemType } from './node/type';
|
||||
import { AppTTSConfigType, ModuleItemType, VariableItemType } from './type';
|
||||
import { Input_Template_Switch } from './template/input';
|
||||
import { EditorVariablePickerType } from '../../../web/components/common/Textarea/PromptEditor/type';
|
||||
|
||||
export const getGuideModule = (modules: ModuleItemType[]) =>
|
||||
modules.find((item) => item.flowType === FlowNodeTypeEnum.userGuide);
|
||||
@@ -68,7 +74,7 @@ export function plugin2ModuleIO(
|
||||
// plugin id
|
||||
key: ModuleInputKeyEnum.pluginId,
|
||||
type: FlowNodeInputTypeEnum.hidden,
|
||||
label: 'pluginId',
|
||||
label: '',
|
||||
value: pluginId,
|
||||
valueType: ModuleIOValueTypeEnum.string,
|
||||
connected: true,
|
||||
@@ -95,11 +101,11 @@ export function plugin2ModuleIO(
|
||||
};
|
||||
}
|
||||
|
||||
export const formatVariablesIcon = (
|
||||
variables: VariableItemType[]
|
||||
): (VariableItemType & { icon: string })[] => {
|
||||
export const formatEditorVariablePickerIcon = (
|
||||
variables: { key: string; label: string; type?: `${VariableInputEnum}` }[]
|
||||
): EditorVariablePickerType[] => {
|
||||
return variables.map((item) => ({
|
||||
...item,
|
||||
icon: variableMap[item.type]?.icon
|
||||
icon: item.type ? variableMap[item.type]?.icon : variableMap['input'].icon
|
||||
}));
|
||||
};
|
||||
|
@@ -7,6 +7,8 @@ export enum BillSourceEnum {
|
||||
api = 'api',
|
||||
shareLink = 'shareLink',
|
||||
training = 'training',
|
||||
|
||||
standSubPlan = 'standSubPlan',
|
||||
extraDatasetSub = 'extraDatasetSub'
|
||||
}
|
||||
|
||||
@@ -21,9 +23,12 @@ export const BillSourceMap = {
|
||||
label: '免登录链接'
|
||||
},
|
||||
[BillSourceEnum.training]: {
|
||||
label: '数据训练'
|
||||
label: 'dataset.Training Name'
|
||||
},
|
||||
[BillSourceEnum.standSubPlan]: {
|
||||
label: 'support.wallet.subscription.type.standard'
|
||||
},
|
||||
[BillSourceEnum.extraDatasetSub]: {
|
||||
label: '知识库扩容'
|
||||
label: 'support.wallet.subscription.type.extraDatasetSize'
|
||||
}
|
||||
};
|
||||
|
@@ -9,13 +9,13 @@ export const payTypeMap = {
|
||||
label: 'support.user.team.pay.type.balance'
|
||||
},
|
||||
[PayTypeEnum.subStandard]: {
|
||||
label: 'support.user.team.subscription.type.standard'
|
||||
label: 'support.wallet.subscription.type.standard'
|
||||
},
|
||||
[PayTypeEnum.subExtraDatasetSize]: {
|
||||
label: 'support.user.team.subscription.type.extraDatasetSize'
|
||||
label: 'support.wallet.subscription.type.extraDatasetSize'
|
||||
},
|
||||
[PayTypeEnum.subExtraPoints]: {
|
||||
label: 'support.user.team.subscription.type.extraPoints'
|
||||
label: 'support.wallet.subscription.type.extraPoints'
|
||||
}
|
||||
};
|
||||
|
||||
|
25
packages/global/support/wallet/sub/api.d.ts
vendored
@@ -1,15 +1,36 @@
|
||||
import { SubModeEnum } from './constants';
|
||||
import { StandardSubLevelEnum, SubModeEnum } from './constants';
|
||||
import { TeamSubSchema } from './type.d';
|
||||
|
||||
export type SubDatasetSizeParams = {
|
||||
size: number;
|
||||
};
|
||||
export type StandardSubPlanParams = {
|
||||
level: `${StandardSubLevelEnum}`;
|
||||
mode: `${SubModeEnum}`;
|
||||
};
|
||||
|
||||
export type SubDatasetSizePreviewCheckResponse = {
|
||||
payForNewSub: boolean; // Does this change require payment
|
||||
newSubSize: number; // new sub dataset size
|
||||
alreadySubSize: number; // old sub dataset size
|
||||
payPrice: number; // this change require payment
|
||||
newPrice: number; // the new sub price
|
||||
newPlanPrice: number; // the new sub price
|
||||
newSubStartTime: Date;
|
||||
newSubExpiredTime: Date;
|
||||
balanceEnough: boolean; // team balance is enough
|
||||
};
|
||||
export type StandardSubPlanUpdateResponse = {
|
||||
balanceEnough: boolean; // team balance is enough
|
||||
payPrice?: number;
|
||||
planPrice: number;
|
||||
planPointPrice: number;
|
||||
|
||||
currentMode: `${SubModeEnum}`;
|
||||
nextMode: `${SubModeEnum}`;
|
||||
currentSubLevel: `${StandardSubLevelEnum}`;
|
||||
nextSubLevel: `${StandardSubLevelEnum}`;
|
||||
totalPoints: number;
|
||||
surplusPoints: number;
|
||||
planStartTime: Date;
|
||||
planExpiredTime: Date;
|
||||
};
|
||||
|
@@ -1,3 +1,5 @@
|
||||
export const POINTS_SCALE = 10000;
|
||||
|
||||
export enum SubTypeEnum {
|
||||
standard = 'standard',
|
||||
extraDatasetSize = 'extraDatasetSize',
|
||||
@@ -5,13 +7,13 @@ export enum SubTypeEnum {
|
||||
}
|
||||
export const subTypeMap = {
|
||||
[SubTypeEnum.standard]: {
|
||||
label: 'support.user.team.subscription.type.standard'
|
||||
label: 'support.wallet.subscription.type.standard'
|
||||
},
|
||||
[SubTypeEnum.extraDatasetSize]: {
|
||||
label: 'support.user.team.subscription.type.extraDatasetSize'
|
||||
label: 'support.wallet.subscription.type.extraDatasetSize'
|
||||
},
|
||||
[SubTypeEnum.extraPoints]: {
|
||||
label: 'support.user.team.subscription.type.extraPoints'
|
||||
label: 'support.wallet.subscription.type.extraPoints'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,10 +23,10 @@ export enum SubStatusEnum {
|
||||
}
|
||||
export const subStatusMap = {
|
||||
[SubStatusEnum.active]: {
|
||||
label: 'support.user.team.subscription.status.active'
|
||||
label: 'support.wallet.subscription.status.active'
|
||||
},
|
||||
[SubStatusEnum.canceled]: {
|
||||
label: 'support.user.team.subscription.status.canceled'
|
||||
label: 'support.wallet.subscription.status.canceled'
|
||||
}
|
||||
};
|
||||
export const subSelectMap = {
|
||||
@@ -38,11 +40,11 @@ export enum SubModeEnum {
|
||||
}
|
||||
export const subModeMap = {
|
||||
[SubModeEnum.month]: {
|
||||
label: 'support.user.team.subscription.mode.month',
|
||||
label: 'support.wallet.subscription.mode.month',
|
||||
durationMonth: 1
|
||||
},
|
||||
[SubModeEnum.year]: {
|
||||
label: 'support.user.team.subscription.mode.year',
|
||||
label: 'support.wallet.subscription.mode.year',
|
||||
durationMonth: 12
|
||||
}
|
||||
};
|
||||
@@ -56,18 +58,23 @@ export enum StandardSubLevelEnum {
|
||||
}
|
||||
export const standardSubLevelMap = {
|
||||
[StandardSubLevelEnum.free]: {
|
||||
label: 'support.user.team.subscription.standardSubLevel.free'
|
||||
label: 'support.wallet.subscription.standardSubLevel.free',
|
||||
desc: 'support.wallet.subscription.standardSubLevel.free desc'
|
||||
},
|
||||
[StandardSubLevelEnum.experience]: {
|
||||
label: 'support.user.team.subscription.standardSubLevel.experience'
|
||||
label: 'support.wallet.subscription.standardSubLevel.experience',
|
||||
desc: 'support.wallet.subscription.standardSubLevel.experience desc'
|
||||
},
|
||||
[StandardSubLevelEnum.team]: {
|
||||
label: 'support.user.team.subscription.standardSubLevel.team'
|
||||
label: 'support.wallet.subscription.standardSubLevel.team',
|
||||
desc: ''
|
||||
},
|
||||
[StandardSubLevelEnum.enterprise]: {
|
||||
label: 'support.user.team.subscription.standardSubLevel.enterprise'
|
||||
label: 'support.wallet.subscription.standardSubLevel.enterprise',
|
||||
desc: ''
|
||||
},
|
||||
[StandardSubLevelEnum.custom]: {
|
||||
label: 'support.user.team.subscription.standardSubLevel.custom'
|
||||
label: 'support.wallet.subscription.standardSubLevel.custom',
|
||||
desc: ''
|
||||
}
|
||||
};
|
||||
|
74
packages/global/support/wallet/sub/type.d.ts
vendored
@@ -1,39 +1,73 @@
|
||||
import { StandardSubLevelEnum, SubModeEnum, SubStatusEnum, SubTypeEnum } from './constants';
|
||||
|
||||
// Content of plan
|
||||
export type TeamStandardSubPlanItemType = {
|
||||
price: number; // read price
|
||||
pointPrice: number; // read price/ one ten thousand
|
||||
maxTeamMember: number;
|
||||
maxAppAmount: number; // max app or plugin amount
|
||||
maxDatasetAmount: number;
|
||||
chatHistoryStoreDuration: number; // n day
|
||||
maxDatasetSize: number;
|
||||
customApiKey: boolean;
|
||||
customCopyright: boolean; // feature
|
||||
websiteSyncInterval: number; // n hours
|
||||
trainingWeight: number; // 1~4
|
||||
reRankWeight: number; // 1~4
|
||||
totalPoints: number; // n ten thousand
|
||||
};
|
||||
|
||||
export type StandSubPlanLevelMapType = Record<
|
||||
`${StandardSubLevelEnum}`,
|
||||
TeamStandardSubPlanItemType
|
||||
>;
|
||||
|
||||
export type SubPlanType = {
|
||||
[SubTypeEnum.standard]: StandSubPlanLevelMapType;
|
||||
[SubTypeEnum.extraDatasetSize]: {
|
||||
price: number;
|
||||
};
|
||||
};
|
||||
|
||||
export type TeamSubSchema = {
|
||||
_id: string;
|
||||
teamId: string;
|
||||
type: `${SubTypeEnum}`;
|
||||
status: `${SubStatusEnum}`;
|
||||
mode: `${SubModeEnum}`;
|
||||
currentMode: `${SubModeEnum}`;
|
||||
nextMode: `${SubModeEnum}`;
|
||||
startTime: Date;
|
||||
expiredTime: Date;
|
||||
price: number;
|
||||
|
||||
currentSubLevel?: `${StandardSubLevelEnum}`;
|
||||
nextSubLevel?: `${StandardSubLevelEnum}`;
|
||||
currentSubLevel: `${StandardSubLevelEnum}`;
|
||||
nextSubLevel: `${StandardSubLevelEnum}`;
|
||||
pointPrice: number;
|
||||
totalPoints: number;
|
||||
|
||||
currentExtraDatasetSize?: number;
|
||||
nextExtraDatasetSize?: number;
|
||||
currentExtraDatasetSize: number;
|
||||
nextExtraDatasetSize: number;
|
||||
|
||||
currentExtraPoints?: number;
|
||||
nextExtraPoints?: number;
|
||||
currentExtraPoints: number;
|
||||
nextExtraPoints: number;
|
||||
|
||||
maxTeamMember?: number;
|
||||
maxAppAmount?: number;
|
||||
maxDatasetAmount?: number;
|
||||
chatHistoryStoreDuration?: number;
|
||||
maxDatasetSize?: number;
|
||||
customApiKey?: boolean;
|
||||
customCopyright?: number;
|
||||
exportDatasetInterval?: number;
|
||||
websiteSyncInterval?: number;
|
||||
reRankWeight?: number;
|
||||
totalPoints?: number;
|
||||
|
||||
surplusPoints?: number;
|
||||
surplusPoints: number;
|
||||
|
||||
// abandon
|
||||
datasetStoreAmount?: number;
|
||||
renew?: boolean;
|
||||
};
|
||||
|
||||
export type FeTeamSubType = {
|
||||
[SubTypeEnum.standard]?: TeamSubSchema;
|
||||
[SubTypeEnum.extraDatasetSize]?: TeamSubSchema;
|
||||
[SubTypeEnum.extraPoints]?: TeamSubSchema;
|
||||
|
||||
standardMaxDatasetSize: number;
|
||||
totalPoints: number;
|
||||
usedPoints: number;
|
||||
|
||||
standardMaxPoints: number;
|
||||
datasetMaxSize: number;
|
||||
usedDatasetSize: number;
|
||||
};
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { UploadImgProps } from '@fastgpt/global/common/file/api';
|
||||
import { imageBaseUrl } from '@fastgpt/global/common/file/image/constants';
|
||||
import { MongoImage } from './schema';
|
||||
import { ClientSession } from '../../../common/mongo';
|
||||
|
||||
export function getMongoImgUrl(id: string) {
|
||||
return `${imageBaseUrl}${id}`;
|
||||
@@ -48,15 +49,20 @@ export async function readMongoImg({ id }: { id: string }) {
|
||||
|
||||
export async function delImgByRelatedId({
|
||||
teamId,
|
||||
relateIds
|
||||
relateIds,
|
||||
session
|
||||
}: {
|
||||
teamId: string;
|
||||
relateIds: string[];
|
||||
session: ClientSession;
|
||||
}) {
|
||||
if (relateIds.length === 0) return;
|
||||
|
||||
return MongoImage.deleteMany({
|
||||
return MongoImage.deleteMany(
|
||||
{
|
||||
teamId,
|
||||
'metadata.relatedId': { $in: relateIds.map((id) => String(id)) }
|
||||
});
|
||||
},
|
||||
{ session }
|
||||
);
|
||||
}
|
||||
|
@@ -1,21 +1,21 @@
|
||||
import mongoose, { connectionMongo } from './index';
|
||||
import { connectionMongo, ClientSession } from './index';
|
||||
|
||||
export async function mongoSessionTask(
|
||||
fn: (session: mongoose.mongo.ClientSession) => Promise<any>
|
||||
) {
|
||||
export const mongoSessionRun = async <T = unknown>(fn: (session: ClientSession) => Promise<T>) => {
|
||||
const session = await connectionMongo.startSession();
|
||||
|
||||
try {
|
||||
session.startTransaction();
|
||||
|
||||
await fn(session);
|
||||
try {
|
||||
const result = await fn(session);
|
||||
|
||||
await session.commitTransaction();
|
||||
await session.endSession();
|
||||
session.endSession();
|
||||
|
||||
return result as T;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
await session.abortTransaction();
|
||||
await session.endSession();
|
||||
console.error(error);
|
||||
session.endSession();
|
||||
return Promise.reject(error);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
7
packages/service/common/system/tools.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { isIPv6 } from 'net';
|
||||
|
||||
export const SERVICE_LOCAL_PORT = `${process.env.PORT || 3000}`;
|
||||
export const SERVICE_LOCAL_HOST =
|
||||
process.env.HOSTNAME && isIPv6(process.env.HOSTNAME)
|
||||
? `[${process.env.HOSTNAME}]:${SERVICE_LOCAL_PORT}`
|
||||
: `${process.env.HOSTNAME || 'localhost'}:${SERVICE_LOCAL_PORT}`;
|
@@ -16,4 +16,5 @@ export type InsertVectorProps = {
|
||||
export type EmbeddingRecallProps = {
|
||||
datasetIds: string[];
|
||||
similarity?: number;
|
||||
efSearch?: number;
|
||||
};
|
||||
|
@@ -2,6 +2,7 @@
|
||||
import { PgVector } from './pg/class';
|
||||
import { getVectorsByText } from '../../core/ai/embedding';
|
||||
import { InsertVectorProps } from './controller.d';
|
||||
import { VectorModelItemType } from '@fastgpt/global/core/ai/model.d';
|
||||
|
||||
const getVectorObj = () => {
|
||||
return new PgVector();
|
||||
@@ -20,7 +21,7 @@ export const insertDatasetDataVector = async ({
|
||||
...props
|
||||
}: InsertVectorProps & {
|
||||
query: string;
|
||||
model: string;
|
||||
model: VectorModelItemType;
|
||||
}) => {
|
||||
const { vectors, charsLength } = await getVectorsByText({
|
||||
model,
|
||||
@@ -43,7 +44,7 @@ export const updateDatasetDataVector = async ({
|
||||
}: InsertVectorProps & {
|
||||
id: string;
|
||||
query: string;
|
||||
model: string;
|
||||
model: VectorModelItemType;
|
||||
}) => {
|
||||
// insert new vector
|
||||
const { charsLength, insertId } = await insertDatasetDataVector(props);
|
||||
|
@@ -121,12 +121,12 @@ export const embeddingRecall = async (
|
||||
): Promise<{
|
||||
results: EmbeddingRecallItemType[];
|
||||
}> => {
|
||||
const { datasetIds, vectors, limit, similarity = 0, retry = 2 } = props;
|
||||
const { datasetIds, vectors, limit, similarity = 0, retry = 2, efSearch = 100 } = props;
|
||||
|
||||
try {
|
||||
const results: any = await PgClient.query(
|
||||
`BEGIN;
|
||||
SET LOCAL hnsw.ef_search = ${global.systemEnv.pgHNSWEfSearch || 100};
|
||||
SET LOCAL hnsw.ef_search = ${efSearch};
|
||||
select id, collection_id, (vector <#> '[${vectors[0]}]') * -1 AS score
|
||||
from ${PgDatasetTableName}
|
||||
where dataset_id IN (${datasetIds.map((id) => `'${String(id)}'`).join(',')})
|
||||
|
@@ -6,10 +6,14 @@ export const baseUrl = process.env.ONEAPI_URL || openaiBaseUrl;
|
||||
|
||||
export const systemAIChatKey = process.env.CHAT_API_KEY || '';
|
||||
|
||||
export const getAIApi = (props?: UserModelSchema['openaiAccount'], timeout = 60000) => {
|
||||
export const getAIApi = (props?: {
|
||||
userKey?: UserModelSchema['openaiAccount'];
|
||||
timeout?: number;
|
||||
}) => {
|
||||
const { userKey, timeout } = props || {};
|
||||
return new OpenAI({
|
||||
apiKey: props?.key || systemAIChatKey,
|
||||
baseURL: props?.baseUrl || baseUrl,
|
||||
apiKey: userKey?.key || systemAIChatKey,
|
||||
baseURL: userKey?.baseUrl || baseUrl,
|
||||
httpAgent: global.httpsAgent,
|
||||
timeout,
|
||||
maxRetries: 2
|
||||
|
@@ -1,15 +1,13 @@
|
||||
import { VectorModelItemType } from '@fastgpt/global/core/ai/model.d';
|
||||
import { getAIApi } from '../config';
|
||||
|
||||
export type GetVectorProps = {
|
||||
model: string;
|
||||
type GetVectorProps = {
|
||||
model: VectorModelItemType;
|
||||
input: string;
|
||||
};
|
||||
|
||||
// text to vector
|
||||
export async function getVectorsByText({
|
||||
model = 'text-embedding-ada-002',
|
||||
input
|
||||
}: GetVectorProps) {
|
||||
export async function getVectorsByText({ model, input }: GetVectorProps) {
|
||||
if (!input) {
|
||||
return Promise.reject({
|
||||
code: 500,
|
||||
@@ -23,7 +21,8 @@ export async function getVectorsByText({
|
||||
// input text to vector
|
||||
const result = await ai.embeddings
|
||||
.create({
|
||||
model,
|
||||
...model.defaultConfig,
|
||||
model: model.model,
|
||||
input: [input]
|
||||
})
|
||||
.then(async (res) => {
|
||||
|
@@ -10,10 +10,12 @@ export async function createQuestionGuide({
|
||||
messages: ChatMessageItemType[];
|
||||
model: string;
|
||||
}) {
|
||||
const ai = getAIApi(undefined, 480000);
|
||||
const ai = getAIApi({
|
||||
timeout: 480000
|
||||
});
|
||||
const data = await ai.chat.completions.create({
|
||||
model: model,
|
||||
temperature: 0,
|
||||
temperature: 0.1,
|
||||
max_tokens: 200,
|
||||
messages: [
|
||||
...messages,
|
||||
|
@@ -17,7 +17,9 @@ OUTPUT:
|
||||
`;
|
||||
|
||||
export const searchQueryExtension = async ({ query, model }: { query: string; model: string }) => {
|
||||
const ai = getAIApi(undefined, 480000);
|
||||
const ai = getAIApi({
|
||||
timeout: 480000
|
||||
});
|
||||
|
||||
const result = await ai.chat.completions.create({
|
||||
model,
|
||||
|
@@ -90,7 +90,7 @@ try {
|
||||
close custom feedback;
|
||||
*/
|
||||
ChatItemSchema.index({ appId: 1, chatId: 1, dataId: 1 }, { background: true });
|
||||
ChatItemSchema.index({ time: -1 }, { background: true });
|
||||
ChatItemSchema.index({ time: -1, obj: 1 }, { background: true });
|
||||
ChatItemSchema.index({ userGoodFeedback: 1 }, { background: true });
|
||||
ChatItemSchema.index({ userBadFeedback: 1 }, { background: true });
|
||||
ChatItemSchema.index({ customFeedbacks: 1 }, { background: true });
|
||||
|
@@ -15,6 +15,7 @@ import { delImgByRelatedId } from '../../../common/file/image/controller';
|
||||
import { deleteDatasetDataVector } from '../../../common/vectorStore/controller';
|
||||
import { delFileByFileIdList } from '../../../common/file/gridfs/controller';
|
||||
import { BucketNameEnum } from '@fastgpt/global/common/file/constants';
|
||||
import { ClientSession } from '../../../common/mongo';
|
||||
|
||||
export async function createOneCollection({
|
||||
teamId,
|
||||
@@ -35,9 +36,17 @@ export async function createOneCollection({
|
||||
hashRawText,
|
||||
rawTextLength,
|
||||
metadata = {},
|
||||
session,
|
||||
...props
|
||||
}: CreateDatasetCollectionParams & { teamId: string; tmbId: string; [key: string]: any }) {
|
||||
const { _id } = await MongoDatasetCollection.create({
|
||||
}: CreateDatasetCollectionParams & {
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
[key: string]: any;
|
||||
session?: ClientSession;
|
||||
}) {
|
||||
const [collection] = await MongoDatasetCollection.create(
|
||||
[
|
||||
{
|
||||
...props,
|
||||
teamId,
|
||||
tmbId,
|
||||
@@ -57,19 +66,23 @@ export async function createOneCollection({
|
||||
rawTextLength,
|
||||
hashRawText,
|
||||
metadata
|
||||
});
|
||||
}
|
||||
],
|
||||
{ session }
|
||||
);
|
||||
|
||||
// create default collection
|
||||
if (type === DatasetCollectionTypeEnum.folder) {
|
||||
await createDefaultCollection({
|
||||
datasetId,
|
||||
parentId: _id,
|
||||
parentId: collection._id,
|
||||
teamId,
|
||||
tmbId
|
||||
tmbId,
|
||||
session
|
||||
});
|
||||
}
|
||||
|
||||
return _id;
|
||||
return collection;
|
||||
}
|
||||
|
||||
// create default collection
|
||||
@@ -78,15 +91,19 @@ export function createDefaultCollection({
|
||||
datasetId,
|
||||
parentId,
|
||||
teamId,
|
||||
tmbId
|
||||
tmbId,
|
||||
session
|
||||
}: {
|
||||
name?: '手动录入' | '手动标注';
|
||||
datasetId: string;
|
||||
parentId?: string;
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
session?: ClientSession;
|
||||
}) {
|
||||
return MongoDatasetCollection.create({
|
||||
return MongoDatasetCollection.create(
|
||||
[
|
||||
{
|
||||
name,
|
||||
teamId,
|
||||
tmbId,
|
||||
@@ -96,16 +113,21 @@ export function createDefaultCollection({
|
||||
trainingType: TrainingModeEnum.chunk,
|
||||
chunkSize: 0,
|
||||
updateTime: new Date('2099')
|
||||
});
|
||||
}
|
||||
],
|
||||
{ session }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* delete collection and it related data
|
||||
*/
|
||||
export async function delCollectionAndRelatedSources({
|
||||
collections
|
||||
collections,
|
||||
session
|
||||
}: {
|
||||
collections: (CollectionWithDatasetType | DatasetCollectionSchemaType)[];
|
||||
session: ClientSession;
|
||||
}) {
|
||||
if (collections.length === 0) return;
|
||||
|
||||
@@ -128,24 +150,25 @@ export async function delCollectionAndRelatedSources({
|
||||
await delay(2000);
|
||||
|
||||
// delete dataset.datas
|
||||
await MongoDatasetData.deleteMany({ teamId, collectionId: { $in: collectionIds } });
|
||||
// delete pg data
|
||||
await deleteDatasetDataVector({ teamId, collectionIds });
|
||||
|
||||
// delete file and imgs
|
||||
await Promise.all([
|
||||
delImgByRelatedId({
|
||||
await MongoDatasetData.deleteMany({ teamId, collectionId: { $in: collectionIds } }, { session });
|
||||
// delete imgs
|
||||
await delImgByRelatedId({
|
||||
teamId,
|
||||
relateIds: relatedImageIds
|
||||
}),
|
||||
delFileByFileIdList({
|
||||
relateIds: relatedImageIds,
|
||||
session
|
||||
});
|
||||
// delete collections
|
||||
await MongoDatasetCollection.deleteMany(
|
||||
{
|
||||
_id: { $in: collectionIds }
|
||||
},
|
||||
{ session }
|
||||
);
|
||||
|
||||
// no session delete: delete files, vector data
|
||||
await deleteDatasetDataVector({ teamId, collectionIds });
|
||||
await delFileByFileIdList({
|
||||
bucketName: BucketNameEnum.dataset,
|
||||
fileIdList
|
||||
})
|
||||
]);
|
||||
|
||||
// delete collections
|
||||
await MongoDatasetCollection.deleteMany({
|
||||
_id: { $in: collectionIds }
|
||||
});
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ import {
|
||||
TrainingModeEnum
|
||||
} from '@fastgpt/global/core/dataset/constants';
|
||||
import { hashStr } from '@fastgpt/global/common/string/tools';
|
||||
import { ClientSession } from '../../../common/mongo';
|
||||
|
||||
/**
|
||||
* get all collection by top collectionId
|
||||
@@ -149,17 +150,17 @@ export const getCollectionAndRawText = async ({
|
||||
|
||||
/* link collection start load data */
|
||||
export const reloadCollectionChunks = async ({
|
||||
collectionId,
|
||||
collection,
|
||||
tmbId,
|
||||
billId,
|
||||
rawText
|
||||
rawText,
|
||||
session
|
||||
}: {
|
||||
collectionId?: string;
|
||||
collection?: CollectionWithDatasetType;
|
||||
collection: CollectionWithDatasetType;
|
||||
tmbId: string;
|
||||
billId?: string;
|
||||
rawText?: string;
|
||||
session: ClientSession;
|
||||
}) => {
|
||||
const {
|
||||
title,
|
||||
@@ -168,7 +169,6 @@ export const reloadCollectionChunks = async ({
|
||||
isSameRawText
|
||||
} = await getCollectionAndRawText({
|
||||
collection,
|
||||
collectionId,
|
||||
newRawText: rawText
|
||||
});
|
||||
|
||||
@@ -186,6 +186,7 @@ export const reloadCollectionChunks = async ({
|
||||
if (col.trainingType === TrainingModeEnum.qa) return col.datasetId.agentModel;
|
||||
return Promise.reject('Training model error');
|
||||
})();
|
||||
|
||||
await MongoDatasetTraining.insertMany(
|
||||
chunks.map((item, i) => ({
|
||||
teamId: col.teamId,
|
||||
@@ -199,13 +200,18 @@ export const reloadCollectionChunks = async ({
|
||||
q: item,
|
||||
a: '',
|
||||
chunkIndex: i
|
||||
}))
|
||||
})),
|
||||
{ session }
|
||||
);
|
||||
|
||||
// update raw text
|
||||
await MongoDatasetCollection.findByIdAndUpdate(col._id, {
|
||||
await MongoDatasetCollection.findByIdAndUpdate(
|
||||
col._id,
|
||||
{
|
||||
...(title && { name: title }),
|
||||
rawTextLength: newRawText.length,
|
||||
hashRawText: hashStr(newRawText)
|
||||
});
|
||||
},
|
||||
{ session }
|
||||
);
|
||||
};
|
||||
|
@@ -2,6 +2,7 @@ import { CollectionWithDatasetType, DatasetSchemaType } from '@fastgpt/global/co
|
||||
import { MongoDatasetCollection } from './collection/schema';
|
||||
import { MongoDataset } from './schema';
|
||||
import { delCollectionAndRelatedSources } from './collection/controller';
|
||||
import { ClientSession } from '../../common/mongo';
|
||||
|
||||
/* ============= dataset ========== */
|
||||
/* find all datasetId by top datasetId */
|
||||
@@ -55,7 +56,13 @@ export async function getCollectionWithDataset(collectionId: string) {
|
||||
}
|
||||
|
||||
/* delete all data by datasetIds */
|
||||
export async function delDatasetRelevantData({ datasets }: { datasets: DatasetSchemaType[] }) {
|
||||
export async function delDatasetRelevantData({
|
||||
datasets,
|
||||
session
|
||||
}: {
|
||||
datasets: DatasetSchemaType[];
|
||||
session: ClientSession;
|
||||
}) {
|
||||
if (!datasets.length) return;
|
||||
|
||||
const teamId = datasets[0].teamId;
|
||||
@@ -70,5 +77,5 @@ export async function delDatasetRelevantData({ datasets }: { datasets: DatasetSc
|
||||
'_id teamId fileId metadata'
|
||||
).lean();
|
||||
|
||||
await delCollectionAndRelatedSources({ collections });
|
||||
await delCollectionAndRelatedSources({ collections, session });
|
||||
}
|
||||
|
@@ -40,12 +40,12 @@ export async function pushDataListToTrainingQueue({
|
||||
trainingMode = TrainingModeEnum.chunk,
|
||||
|
||||
vectorModelList = [],
|
||||
qaModelList = []
|
||||
datasetModelList = []
|
||||
}: {
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
vectorModelList: VectorModelItemType[];
|
||||
qaModelList: LLMModelItemType[];
|
||||
datasetModelList: LLMModelItemType[];
|
||||
} & PushDatasetDataProps): Promise<PushDatasetDataResponse> {
|
||||
const {
|
||||
datasetId: { _id: datasetId, vectorModel, agentModel }
|
||||
@@ -68,7 +68,7 @@ export async function pushDataListToTrainingQueue({
|
||||
}
|
||||
|
||||
if (trainingMode === TrainingModeEnum.qa) {
|
||||
const qaModelData = qaModelList?.find((item) => item.model === agentModel);
|
||||
const qaModelData = datasetModelList?.find((item) => item.model === agentModel);
|
||||
if (!qaModelData) {
|
||||
return Promise.reject(`Model ${agentModel} is inValid`);
|
||||
}
|
||||
@@ -150,7 +150,7 @@ export async function pushDataListToTrainingQueue({
|
||||
model,
|
||||
q: item.q,
|
||||
a: item.a,
|
||||
chunkIndex: item.chunkIndex ?? i,
|
||||
chunkIndex: item.chunkIndex ?? 0,
|
||||
weight: weight ?? 0,
|
||||
indexes: item.indexes
|
||||
}))
|
||||
|
@@ -15,6 +15,7 @@
|
||||
"nextjs-cors": "^2.1.2",
|
||||
"node-cron": "^3.0.3",
|
||||
"pg": "^8.10.0",
|
||||
"date-fns": "^2.30.0",
|
||||
"tunnel": "^0.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@@ -17,6 +17,7 @@ export async function authOpenApiKey({ apikey }: { apikey: string }) {
|
||||
}
|
||||
|
||||
// auth limit
|
||||
// @ts-ignore
|
||||
if (global.feConfigs?.isPlus) {
|
||||
await POST('/support/openapi/authLimit', { openApi } as AuthOpenApiLimitProps);
|
||||
}
|
||||
|
@@ -68,6 +68,13 @@ const OpenApiSchema = new Schema(
|
||||
}
|
||||
);
|
||||
|
||||
try {
|
||||
OpenApiSchema.index({ teamId: 1 });
|
||||
OpenApiSchema.index({ apiKey: 1 });
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
export const MongoOpenApi: Model<OpenApiSchema> =
|
||||
models['openapi'] || model('openapi', OpenApiSchema);
|
||||
MongoOpenApi.syncIndexes();
|
||||
|
@@ -2,7 +2,7 @@ import { AuthUserTypeEnum } from '@fastgpt/global/support/permission/constant';
|
||||
import { parseHeaderCert } from '../controller';
|
||||
import { AuthModeType } from '../type';
|
||||
import { authOutLinkValid } from './outLink';
|
||||
import { isIPv6 } from 'net';
|
||||
import { SERVICE_LOCAL_HOST } from '../../../common/system/tools';
|
||||
|
||||
export const authCert = async (props: AuthModeType) => {
|
||||
const result = await parseHeaderCert(props);
|
||||
@@ -35,12 +35,7 @@ export async function authCertOrShareId({
|
||||
|
||||
/* auth the request from local service */
|
||||
export const authRequestFromLocal = ({ req }: AuthModeType) => {
|
||||
const host =
|
||||
process.env.HOSTNAME && isIPv6(process.env.HOSTNAME)
|
||||
? `[${process.env.HOSTNAME}]:${process.env.PORT || 3000}`
|
||||
: `${process.env.HOSTNAME || 'localhost'}:${process.env.PORT || 3000}`;
|
||||
|
||||
if (host !== req.headers.host) {
|
||||
if (req.headers.host !== SERVICE_LOCAL_HOST) {
|
||||
return Promise.reject('Invalid request');
|
||||
}
|
||||
};
|
||||
|
@@ -111,8 +111,7 @@ export async function parseHeaderCert({
|
||||
}
|
||||
}
|
||||
|
||||
const { cookie, token, apikey, rootkey, authorization } = (req.headers ||
|
||||
{}) as ReqHeaderAuthType;
|
||||
const { cookie, token, rootkey, authorization } = (req.headers || {}) as ReqHeaderAuthType;
|
||||
|
||||
const { uid, teamId, tmbId, appId, openApiKey, authType } = await (async () => {
|
||||
if (authApiKey && authorization) {
|
||||
@@ -151,19 +150,6 @@ export async function parseHeaderCert({
|
||||
authType: AuthUserTypeEnum.root
|
||||
};
|
||||
}
|
||||
// apikey: abandon
|
||||
if (authApiKey && apikey) {
|
||||
// apikey
|
||||
const parseResult = await authOpenApiKey({ apikey });
|
||||
return {
|
||||
uid: parseResult.userId,
|
||||
teamId: parseResult.teamId,
|
||||
tmbId: parseResult.tmbId,
|
||||
appId: parseResult.appId,
|
||||
openApiKey: parseResult.apikey,
|
||||
authType: AuthUserTypeEnum.apikey
|
||||
};
|
||||
}
|
||||
|
||||
return Promise.reject(ERROR_ENUM.unAuthorization);
|
||||
})();
|
||||
|
@@ -1,17 +1,18 @@
|
||||
import { StandSubPlanLevelMapType } from '@fastgpt/global/support/wallet/sub/type';
|
||||
import { getVectorCountByTeamId } from '../../../common/vectorStore/controller';
|
||||
import { getTeamDatasetValidSub } from '../../wallet/sub/utils';
|
||||
import { getTeamDatasetMaxSize } from '../../wallet/sub/utils';
|
||||
|
||||
export const checkDatasetLimit = async ({
|
||||
teamId,
|
||||
freeSize = Infinity,
|
||||
insertLen = 0
|
||||
insertLen = 0,
|
||||
standardPlans
|
||||
}: {
|
||||
teamId: string;
|
||||
freeSize?: number;
|
||||
insertLen?: number;
|
||||
standardPlans?: StandSubPlanLevelMapType;
|
||||
}) => {
|
||||
const [{ maxSize }, usedSize] = await Promise.all([
|
||||
getTeamDatasetValidSub({ teamId, freeSize }),
|
||||
getTeamDatasetMaxSize({ teamId, standardPlans }),
|
||||
getVectorCountByTeamId(teamId)
|
||||
]);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { TeamItemType, TeamMemberWithTeamSchema } from '@fastgpt/global/support/user/team/type';
|
||||
import { Types } from '../../../common/mongo';
|
||||
import { ClientSession, Types } from '../../../common/mongo';
|
||||
import {
|
||||
TeamMemberRoleEnum,
|
||||
TeamMemberStatusEnum,
|
||||
@@ -55,13 +55,15 @@ export async function createDefaultTeam({
|
||||
teamName = 'My Team',
|
||||
avatar = '/icon/logo.svg',
|
||||
balance,
|
||||
maxSize = 5
|
||||
maxSize = 5,
|
||||
session
|
||||
}: {
|
||||
userId: string;
|
||||
teamName?: string;
|
||||
avatar?: string;
|
||||
balance?: number;
|
||||
maxSize?: number;
|
||||
session: ClientSession;
|
||||
}) {
|
||||
// auth default team
|
||||
const tmb = await MongoTeamMember.findOne({
|
||||
@@ -73,15 +75,22 @@ export async function createDefaultTeam({
|
||||
console.log('create default team', userId);
|
||||
|
||||
// create
|
||||
const { _id: insertedId } = await MongoTeam.create({
|
||||
const [{ _id: insertedId }] = await MongoTeam.create(
|
||||
[
|
||||
{
|
||||
ownerId: userId,
|
||||
name: teamName,
|
||||
avatar,
|
||||
balance,
|
||||
maxSize,
|
||||
createTime: new Date()
|
||||
});
|
||||
await MongoTeamMember.create({
|
||||
}
|
||||
],
|
||||
{ session }
|
||||
);
|
||||
await MongoTeamMember.create(
|
||||
[
|
||||
{
|
||||
teamId: insertedId,
|
||||
userId,
|
||||
name: 'Owner',
|
||||
@@ -89,7 +98,10 @@ export async function createDefaultTeam({
|
||||
status: TeamMemberStatusEnum.active,
|
||||
createTime: new Date(),
|
||||
defaultTeam: true
|
||||
});
|
||||
}
|
||||
],
|
||||
{ session }
|
||||
);
|
||||
} else {
|
||||
console.log('default team exist', userId);
|
||||
await MongoTeam.findByIdAndUpdate(tmb.teamId, {
|
||||
|
@@ -3,7 +3,6 @@ const { Schema, model, models } = connectionMongo;
|
||||
import { TeamSchema as TeamType } from '@fastgpt/global/support/user/team/type.d';
|
||||
import { userCollectionName } from '../../user/schema';
|
||||
import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant';
|
||||
import { PRICE_SCALE } from '@fastgpt/global/support/wallet/bill/constants';
|
||||
|
||||
const TeamSchema = new Schema({
|
||||
name: {
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { BillSourceEnum } from '@fastgpt/global/support/wallet/bill/constants';
|
||||
import { MongoBill } from './schema';
|
||||
import { ClientSession } from '../../../common/mongo';
|
||||
|
||||
export const createTrainingBill = async ({
|
||||
teamId,
|
||||
@@ -7,7 +8,8 @@ export const createTrainingBill = async ({
|
||||
appName,
|
||||
billSource,
|
||||
vectorModel,
|
||||
agentModel
|
||||
agentModel,
|
||||
session
|
||||
}: {
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
@@ -15,8 +17,11 @@ export const createTrainingBill = async ({
|
||||
billSource: `${BillSourceEnum}`;
|
||||
vectorModel: string;
|
||||
agentModel: string;
|
||||
session?: ClientSession;
|
||||
}) => {
|
||||
const { _id } = await MongoBill.create({
|
||||
const [{ _id }] = await MongoBill.create(
|
||||
[
|
||||
{
|
||||
teamId,
|
||||
tmbId,
|
||||
appName,
|
||||
@@ -36,7 +41,10 @@ export const createTrainingBill = async ({
|
||||
}
|
||||
],
|
||||
total: 0
|
||||
});
|
||||
}
|
||||
],
|
||||
{ session }
|
||||
);
|
||||
|
||||
return { billId: String(_id) };
|
||||
};
|
||||
|
@@ -29,6 +29,15 @@ const SubSchema = new Schema({
|
||||
required: true
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
enum: Object.keys(subModeMap)
|
||||
},
|
||||
currentMode: {
|
||||
type: String,
|
||||
enum: Object.keys(subModeMap),
|
||||
required: true
|
||||
},
|
||||
nextMode: {
|
||||
type: String,
|
||||
enum: Object.keys(subModeMap),
|
||||
required: true
|
||||
@@ -46,6 +55,10 @@ const SubSchema = new Schema({
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
pointPrice: {
|
||||
// stand level point total price
|
||||
type: Number
|
||||
},
|
||||
|
||||
// sub content
|
||||
currentSubLevel: {
|
||||
@@ -56,6 +69,9 @@ const SubSchema = new Schema({
|
||||
type: String,
|
||||
enum: Object.keys(standardSubLevelMap)
|
||||
},
|
||||
totalPoints: {
|
||||
type: Number
|
||||
},
|
||||
|
||||
currentExtraDatasetSize: {
|
||||
type: Number
|
||||
@@ -72,48 +88,44 @@ const SubSchema = new Schema({
|
||||
},
|
||||
|
||||
// standard sub limit
|
||||
maxTeamMember: {
|
||||
type: Number
|
||||
},
|
||||
maxAppAmount: {
|
||||
type: Number
|
||||
},
|
||||
maxDatasetAmount: {
|
||||
type: Number
|
||||
},
|
||||
chatHistoryStoreDuration: {
|
||||
// n day
|
||||
type: Number
|
||||
},
|
||||
maxDatasetSize: {
|
||||
type: Number
|
||||
},
|
||||
trainingWeight: {
|
||||
// 0 1 2 3
|
||||
type: Number
|
||||
},
|
||||
customApiKey: {
|
||||
type: Boolean
|
||||
},
|
||||
customCopyright: {
|
||||
type: Boolean
|
||||
},
|
||||
exportDatasetInterval: {
|
||||
// hours
|
||||
type: Number
|
||||
},
|
||||
websiteSyncInterval: {
|
||||
// hours
|
||||
type: Number
|
||||
},
|
||||
reRankWeight: {
|
||||
// 0 1 2 3
|
||||
type: Number
|
||||
},
|
||||
totalPoints: {
|
||||
// record standard sub points
|
||||
type: Number
|
||||
},
|
||||
// maxTeamMember: {
|
||||
// type: Number
|
||||
// },
|
||||
// maxAppAmount: {
|
||||
// type: Number
|
||||
// },
|
||||
// maxDatasetAmount: {
|
||||
// type: Number
|
||||
// },
|
||||
// chatHistoryStoreDuration: {
|
||||
// // n day
|
||||
// type: Number
|
||||
// },
|
||||
// maxDatasetSize: {
|
||||
// type: Number
|
||||
// },
|
||||
// trainingWeight: {
|
||||
// // 0 1 2 3
|
||||
// type: Number
|
||||
// },
|
||||
// customApiKey: {
|
||||
// type: Boolean
|
||||
// },
|
||||
// customCopyright: {
|
||||
// type: Boolean
|
||||
// },
|
||||
// websiteSyncInterval: {
|
||||
// // hours
|
||||
// type: Number
|
||||
// },
|
||||
// reRankWeight: {
|
||||
// // 0 1 2 3
|
||||
// type: Number
|
||||
// },
|
||||
// totalPoints: {
|
||||
// // record standard sub points
|
||||
// type: Number
|
||||
// },
|
||||
|
||||
surplusPoints: {
|
||||
// standard sub / extra points sub
|
||||
|
@@ -1,28 +1,87 @@
|
||||
import { SubTypeEnum } from '@fastgpt/global/support/wallet/sub/constants';
|
||||
import { MongoTeamSub } from './schema';
|
||||
import { addHours } from 'date-fns';
|
||||
import { FeTeamSubType, StandSubPlanLevelMapType } from '@fastgpt/global/support/wallet/sub/type.d';
|
||||
import { getVectorCountByTeamId } from '../../../common/vectorStore/controller';
|
||||
|
||||
/* get team dataset size */
|
||||
export const getTeamDatasetValidSub = async ({
|
||||
/* get team dataset max size */
|
||||
export const getTeamDatasetMaxSize = async ({
|
||||
teamId,
|
||||
freeSize = Infinity
|
||||
standardPlans
|
||||
}: {
|
||||
teamId: string;
|
||||
freeSize?: number;
|
||||
standardPlans?: StandSubPlanLevelMapType;
|
||||
}) => {
|
||||
const sub = await MongoTeamSub.findOne({
|
||||
if (!standardPlans) {
|
||||
return {
|
||||
maxSize: Infinity,
|
||||
sub: null
|
||||
};
|
||||
}
|
||||
|
||||
const plans = await MongoTeamSub.find({
|
||||
teamId,
|
||||
type: SubTypeEnum.extraDatasetSize,
|
||||
expiredTime: { $gte: new Date() }
|
||||
expiredTime: { $gte: addHours(new Date(), -3) }
|
||||
}).lean();
|
||||
|
||||
const maxSize = (() => {
|
||||
if (!sub || !sub.currentExtraDatasetSize) return freeSize;
|
||||
const standard = plans.find((plan) => plan.type === SubTypeEnum.standard);
|
||||
const extraDatasetSize = plans.find((plan) => plan.type === SubTypeEnum.extraDatasetSize);
|
||||
|
||||
return sub.currentExtraDatasetSize + freeSize;
|
||||
})();
|
||||
const standardMaxDatasetSize =
|
||||
standard?.currentSubLevel && standardPlans
|
||||
? standardPlans[standard.currentSubLevel]?.maxDatasetSize || Infinity
|
||||
: Infinity;
|
||||
const totalDatasetSize =
|
||||
standardMaxDatasetSize + (extraDatasetSize?.currentExtraDatasetSize || 0);
|
||||
|
||||
return {
|
||||
maxSize,
|
||||
sub
|
||||
maxSize: totalDatasetSize,
|
||||
sub: extraDatasetSize
|
||||
};
|
||||
};
|
||||
|
||||
export const getTeamSubPlanStatus = async ({
|
||||
teamId,
|
||||
standardPlans
|
||||
}: {
|
||||
teamId: string;
|
||||
standardPlans?: StandSubPlanLevelMapType;
|
||||
}): Promise<FeTeamSubType> => {
|
||||
const [plans, usedDatasetSize] = await Promise.all([
|
||||
MongoTeamSub.find({ teamId }).lean(),
|
||||
getVectorCountByTeamId(teamId)
|
||||
]);
|
||||
|
||||
const standard = plans.find((plan) => plan.type === SubTypeEnum.standard);
|
||||
const extraDatasetSize = plans.find((plan) => plan.type === SubTypeEnum.extraDatasetSize);
|
||||
const extraPoints = plans.find((plan) => plan.type === SubTypeEnum.extraPoints);
|
||||
|
||||
const standardMaxDatasetSize =
|
||||
standard?.currentSubLevel && standardPlans
|
||||
? standardPlans[standard.currentSubLevel]?.maxDatasetSize || Infinity
|
||||
: Infinity;
|
||||
const totalDatasetSize =
|
||||
standardMaxDatasetSize + (extraDatasetSize?.currentExtraDatasetSize || 0);
|
||||
|
||||
const standardMaxPoints =
|
||||
standard?.currentSubLevel && standardPlans
|
||||
? standardPlans[standard.currentSubLevel]?.totalPoints || Infinity
|
||||
: Infinity;
|
||||
const totalPoints = standardMaxPoints + (extraPoints?.currentExtraPoints || 0);
|
||||
|
||||
const surplusPoints = (standard?.surplusPoints || 0) + (extraPoints?.surplusPoints || 0);
|
||||
|
||||
return {
|
||||
[SubTypeEnum.standard]: standard,
|
||||
[SubTypeEnum.extraDatasetSize]: extraDatasetSize,
|
||||
[SubTypeEnum.extraPoints]: extraPoints,
|
||||
|
||||
standardMaxDatasetSize,
|
||||
datasetMaxSize: totalDatasetSize,
|
||||
usedDatasetSize,
|
||||
|
||||
standardMaxPoints,
|
||||
totalPoints,
|
||||
usedPoints: totalPoints - surplusPoints
|
||||
};
|
||||
};
|
||||
|
@@ -12,6 +12,7 @@ export const iconPaths = {
|
||||
'common/closeLight': () => import('./icons/common/closeLight.svg'),
|
||||
'common/confirm/commonTip': () => import('./icons/common/confirm/commonTip.svg'),
|
||||
'common/confirm/deleteTip': () => import('./icons/common/confirm/deleteTip.svg'),
|
||||
'common/confirm/rightTip': () => import('./icons/common/confirm/rightTip.svg'),
|
||||
'common/courseLight': () => import('./icons/common/courseLight.svg'),
|
||||
'common/customTitleLight': () => import('./icons/common/customTitleLight.svg'),
|
||||
'common/editor/resizer': () => import('./icons/common/editor/resizer.svg'),
|
||||
@@ -31,6 +32,7 @@ export const iconPaths = {
|
||||
'common/loading': () => import('./icons/common/loading.svg'),
|
||||
'common/navbar/pluginFill': () => import('./icons/common/navbar/pluginFill.svg'),
|
||||
'common/navbar/pluginLight': () => import('./icons/common/navbar/pluginLight.svg'),
|
||||
'common/openai': () => import('./icons/common/openai.svg'),
|
||||
'common/overviewLight': () => import('./icons/common/overviewLight.svg'),
|
||||
'common/paramsLight': () => import('./icons/common/paramsLight.svg'),
|
||||
'common/playFill': () => import('./icons/common/playFill.svg'),
|
||||
@@ -123,7 +125,6 @@ export const iconPaths = {
|
||||
'file/qaImport': () => import('./icons/file/qaImport.svg'),
|
||||
'file/uploadFile': () => import('./icons/file/uploadFile.svg'),
|
||||
history: () => import('./icons/history.svg'),
|
||||
inform: () => import('./icons/inform.svg'),
|
||||
kbTest: () => import('./icons/kbTest.svg'),
|
||||
menu: () => import('./icons/menu.svg'),
|
||||
minus: () => import('./icons/minus.svg'),
|
||||
@@ -135,6 +136,8 @@ export const iconPaths = {
|
||||
'phoneTabbar/me': () => import('./icons/phoneTabbar/me.svg'),
|
||||
'phoneTabbar/tool': () => import('./icons/phoneTabbar/tool.svg'),
|
||||
'phoneTabbar/toolFill': () => import('./icons/phoneTabbar/toolFill.svg'),
|
||||
'price/bg': () => import('./icons/price/bg.svg'),
|
||||
'price/right': () => import('./icons/price/right.svg'),
|
||||
save: () => import('./icons/save.svg'),
|
||||
stop: () => import('./icons/stop.svg'),
|
||||
'support/account/loginoutLight': () => import('./icons/support/account/loginoutLight.svg'),
|
||||
@@ -145,6 +148,8 @@ export const iconPaths = {
|
||||
'support/outlink/iframeLight': () => import('./icons/support/outlink/iframeLight.svg'),
|
||||
'support/outlink/share': () => import('./icons/support/outlink/share.svg'),
|
||||
'support/outlink/shareLight': () => import('./icons/support/outlink/shareLight.svg'),
|
||||
'support/pay/extraDatasetsize': () => import('./icons/support/pay/extraDatasetsize.svg'),
|
||||
'support/pay/extraPoints': () => import('./icons/support/pay/extraPoints.svg'),
|
||||
'support/pay/payRecordLight': () => import('./icons/support/pay/payRecordLight.svg'),
|
||||
'support/pay/priceLight': () => import('./icons/support/pay/priceLight.svg'),
|
||||
'support/permission/privateLight': () => import('./icons/support/permission/privateLight.svg'),
|
||||
|
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M15.277 4.64527C13.6911 3.93863 11.9193 3.76357 10.2257 4.1462C8.5322 4.52883 7.00773 5.44865 5.87967 6.76847C4.75162 8.08829 4.08042 9.73741 3.96618 11.4699C3.85195 13.2023 4.30079 14.9253 5.24577 16.3818C6.19076 17.8383 7.58125 18.9503 9.20987 19.552C10.8385 20.1537 12.618 20.2128 14.2829 19.7206C15.9479 19.2283 17.4091 18.211 18.4487 16.8204C19.4883 15.4298 20.0505 13.7404 20.0515 12.0042V11.1721C20.0515 10.6198 20.4992 10.1721 21.0515 10.1721C21.6037 10.1721 22.0515 10.6198 22.0515 11.1721V12.0048C22.0502 14.1723 21.3484 16.2819 20.0506 18.0179C18.7528 19.7539 16.9286 21.0239 14.85 21.6385C12.7715 22.253 10.5499 22.1792 8.51676 21.4281C6.48359 20.6769 4.74769 19.2887 3.56797 17.4704C2.38824 15.652 1.8279 13.5011 1.97052 11.3383C2.11313 9.17546 2.95106 7.1167 4.35933 5.46903C5.7676 3.82136 7.67076 2.67305 9.78496 2.19537C11.8992 1.7177 14.1111 1.93624 16.091 2.81841C16.5955 3.04319 16.8222 3.63437 16.5974 4.13884C16.3727 4.64331 15.7815 4.87005 15.277 4.64527ZM21.7582 4.05106C22.1489 4.44138 22.1492 5.07455 21.7589 5.46527L12.7076 14.5257C12.5201 14.7134 12.2656 14.8189 12.0003 14.8189C11.735 14.819 11.4806 14.7136 11.293 14.526L8.57758 11.8106C8.18705 11.4201 8.18705 10.7869 8.57758 10.3964C8.9681 10.0059 9.60127 10.0059 9.99179 10.3964L11.9997 12.4044L20.344 4.05176C20.7343 3.66104 21.3675 3.66073 21.7582 4.05106Z"
|
||||
fill="#3370FF" />
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M9.22896 1.66606C10.3007 1.68134 11.3053 2.08881 12.1291 2.9012C12.2505 3.02089 12.3563 3.04891 12.519 3.02599C14.882 2.69746 16.9557 4.16945 17.3896 6.48438C17.5032 7.09304 17.4671 7.69915 17.2915 8.29253C17.2476 8.43769 17.276 8.52937 17.3715 8.64397C19.3265 11.0098 18.1566 14.5879 15.1687 15.3672C14.9982 15.4105 14.9233 15.4869 14.8639 15.6397C13.7535 18.4869 10.0244 19.2535 7.84992 17.0811C7.74145 16.9742 7.64848 16.9513 7.50128 16.9716C5.10474 17.3052 3.02843 15.8307 2.59974 13.4903C2.48869 12.8893 2.53001 12.2908 2.70562 11.7051C2.74952 11.5599 2.72111 11.4682 2.62814 11.3536C0.665459 8.98523 1.85598 5.38167 4.85424 4.62276C5.00402 4.58456 5.07375 4.52089 5.12798 4.38337C5.7736 2.71784 7.34117 1.65842 9.22896 1.66606ZM11.8269 11.9216C10.4711 12.6932 9.15924 13.4343 7.85767 14.1881C7.56326 14.3587 7.31276 14.3536 7.01836 14.183C5.99828 13.5871 4.97045 13.009 3.94263 12.4283C3.86773 12.3876 3.80575 12.3036 3.68696 12.3392C3.54751 13.5769 3.94004 14.6083 4.97045 15.3392C6.00861 16.0752 7.15007 16.1669 8.28119 15.576C9.43814 14.9725 10.5564 14.2951 11.6901 13.6482C11.7546 13.6125 11.8269 13.5845 11.8269 13.4903V11.9216ZM11.1038 3.49458C11.078 3.40544 11.0109 3.37997 10.9592 3.34432C9.92623 2.65417 8.8261 2.54466 7.71046 3.08711C6.5845 3.63719 5.98537 4.57692 5.9518 5.81715C5.91822 7.07776 5.94663 8.33837 5.93888 9.59898C5.93888 9.73395 5.98537 9.80526 6.10158 9.86638C6.4812 10.0727 6.85566 10.2917 7.23012 10.503C7.27661 10.5285 7.31793 10.5845 7.3954 10.5362C7.3954 9.0438 7.40057 7.5438 7.39282 6.04381C7.39024 5.73566 7.50903 5.53702 7.78019 5.38676C8.56526 4.95128 9.34259 4.50306 10.1225 4.05739C10.4505 3.87148 10.7785 3.68048 11.1038 3.49458ZM12.5991 9.40034V9.72631C12.5991 11.1423 12.5965 12.5608 12.6017 13.9767C12.6043 14.2645 12.4958 14.4606 12.2401 14.5981C11.8812 14.7917 11.53 14.9979 11.1762 15.1991C10.4143 15.6346 9.64991 16.0701 8.81577 16.5463C8.88807 16.5718 8.92423 16.5769 8.95005 16.5973C9.90815 17.2874 10.9541 17.4453 12.0516 17.0124C13.1492 16.5794 13.8568 15.7569 13.9911 14.5981C14.1538 13.1822 14.0246 11.7509 14.0505 10.3273C14.053 10.2509 14.0169 10.2076 13.9549 10.172C13.5159 9.92241 13.0794 9.67283 12.5991 9.40034ZM10.7733 7.47504C10.8792 7.53871 10.9515 7.57946 11.0212 7.6202C12.2711 8.33327 13.5185 9.04889 14.7735 9.75432C15.0447 9.90713 15.1609 10.1083 15.1583 10.4139C15.1506 11.593 15.1558 12.7721 15.1558 13.9513C15.1558 14.0378 15.1635 14.1219 15.1687 14.2263C15.2332 14.2034 15.272 14.1906 15.3107 14.1754C16.4341 13.6609 17.1004 12.7976 17.2062 11.5854C17.3173 10.3299 16.8085 9.32139 15.7162 8.6567C14.616 7.98693 13.4797 7.37572 12.3615 6.73396C12.2634 6.67793 12.1911 6.67029 12.0878 6.72886C11.6642 6.97335 11.2355 7.21019 10.7733 7.47504ZM4.83875 5.80187C4.72253 5.78659 4.65281 5.84007 4.5805 5.87572C3.51135 6.40544 2.88639 7.26112 2.78826 8.4326C2.68754 9.64736 3.1653 10.6457 4.2112 11.2976C5.332 11.9954 6.50186 12.6193 7.64848 13.2764C7.71563 13.3146 7.77761 13.3477 7.85508 13.3019C8.29927 13.0472 8.74346 12.7925 9.21347 12.5251C9.11533 12.4665 9.04819 12.4232 8.97846 12.3825C7.72854 11.6694 6.4812 10.9538 5.22612 10.2509C4.94463 10.093 4.831 9.88675 4.83358 9.57096C4.84391 8.32054 4.83875 7.06757 4.83875 5.80187ZM8.17273 8.06333C8.28119 8.0073 8.3535 7.97165 8.42323 7.9309C9.66024 7.22801 10.8998 6.53022 12.1291 5.8146C12.4235 5.64398 12.674 5.63888 12.9684 5.80951C14.004 6.41307 15.0473 6.99881 16.088 7.58964C16.15 7.6253 16.2017 7.69151 16.3075 7.66095C16.4444 6.44873 16.0725 5.42496 15.0679 4.69152C14.0246 3.92751 12.8703 3.8231 11.7185 4.42157C10.5615 5.02513 9.44331 5.70255 8.30702 6.34686C8.24246 6.38251 8.17273 6.41307 8.17273 6.5073V8.06333ZM11.8269 10.0676C11.8269 9.71867 11.8192 9.42835 11.8295 9.14057C11.8347 9.00815 11.7908 8.93175 11.672 8.86808C11.1555 8.58285 10.6416 8.28998 10.1328 7.99202C10.0347 7.93345 9.96239 7.93345 9.86167 7.98947C9.35292 8.28743 8.83901 8.5803 8.32251 8.86553C8.20372 8.93175 8.16756 9.00815 8.16756 9.14057C8.17531 9.70848 8.17789 10.2789 8.16756 10.8469C8.16498 11.0022 8.2218 11.0837 8.35608 11.1525C8.60142 11.2772 8.83384 11.4224 9.07401 11.5574C9.37875 11.728 9.68348 12.0362 9.98563 12.0336C10.3007 12.0311 10.6132 11.7305 10.9231 11.5574C11.2201 11.3893 11.61 11.2772 11.7779 11.0251C11.9509 10.7577 11.8089 10.3502 11.8269 10.0676Z" />
|
||||
</svg>
|
After Width: | Height: | Size: 4.3 KiB |
@@ -1,8 +1,6 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1698126616764"
|
||||
class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2488"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg t="1706532590649" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="3146">
|
||||
<path
|
||||
d="M334.25863111 23.36199111c-17.64238222-17.49560889-46.24611555-17.49560889-63.88849778 0-16.46705778 16.32824889-17.56501333 42.12736-3.29386666 59.71854222l3.29386666 3.63747556 419.83772445 416.32199111L270.37013333 919.36199111c-16.46705778 16.32824889-17.56501333 42.12736-3.29386666 59.71854222l3.29386666 3.63747556c16.46592 16.32938667 42.48120889 17.41824 60.22030222 3.26542222l3.66819556-3.26542222 451.76490667-448c16.46592-16.32824889 17.56387555-42.12736 3.29272889-59.71854222l-3.29272889-3.63747556-451.76490667-448z"
|
||||
p-id="2489"></path>
|
||||
d="M236.552013 926.853955a55.805997 55.805997 0 0 0 0 80.454996 59.682997 59.682997 0 0 0 82.794996 0l468.099978-455.081978a55.805997 55.805997 0 0 0 0-80.453996L319.348009 16.689999a59.682997 59.682997 0 0 0-82.794996 0 55.805997 55.805997 0 0 0 0 80.454996L663.401993 511.999975 236.624013 926.853955z"
|
||||
p-id="3147"></path>
|
||||
</svg>
|
Before Width: | Height: | Size: 897 B After Width: | Height: | Size: 483 B |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M18.0527 6.60938C17.6133 5.56055 16.9805 4.61914 16.1758 3.81055C15.3711 3.00391 14.4316 2.36914 13.3828 1.92969C12.3105 1.47852 11.1738 1.25 9.99999 1.25H9.96093C8.77928 1.25586 7.63671 1.49023 6.56053 1.95117C5.52147 2.39648 4.58983 3.0293 3.79296 3.83594C2.99608 4.64258 2.37108 5.58008 1.93749 6.625C1.49022 7.70703 1.26366 8.85742 1.26952 10.041C1.27538 11.3965 1.5996 12.7422 2.20507 13.9453V16.9141C2.20507 17.4102 2.60741 17.8125 3.10155 17.8125H6.06639C7.26757 18.4199 8.60936 18.7441 9.96288 18.75H10.0039C11.1719 18.75 12.3027 18.5234 13.3691 18.0801C14.4121 17.6445 15.3496 17.0195 16.1523 16.2207C16.957 15.4219 17.5898 14.4883 18.0332 13.4473C18.4922 12.3691 18.7265 11.2227 18.7324 10.0391C18.7363 8.84961 18.5058 7.69531 18.0527 6.60938ZM6.10155 10.9375C5.58593 10.9375 5.166 10.5176 5.166 10C5.166 9.48242 5.58593 9.0625 6.10155 9.0625C6.61718 9.0625 7.0371 9.48242 7.0371 10C7.0371 10.5176 6.61913 10.9375 6.10155 10.9375ZM9.99999 10.9375C9.48436 10.9375 9.06444 10.5176 9.06444 10C9.06444 9.48242 9.48436 9.0625 9.99999 9.0625C10.5156 9.0625 10.9355 9.48242 10.9355 10C10.9355 10.5176 10.5156 10.9375 9.99999 10.9375ZM13.8984 10.9375C13.3828 10.9375 12.9629 10.5176 12.9629 10C12.9629 9.48242 13.3828 9.0625 13.8984 9.0625C14.414 9.0625 14.834 9.48242 14.834 10C14.834 10.5176 14.414 10.9375 13.8984 10.9375Z" />
|
||||
<svg viewBox="0 0 25 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M22.8999 12C22.8999 17.5228 18.4227 22 12.8999 22C11.2346 22 9.66436 21.5929 8.28328 20.8729H5.12221C4.45947 20.8729 3.92221 20.3356 3.92221 19.6729V16.4098C3.26757 15.0796 2.89987 13.5827 2.89987 12C2.89987 6.47715 7.37702 2 12.8999 2C18.4227 2 22.8999 6.47715 22.8999 12ZM9.49611 12C9.49611 12.7028 8.92637 13.2726 8.22356 13.2726C7.52075 13.2726 6.951 12.7028 6.951 12C6.951 11.2972 7.52075 10.7275 8.22356 10.7275C8.92637 10.7275 9.49611 11.2972 9.49611 12ZM14.0723 12C14.0723 12.7028 13.5026 13.2726 12.7997 13.2726C12.0969 13.2726 11.5272 12.7028 11.5272 12C11.5272 11.2972 12.0969 10.7275 12.7997 10.7275C13.5026 10.7275 14.0723 11.2972 14.0723 12ZM18.6484 12C18.6484 12.7028 18.0787 13.2726 17.3759 13.2726C16.673 13.2726 16.1033 12.7028 16.1033 12C16.1033 11.2972 16.673 10.7275 17.3759 10.7275C18.0787 10.7275 18.6484 11.2972 18.6484 12Z" />
|
||||
</svg>
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 980 B |
@@ -1,10 +1,10 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
|
||||
<path
|
||||
d="M4.33594 9.99994C4.33594 10.2907 4.45144 10.5695 4.65703 10.7751C4.86263 10.9807 5.14147 11.0962 5.43222 11.0962C5.72297 11.0962 6.00181 10.9807 6.2074 10.7751C6.41299 10.5695 6.52849 10.2907 6.52849 9.99994C6.52849 9.70919 6.41299 9.43035 6.2074 9.22476C6.00181 9.01917 5.72297 8.90367 5.43222 8.90367C5.14147 8.90367 4.86263 9.01917 4.65703 9.22476C4.45144 9.43035 4.33594 9.70919 4.33594 9.99994Z" />
|
||||
<path
|
||||
d="M9.22484 10.7751C9.01925 10.5695 8.90375 10.2907 8.90375 9.99994C8.90375 9.70919 9.01925 9.43035 9.22484 9.22476C9.43044 9.01917 9.70928 8.90367 10 8.90367C10.2908 8.90367 10.5696 9.01917 10.7752 9.22476C10.9808 9.43035 11.0963 9.70919 11.0963 9.99994C11.0963 10.2907 10.9808 10.5695 10.7752 10.7751C10.5696 10.9807 10.2908 11.0962 10 11.0962C9.70928 11.0962 9.43044 10.9807 9.22484 10.7751Z" />
|
||||
<path
|
||||
d="M13.7927 10.7751C13.5871 10.5695 13.4716 10.2907 13.4716 9.99994C13.4716 9.70919 13.5871 9.43035 13.7927 9.22476C13.9982 9.01917 14.2771 8.90367 14.5678 8.90367C14.8586 8.90367 15.1374 9.01917 15.343 9.22476C15.5486 9.43035 15.6641 9.70919 15.6641 9.99994C15.6641 10.2907 15.5486 10.5695 15.343 10.7751C15.1374 10.9807 14.8586 11.0962 14.5678 11.0962C14.2771 11.0962 13.9982 10.9807 13.7927 10.7751Z" />
|
||||
<svg viewBox="0 0 25 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M16.8931 3.107C17.7914 4.00751 18.4962 5.05592 18.9877 6.22397C19.4946 7.43334 19.7512 8.71885 19.7447 10.0435C19.7382 11.3616 19.4772 12.6384 18.9638 13.8391C18.4701 14.9985 17.7631 16.0382 16.8648 16.9278C15.9687 17.8174 14.9224 18.5135 13.7587 18.9985C12.5689 19.4923 11.3052 19.7446 10.0023 19.7446H9.95659C8.44705 19.7381 6.94838 19.377 5.6085 18.7005H2.30012C1.74764 18.7005 1.29956 18.2525 1.29956 17.7V14.3938C0.623092 13.0539 0.26202 11.5552 0.255494 10.0457C0.248969 8.72755 0.501285 7.44639 1.00157 6.24137C1.48445 5.07767 2.18266 4.03361 3.07229 3.13528C3.96192 2.23695 5.00164 1.53221 6.16098 1.03627C7.36166 0.522943 8.63846 0.261927 9.95659 0.255402H10.0001C11.3095 0.255402 12.5798 0.509892 13.7761 1.01235C14.9463 1.50175 15.9948 2.20867 16.8931 3.107ZM10.0001 18.0915C12.1535 18.0915 14.1764 17.2606 15.7011 15.7511C17.2324 14.2328 18.0829 12.2034 18.0959 10.037C18.1003 8.93636 17.8893 7.87054 17.4673 6.86563C17.0606 5.89552 16.4733 5.02329 15.7272 4.27722C14.979 3.52898 14.1089 2.94387 13.1388 2.53712C12.1448 2.11949 11.0898 1.9085 10.0023 1.9085H9.96529C7.79668 1.9172 5.76728 2.76551 4.24904 4.29897C2.72862 5.83244 1.8999 7.86837 1.9086 10.037C1.91512 11.3486 2.24139 12.6515 2.85478 13.8021L2.95266 13.9848V17.0474H6.01525L6.19796 17.1453C7.34861 17.7587 8.65151 18.085 9.96312 18.0915H10.0001Z" />
|
||||
d="M5.92221 15.9443V18.8729H8.77335L9.2079 19.0995C10.3103 19.6742 11.5641 20 12.8999 20C17.3181 20 20.8999 16.4183 20.8999 12C20.8999 7.58172 17.3181 4 12.8999 4C8.48159 4 4.89987 7.58172 4.89987 12C4.89987 13.2698 5.19426 14.4652 5.71668 15.5267L5.92221 15.9443ZM22.8999 12C22.8999 17.5228 18.4227 22 12.8999 22C11.2346 22 9.66436 21.5929 8.28328 20.8729H5.12221C4.45947 20.8729 3.92221 20.3356 3.92221 19.6729V16.4098C3.26757 15.0796 2.89987 13.5827 2.89987 12C2.89987 6.47715 7.37702 2 12.8999 2C18.4227 2 22.8999 6.47715 22.8999 12Z" />
|
||||
<path
|
||||
d="M9.49611 12C9.49611 12.7028 8.92637 13.2726 8.22356 13.2726C7.52075 13.2726 6.951 12.7028 6.951 12C6.951 11.2972 7.52075 10.7275 8.22356 10.7275C8.92637 10.7275 9.49611 11.2972 9.49611 12Z" />
|
||||
<path
|
||||
d="M14.0723 12C14.0723 12.7028 13.5026 13.2726 12.7997 13.2726C12.0969 13.2726 11.5272 12.7028 11.5272 12C11.5272 11.2972 12.0969 10.7275 12.7997 10.7275C13.5026 10.7275 14.0723 11.2972 14.0723 12Z" />
|
||||
<path
|
||||
d="M17.3759 13.2726C18.0787 13.2726 18.6484 12.7028 18.6484 12C18.6484 11.2972 18.0787 10.7275 17.3759 10.7275C16.673 10.7275 16.1033 11.2972 16.1033 12C16.1033 12.7028 16.673 13.2726 17.3759 13.2726Z" />
|
||||
</svg>
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -1 +0,0 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1686042262954" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3245" xmlns:xlink="http://www.w3.org/1999/xlink" ><path d="M510.1 928h5.5c52.6-0.7 96.7-38.4 103.3-88.5H406.8c6.6 50.1 50.7 87.9 103.3 88.5zM771.7 598.5V410.9c0.6-105.3-70.9-197-172.2-220.8v-4.5c0.8-31.7-15.5-61.4-42.5-77.6-27.1-16.1-60.6-16.1-87.7 0s-43.3 45.8-42.5 77.6v4.5C325.2 213.7 253.4 305.5 254 410.9v187.6c-51.9 41.3-83.2 103.5-85.9 170.2h689.5c-2.6-66.7-34-128.9-85.9-170.2z" p-id="3246"></path></svg>
|
Before Width: | Height: | Size: 663 B |
117
packages/web/components/common/Icon/icons/price/bg.svg
Normal file
@@ -0,0 +1,117 @@
|
||||
<svg viewBox="0 0 1440 3888" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_1529_3242)">
|
||||
<rect x="986.26" y="510.279" width="483.77" height="363.42" rx="13.9824" transform="rotate(15 986.26 510.279)"
|
||||
stroke="url(#paint0_linear_1529_3242)" stroke-width="0.717048" />
|
||||
<rect x="923.499" y="886.439" width="483.77" height="363.42" rx="13.9824" transform="rotate(15 923.499 886.439)"
|
||||
stroke="url(#paint1_linear_1529_3242)" stroke-width="0.717048" />
|
||||
<rect x="1088.08" y="130.271" width="483.77" height="363.42" rx="13.9824" transform="rotate(15 1088.08 130.271)"
|
||||
stroke="url(#paint2_linear_1529_3242)" stroke-width="0.717048" />
|
||||
<rect x="416.019" y="653.422" width="483.77" height="363.42" rx="13.9824" transform="rotate(15 416.019 653.422)"
|
||||
stroke="url(#paint3_linear_1529_3242)" stroke-width="0.717048" />
|
||||
<rect x="349.499" y="978.437" width="483.77" height="363.42" rx="13.9824" transform="rotate(15 349.499 978.437)"
|
||||
stroke="url(#paint4_linear_1529_3242)" stroke-width="0.717048" />
|
||||
<rect x="517.841" y="273.416" width="483.77" height="363.42" rx="13.9824" transform="rotate(15 517.841 273.416)"
|
||||
stroke="url(#paint5_linear_1529_3242)" stroke-width="0.717048" />
|
||||
<rect x="619.664" y="-106.592" width="483.77" height="341.137" rx="13.9824"
|
||||
transform="rotate(15 619.664 -106.592)" stroke="url(#paint6_linear_1529_3242)" stroke-width="0.717048" />
|
||||
<rect x="-125.501" y="689.381" width="483.77" height="363.42" rx="13.9824"
|
||||
transform="rotate(15 -125.501 689.381)" stroke="url(#paint7_linear_1529_3242)" stroke-width="0.717048" />
|
||||
<rect x="-23.6781" y="309.373" width="483.77" height="363.42" rx="13.9824"
|
||||
transform="rotate(15 -23.6781 309.373)" stroke="url(#paint8_linear_1529_3242)" stroke-width="0.717048" />
|
||||
<rect x="78.1443" y="-70.6332" width="483.77" height="363.42" rx="13.9824"
|
||||
transform="rotate(15 78.1443 -70.6332)" stroke="url(#paint9_linear_1529_3242)" stroke-width="0.717048" />
|
||||
<g filter="url(#filter0_f_1529_3242)">
|
||||
<path
|
||||
d="M1299.4 236.263C1273.92 -58.7703 1292.79 -316.494 1659.87 -519.399L2251.84 551.545L1045.21 1218.52C1022.06 1228.14 991.901 1180.45 1030.53 1003.12C1078.82 781.445 1324.88 531.296 1299.4 236.263Z"
|
||||
fill="url(#paint10_linear_1529_3242)" fill-opacity="0.35" />
|
||||
</g>
|
||||
<g filter="url(#filter1_f_1529_3242)">
|
||||
<path
|
||||
d="M1114.05 72.4481C1088.57 -222.585 1393.67 -224.671 1760.75 -427.575L1615.29 697.061C1615.29 697.061 1499.66 1026.83 992.597 1317.14C943.478 1345.26 752.396 1398.55 495.322 1448.95C461.43 1481.9 423.174 1517.54 379.994 1556.11C276.748 1648.32 23.0323 1890.35 0.935006 2092.17C-36.7924 2436.75 -452.753 1780.5 -340.95 2006.57C-170.001 2352.24 -248.22 2754.86 -923.871 1975.75C-1249 1600.83 -1648.1 1384.37 -1817.79 1305.74C-1938.02 1260.94 -1917.51 1259.55 -1817.79 1305.74C-1717.43 1343.14 -1519 1410.79 -1186.7 1506.26C-745.377 1633.05 -1.69338 1546.39 495.322 1448.95C694.196 1255.58 742.848 1154.8 754.831 1099.79C803.117 878.115 1139.53 367.481 1114.05 72.4481Z"
|
||||
fill="url(#paint11_linear_1529_3242)" fill-opacity="0.4" />
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_f_1529_3242" x="829.097" y="-702.298" width="1605.64" height="2104.89"
|
||||
filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
||||
<feGaussianBlur stdDeviation="91.45" result="effect1_foregroundBlur_1529_3242" />
|
||||
</filter>
|
||||
<filter id="filter1_f_1529_3242" x="-2083.35" y="-610.476" width="4026.99" height="3217.24"
|
||||
filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
||||
<feGaussianBlur stdDeviation="91.45" result="effect1_foregroundBlur_1529_3242" />
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear_1529_3242" x1="1228.25" y1="509.84" x2="1228.25" y2="873.977"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#336FFF" stop-opacity="0.2" />
|
||||
<stop offset="1" stop-color="#336FFF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_1529_3242" x1="1165.49" y1="886" x2="1165.49" y2="1250.14"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#336FFF" stop-opacity="0.2" />
|
||||
<stop offset="1" stop-color="#336FFF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_1529_3242" x1="1330.07" y1="129.832" x2="1330.07" y2="493.969"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#336FFF" stop-opacity="0.2" />
|
||||
<stop offset="1" stop-color="#336FFF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint3_linear_1529_3242" x1="658.009" y1="652.982" x2="658.009" y2="1017.12"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#336FFF" stop-opacity="0.1" />
|
||||
<stop offset="1" stop-color="#336FFF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint4_linear_1529_3242" x1="591.489" y1="977.998" x2="641.285" y2="1265.2"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#336FFF" stop-opacity="0.2" />
|
||||
<stop offset="1" stop-color="#336FFF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint5_linear_1529_3242" x1="759.831" y1="272.977" x2="759.831" y2="637.113"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#336FFF" stop-opacity="0.1" />
|
||||
<stop offset="1" stop-color="#336FFF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint6_linear_1529_3242" x1="861.654" y1="-107.031" x2="861.654" y2="234.823"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#336FFF" stop-opacity="0.2" />
|
||||
<stop offset="1" stop-color="#336FFF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint7_linear_1529_3242" x1="116.489" y1="688.941" x2="162.837" y2="1231.8"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#336FFF" stop-opacity="0.2" />
|
||||
<stop offset="1" stop-color="#336FFF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint8_linear_1529_3242" x1="218.312" y1="308.934" x2="218.312" y2="673.07"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#336FFF" stop-opacity="0.15" />
|
||||
<stop offset="1" stop-color="#336FFF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint9_linear_1529_3242" x1="253.832" y1="-102.612" x2="344.766" y2="364.261"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#336FFF" stop-opacity="0.2" />
|
||||
<stop offset="1" stop-color="#336FFF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint10_linear_1529_3242" x1="1156.96" y1="-159.622" x2="1812.4" y2="131.08"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.153575" stop-color="#CAECFF" stop-opacity="0.9" />
|
||||
<stop offset="0.4375" stop-color="#ACBEFF" />
|
||||
<stop offset="0.703125" stop-color="#618DFF" />
|
||||
<stop offset="0.833333" stop-color="#628EFF" />
|
||||
<stop offset="1" stop-color="#0058FF" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint11_linear_1529_3242" x1="1257.84" y1="-67.7694" x2="1913.28" y2="222.933"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.153575" stop-color="#CAD9FF" stop-opacity="0.9" />
|
||||
<stop offset="0.4375" stop-color="#ACC8FF" />
|
||||
<stop offset="0.703125" stop-color="#61A0FF" />
|
||||
<stop offset="0.833333" stop-color="#3B7DFF" />
|
||||
<stop offset="1" stop-color="#0058FF" />
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_1529_3242">
|
||||
<rect width="1440" height="3888" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 8.2 KiB |
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M12.6262 3.29289C13.0167 2.90237 13.6499 2.90237 14.0404 3.29289C14.4309 3.68342 14.4309 4.31658 14.0404 4.70711L6.70707 12.0404C6.31654 12.431 5.68338 12.431 5.29285 12.0404L1.95952 8.70711C1.56899 8.31658 1.56899 7.68342 1.95952 7.29289C2.35004 6.90237 2.98321 6.90237 3.37373 7.29289L5.99996 9.91912L12.6262 3.29289Z"
|
||||
fill="#3370FF" />
|
||||
</svg>
|
After Width: | Height: | Size: 475 B |
@@ -1,12 +1,4 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689855121257"
|
||||
class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3135"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64">
|
||||
<path
|
||||
d="M952.7 492.1c-1.4-1.8-3.1-3.4-4.8-4.9l-179-178.9c-12.5-12.5-32.9-12.5-45.4 0s-12.5 32.9 0 45.4l126 126H421.3h-0.1c-18.2 0-32.9 14.8-32.9 33s14.7 33 32.9 33c0.3 0.1 0.5 0 0.7 0h427.8l-126 126c-12.3 12.3-12.3 32.4 0 44.7l0.7 0.7c12.3 12.3 32.4 12.3 44.7 0l182-182c11.7-11.7 12.3-30.6 1.6-43z"
|
||||
p-id="3136"></path>
|
||||
<path
|
||||
d="M562.3 799c-18 0-32.7 14.7-32.7 32.7v63.8H129.2V128.7h400.4v63.1c0 18 14.7 32.7 32.7 32.7s32.7-14.7 32.7-32.7V96.3c0-3.5-0.6-6.8-1.6-10-4.2-13.3-16.6-23-31.2-23H96.6c-18 0-32.7 14.7-32.7 32.7v831.9c0 14.2 9.2 26.3 21.8 30.8 3.6 1.4 7.5 2.1 11.5 2.1h463.2c0.6 0 1.3 0.1 1.9 0.1 18 0 32.7-14.7 32.7-32.7v-96.5c0-18-14.7-32.7-32.7-32.7z"
|
||||
p-id="3137"></path>
|
||||
<path d="M256.8 512.7a32.9 33 0 1 0 65.8 0 32.9 33 0 1 0-65.8 0Z" p-id="3138"></path>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M8.01482 3.38955C7.82959 3.33992 7.57875 3.33276 6.75012 3.33276H6.33346C5.73963 3.33276 5.33599 3.33321 5.02229 3.35462C4.71608 3.37551 4.5569 3.41355 4.44565 3.45963C4.03727 3.62879 3.71281 3.95324 3.54366 4.36162C3.49758 4.47287 3.45954 4.63205 3.43864 4.93827C3.41724 5.25196 3.41679 5.6556 3.41679 6.24943V13.7494C3.41679 14.3433 3.41724 14.7469 3.43864 15.0606C3.45954 15.3668 3.49758 15.526 3.54366 15.6372C3.71281 16.0456 4.03727 16.3701 4.44565 16.5392C4.5569 16.5853 4.71608 16.6234 5.02229 16.6442C5.33599 16.6656 5.73963 16.6661 6.33346 16.6661H6.75012C7.57875 16.6661 7.82959 16.6589 8.01482 16.6093C8.58997 16.4552 9.03922 16.0059 9.19333 15.4308C9.24297 15.2456 9.25012 14.9947 9.25012 14.1661C9.25012 13.7059 9.62322 13.3328 10.0835 13.3328C10.5437 13.3328 10.9168 13.7059 10.9168 14.1661C10.9168 14.2049 10.9168 14.2431 10.9168 14.2807C10.9172 14.9436 10.9175 15.4358 10.8032 15.8622C10.495 17.0125 9.59649 17.911 8.44619 18.2192C8.01981 18.3334 7.52759 18.3332 6.86477 18.3328C6.82711 18.3328 6.7889 18.3328 6.75012 18.3328H6.30489C5.74674 18.3328 5.28601 18.3328 4.90884 18.307C4.51777 18.2804 4.15602 18.2232 3.80784 18.079C2.99108 17.7407 2.34217 17.0918 2.00386 16.275C1.85964 15.9269 1.80253 15.5651 1.77584 15.174C1.75011 14.7969 1.75011 14.3361 1.75012 13.778V6.22087C1.75011 5.66271 1.75011 5.20199 1.77584 4.82481C1.80253 4.43374 1.85964 4.072 2.00386 3.72382C2.34217 2.90706 2.99108 2.25814 3.80785 1.91983C4.15602 1.77561 4.51777 1.7185 4.90884 1.69182C5.28601 1.66608 5.74674 1.66609 6.3049 1.6661L6.75012 1.6661C6.7889 1.6661 6.82711 1.66608 6.86477 1.66605C7.52759 1.6657 8.01981 1.66543 8.44619 1.77968C9.59649 2.0879 10.495 2.98639 10.8032 4.1367C10.9175 4.56308 10.9172 5.05529 10.9168 5.71812C10.9168 5.75577 10.9168 5.79398 10.9168 5.83276C10.9168 6.293 10.5437 6.6661 10.0835 6.6661C9.62322 6.6661 9.25012 6.293 9.25012 5.83276C9.25012 5.00414 9.24297 4.7533 9.19333 4.56806C9.03922 3.99291 8.58997 3.54366 8.01482 3.38955ZM12.8275 5.24351C13.153 4.91807 13.6806 4.91807 14.006 5.24351L18.1727 9.41017C18.4981 9.73561 18.4981 10.2632 18.1727 10.5887L14.006 14.7554C13.6806 15.0808 13.153 15.0808 12.8275 14.7554C12.5021 14.4299 12.5021 13.9023 12.8275 13.5768L15.5716 10.8328H7.58346C7.12322 10.8328 6.75012 10.4597 6.75012 9.99943C6.75012 9.53919 7.12322 9.1661 7.58346 9.1661H15.5716L12.8275 6.42202C12.5021 6.09658 12.5021 5.56894 12.8275 5.24351Z" />
|
||||
</svg>
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -1,8 +1,4 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1692522401431"
|
||||
class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4063"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64">
|
||||
<path
|
||||
d="M855 789.1V127.4L633 274.9H169V641h81l59.5 255.7H508L448.4 641H633l222 148.1z m-46-86l-146-97.5V310.2l146-97v489.9zM450 850.6H346L297.1 641h104L450 850.6zM239.2 595H215V320.9h274V595H239.2z m377.8 0h-82V320.9h82V595z"
|
||||
p-id="4064"></path>
|
||||
<svg viewBox="0 0 25 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M10.6384 16.3732C11.2306 16.5173 11.9363 16.7115 12.6926 16.9659C13.5196 17.244 14.6811 17.9124 15.8432 18.6649C17.6619 19.8426 20.1813 18.5988 20.1813 16.432V14.8615L20.1827 14.8612C22.1663 14.5419 23.6814 12.8221 23.6814 10.7484C23.6814 8.67481 22.1663 6.95503 20.1827 6.63568L20.1813 6.63544V4.7671C20.1813 2.60038 17.6619 1.35653 15.8432 2.53423C14.6811 3.2867 13.5196 3.95512 12.6926 4.23327C10.6129 4.9328 8.91564 5.1769 8.91131 5.17752H7.68889C4.61216 5.17752 2.11798 7.6717 2.11798 10.7484C2.11798 11.9271 2.48405 13.0203 3.1087 13.9206L4.49432 19.5478C4.8373 20.9407 6.08663 21.9198 7.52117 21.9198C9.24278 21.9198 10.6384 20.5241 10.6384 18.8025V16.3732ZM10.9113 14.382V6.81714C11.5882 6.65775 12.4243 6.43362 13.3303 6.1289C14.4213 5.76192 15.7712 4.96352 16.9303 4.213C17.1863 4.0472 17.5065 4.03671 17.7898 4.18034C18.0617 4.31816 18.1813 4.52981 18.1813 4.7671V16.432C18.1813 16.6693 18.0617 16.881 17.7898 17.0188C17.5065 17.1624 17.1863 17.1519 16.9303 16.9861C15.7712 16.2356 14.4213 15.4372 13.3303 15.0702C12.4243 14.7655 11.5882 14.5414 10.9113 14.382ZM7.68889 7.17752H8.90769V14.3193H7.68889C5.71673 14.3193 4.11798 12.7206 4.11798 10.7484C4.11798 8.77627 5.71673 7.17752 7.68889 7.17752ZM21.6814 10.7484C21.6814 11.7118 21.0524 12.5283 20.1827 12.8096V8.68726C21.0524 8.96861 21.6814 9.78508 21.6814 10.7484ZM7.11205 16.3228C7.59186 16.3733 8.13329 16.3912 8.63843 16.3935V18.8025C8.63843 19.4195 8.13822 19.9198 7.52117 19.9198C7.00701 19.9198 6.55924 19.5689 6.43631 19.0696L5.70405 16.0958C6.21698 16.1962 6.71579 16.2811 7.11205 16.3228Z" />
|
||||
</svg>
|
Before Width: | Height: | Size: 605 B After Width: | Height: | Size: 1.7 KiB |
@@ -1 +1,4 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689854058748" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3614" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M803.84 934.4H238.08c-52.736 0-96.256-43.008-96.256-96.256V165.376c0-52.736 43.008-96.256 96.256-96.256H803.84c52.736 0 96.256 43.008 96.256 96.256v673.28c0 52.736-43.52 95.744-96.256 95.744zM232.96 128c-17.408 0-32.256 14.336-32.256 32.256v683.52c0 17.408 14.336 32.256 32.256 32.256H808.96c17.408 0 32.256-14.336 32.256-32.256V160.256c0-17.408-14.336-32.256-32.256-32.256H232.96z m256 646.656c-8.192 0-15.872-3.072-22.528-9.728l-48.128-46.592-24.064 15.872c-4.608 4.608-11.264 6.656-17.408 6.656h-48.128c-22.016-5.12-31.744-13.312-31.744-27.136 0-17.408 9.216-32.256 31.744-32.256h38.4l36.864-30.72c12.8-9.728 30.208-8.192 41.472 3.072l48.128 46.592 25.6-17.408c4.608-3.072 11.264-6.656 17.408-6.656h79.872c17.408 0 32.256 14.336 32.256 32.256 0 17.408-14.336 32.256-32.256 32.256h-70.656l-39.936 27.136c-4.096 5.12-10.24 6.656-16.896 6.656z" p-id="3615"></path><path d="M718.336 385.536H316.416c-16.384 0-29.184-13.312-29.184-29.184 0-16.384 13.312-29.184 29.184-29.184h401.92c16.384 0 29.184 13.312 29.184 29.184 0.512 15.872-12.8 29.184-29.184 29.184zM718.336 535.04H316.416c-16.384 0-29.184-13.312-29.184-29.184 0-16.384 13.312-29.696 29.184-29.696h401.92c16.384 0 29.184 13.312 29.184 29.696 0.512 16.384-12.8 29.184-29.184 29.184z" p-id="3616"></path></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M4.75002 1.14193C4.75002 0.68169 5.12312 0.308594 5.58335 0.308594C6.04359 0.308594 6.41669 0.68169 6.41669 1.14193V2.40915H11.3834V1.14193C11.3834 0.68169 11.7565 0.308594 12.2167 0.308594C12.6769 0.308594 13.05 0.68169 13.05 1.14193V2.41071C14.3274 2.41867 15.0523 2.46742 15.6264 2.76567C16.2048 3.06611 16.6764 3.53769 16.9768 4.11607C17.3334 4.8024 17.3334 5.7041 17.3334 7.50748V12.2355C17.3334 14.0388 17.3334 14.9405 16.9768 15.6269C16.6764 16.2052 16.2048 16.6768 15.6264 16.9773C14.9401 17.3338 14.0384 17.3338 12.235 17.3338H5.76502C3.96163 17.3338 3.05994 17.3338 2.3736 16.9773C1.79523 16.6768 1.32365 16.2052 1.02321 15.6269C0.666687 14.9405 0.666687 14.0388 0.666687 12.2355V7.50749C0.666687 5.7041 0.666687 4.8024 1.02321 4.11607C1.32365 3.53769 1.79523 3.06611 2.3736 2.76567C2.9171 2.48335 3.59563 2.42459 4.75002 2.41236V1.14193ZM11.3834 4.07582V4.82666C11.3834 5.2869 11.7565 5.66 12.2167 5.66C12.6769 5.66 13.05 5.2869 13.05 4.82666V4.07749C13.5405 4.0806 13.9085 4.08948 14.2117 4.11467C14.6434 4.15052 14.7925 4.21061 14.8581 4.2447C15.1321 4.38701 15.3555 4.61039 15.4978 4.88436C15.5319 4.94998 15.592 5.0991 15.6278 5.53082C15.6653 5.98248 15.6667 6.57782 15.6667 7.50748V12.2355C15.6667 13.1651 15.6653 13.7605 15.6278 14.2121C15.592 14.6438 15.5319 14.793 15.4978 14.8586C15.3555 15.1326 15.1321 15.3559 14.8581 15.4982C14.7925 15.5323 14.6434 15.5924 14.2117 15.6283C13.76 15.6658 13.1647 15.6671 12.235 15.6671H5.76502C4.83535 15.6671 4.24001 15.6658 3.78835 15.6283C3.35664 15.5924 3.20751 15.5323 3.14189 15.4982C2.86793 15.3559 2.64455 15.1326 2.50223 14.8586C2.46815 14.793 2.40805 14.6438 2.3722 14.2121C2.33469 13.7605 2.33335 13.1651 2.33335 12.2355V7.50749C2.33335 6.57782 2.33469 5.98248 2.3722 5.53082C2.40805 5.0991 2.46815 4.94998 2.50223 4.88436C2.64455 4.61039 2.86793 4.38701 3.14189 4.2447C3.20751 4.21061 3.35664 4.15052 3.78835 4.11467C4.0489 4.09303 4.35726 4.08343 4.75002 4.07918V4.82666C4.75002 5.2869 5.12312 5.66 5.58335 5.66C6.04359 5.66 6.41669 5.2869 6.41669 4.82666V4.07582H11.3834ZM13.5842 8.16705C14.0445 8.16705 14.4176 8.54014 14.4176 9.00038C14.4176 9.46062 14.0445 9.83372 13.5842 9.83372H10.4014C9.94119 9.83372 9.56809 9.46062 9.56809 9.00038C9.56809 8.54014 9.94119 8.16705 10.4014 8.16705H13.5842ZM14.4176 12.4356C14.4176 11.9754 14.0445 11.6023 13.5842 11.6023H5.63052C5.17029 11.6023 4.79719 11.9754 4.79719 12.4356C4.79719 12.8958 5.17029 13.2689 5.63052 13.2689H13.5842C14.0445 13.2689 14.4176 12.8958 14.4176 12.4356Z" />
|
||||
</svg>
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -1 +1,8 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1686969412308" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3481" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M517.864056 487.834624c-56.774051-54.213739-58.850339-144.187937-4.6366-200.960964 54.212716-56.773028 144.187937-58.849316 200.960964-4.6366 56.775074 54.213739 58.850339 144.186913 4.6366 200.960964C664.613328 539.972075 574.639131 542.048363 517.864056 487.834624zM687.194626 452.994118c37.533848-39.308261 36.09508-101.596909-3.210112-139.128711-39.304168-37.531801-101.593839-36.094056-139.127687 3.211135-37.532825 39.307238-36.093033 101.593839 3.212158 139.125641C587.374176 493.736031 649.660778 492.302379 687.194626 452.994118zM479.104287 670.917406l-101.495602 106.289792c26.206872 25.024953 27.167756 66.540486 2.14178 92.749404-25.028023 26.209942-66.543555 27.16571-92.750427 2.140757l-58.361199 53.027727c0 0-68.750827 11.100826-100.379175-19.101033-31.630395-30.205952-37.865399-112.721271-37.865399-112.721271l246.37427-258.302951c-63.173808-117.608581-47.24707-267.162736 49.939389-368.939747 36.517705-38.242999 80.346933-65.156976 127.165238-81.040734l1.084705 46.269813c-35.443233 14.07967-68.566632 35.596729-96.618525 64.973804-80.271208 84.064604-96.099708 205.865671-49.433876 305.083393l23.075555 39.163975L146.090774 798.015106c0 0 0.593518 49.77873 17.242709 65.677838 14.888082 14.216793 61.832254 9.828856 61.832254 9.828856l60.407812-63.260789 31.631418 30.203906c8.741082 8.346085 22.570042 8.030907 30.91715-0.711198 8.347109-8.742105 8.026814-22.571065-0.713244-30.91715l-31.632441-30.207999 156.456355-163.846672 39.009456 22.481014c101.259218 42.039465 222.201731 20.61041 302.474986-63.453171 104.251366-109.178585 100.260471-282.211477-8.91709-386.464889-33.591049-32.075533-73.260537-53.829999-115.093295-65.49262l-1.030469-45.153386c53.197596 12.471033 103.945397 38.547944 146.323577 79.015611 126.645398 120.931257 131.277906 321.649698 10.344602 448.296119C748.158093 705.787588 599.500355 728.598106 479.104287 670.917406z" p-id="3482"></path></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M12.2109 12.3945C14.7199 12.3945 16.75 10.3639 16.75 7.8636C16.75 5.36333 14.7199 3.33268 12.2109 3.33268C9.70193 3.33268 7.67177 5.36333 7.67177 7.8636C7.67177 8.28211 7.72817 8.68482 7.83285 9.06581C8.02882 9.77912 7.86557 10.6064 7.27775 11.1959L3.33532 15.1497L3.33531 16.666H5.02967L5.07424 16.6215L5.52315 18.2969C5.43021 18.3205 5.33398 18.3327 5.23648 18.3327H2.66864C2.11635 18.3327 1.66864 17.885 1.66864 17.3327L1.66865 14.943C1.66865 14.6342 1.79111 14.3379 2.00918 14.1192L6.09755 10.0191C6.23063 9.88562 6.27567 9.6891 6.22574 9.50736C6.08191 8.98387 6.00511 8.43269 6.00511 7.8636C6.00511 4.44077 8.78354 1.66602 12.2109 1.66602C15.6383 1.66602 18.4167 4.44077 18.4167 7.8636C18.4167 11.2864 15.6383 14.0612 12.2109 14.0612C11.651 14.0612 11.1084 13.9871 10.5923 13.8483C10.4113 13.7996 10.216 13.8449 10.0833 13.9774L8.90842 15.1498L7.72991 13.9713L8.90598 12.7977C9.49218 12.2127 10.3143 12.0475 11.0254 12.2389C11.4015 12.34 11.7985 12.3945 12.2109 12.3945Z" />
|
||||
<path
|
||||
d="M6.13784 16.7874H6.85411C7.26832 16.7874 7.60417 16.4516 7.60417 16.0374L7.60411 16.0283V15.3211H8.43437C8.84858 15.3211 9.18437 14.9853 9.18437 14.5711C9.18437 14.1569 8.84858 13.8211 8.43437 13.8211H6.96804C6.94888 13.8211 6.92989 13.8218 6.9111 13.8232C6.89229 13.8218 6.87328 13.8211 6.85411 13.8211C6.4399 13.8211 6.10411 14.1569 6.10411 14.5711V15.2874H5.38784C4.97363 15.2874 4.63784 15.6232 4.63784 16.0374V17.569C4.63784 17.9832 4.97363 18.319 5.38784 18.319C5.80206 18.319 6.13784 17.9832 6.13784 17.569V16.7874Z" />
|
||||
<path
|
||||
d="M14.4642 7.1898C14.4642 8.11027 13.718 8.85647 12.7975 8.85647C11.877 8.85647 11.1308 8.11027 11.1308 7.1898C11.1308 6.26932 11.877 5.52313 12.7975 5.52313C13.718 5.52313 14.4642 6.26932 14.4642 7.1898Z" />
|
||||
</svg>
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,41 @@
|
||||
<svg width="152" height="152" viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="76" cy="76.0002" r="46.9163" stroke="url(#paint0_linear_1705_316)" stroke-opacity="0.1" />
|
||||
<circle cx="76" cy="75.9996" r="62.7749" stroke="url(#paint1_linear_1705_316)" stroke-opacity="0.05"
|
||||
stroke-width="0.955398" />
|
||||
<circle cx="76" cy="75.9996" r="74.9694" stroke="url(#paint2_linear_1705_316)" stroke-opacity="0.05" />
|
||||
<g filter="url(#filter0_d_1705_316)">
|
||||
<rect x="48" y="48" width="56" height="56" rx="28" fill="#F0F4FF" />
|
||||
<rect x="48.75" y="48.75" width="54.5" height="54.5" rx="27.25" stroke="#3370FF" stroke-width="1.5" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M68.8906 69.7C68.9087 69.7377 68.9665 69.8278 69.1409 69.965C69.4263 70.1895 69.9013 70.4354 70.5774 70.6603C71.9192 71.1068 73.8365 71.4 76 71.4C78.1635 71.4 80.0807 71.1068 81.4225 70.6603C82.0986 70.4354 82.5736 70.1895 82.859 69.965C83.0334 69.8278 83.0913 69.7377 83.1093 69.7C83.0913 69.6623 83.0334 69.5722 82.859 69.435C82.5736 69.2105 82.0986 68.9646 81.4225 68.7397C80.0807 68.2932 78.1635 68 76 68C73.8365 68 71.9192 68.2932 70.5774 68.7397C69.9013 68.9646 69.4263 69.2105 69.1409 69.435C68.9665 69.5722 68.9087 69.6623 68.8906 69.7ZM83.115 72.1339C82.786 72.2924 82.4288 72.4333 82.0539 72.558C80.4586 73.0888 78.3183 73.4 76 73.4C73.6816 73.4 71.5413 73.0888 69.946 72.558C69.5712 72.4333 69.214 72.2924 68.8849 72.1339V75.9882C68.8932 76.0127 68.938 76.1087 69.1392 76.2678C69.4221 76.4915 69.8939 76.7369 70.5679 76.9615C71.9056 77.4073 73.8224 77.7 76 77.7C78.1775 77.7 80.0944 77.4073 81.432 76.9615C82.106 76.7369 82.5778 76.4915 82.8607 76.2678C83.0619 76.1087 83.1067 76.0127 83.115 75.9882V72.1339ZM83.115 78.4386C82.789 78.5957 82.4354 78.7353 82.0643 78.859C80.4715 79.3897 78.3308 79.7 76 79.7C73.6692 79.7 71.5284 79.3897 69.9356 78.859C69.5645 78.7353 69.2109 78.5957 68.8849 78.4386V82.2882C68.8932 82.3127 68.938 82.4087 69.1392 82.5678C69.4221 82.7915 69.8939 83.0369 70.5679 83.2615C71.9056 83.7073 73.8224 84 76 84C78.1775 84 80.0944 83.7073 81.432 83.2615C82.106 83.0369 82.5778 82.7915 82.8607 82.5678C83.0619 82.4087 83.1067 82.3127 83.115 82.2882V78.4386ZM85.115 82.3C85.115 83.1087 84.6255 83.7219 84.1014 84.1365C83.5671 84.5591 82.8555 84.8953 82.0643 85.159C80.4715 85.6897 78.3308 86 76 86C73.6692 86 71.5284 85.6897 69.9356 85.159C69.1444 84.8953 68.4328 84.5591 67.8985 84.1365C67.3744 83.7219 66.8849 83.1087 66.8849 82.3V69.7C66.8849 68.8887 67.3799 68.2756 67.9043 67.8631C68.4402 67.4415 69.1536 67.1056 69.946 66.842C71.5413 66.3112 73.6816 66 76 66C78.3183 66 80.4586 66.3112 82.0539 66.842C82.8463 67.1056 83.5597 67.4415 84.0956 67.8631C84.62 68.2756 85.115 68.8887 85.115 69.7V82.3Z"
|
||||
fill="#3370FF" />
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_d_1705_316" x="44.75" y="44.75" width="62.5" height="62.5" filterUnits="userSpaceOnUse"
|
||||
color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha" />
|
||||
<feMorphology radius="3.25" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_1705_316" />
|
||||
<feOffset />
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0.2 0 0 0 0 0.439216 0 0 0 0 1 0 0 0 0.15 0" />
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1705_316" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1705_316" result="shape" />
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear_1705_316" x1="28.5837" y1="76.0002" x2="123.416" y2="76.0002"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3370FF" />
|
||||
<stop offset="1" stop-color="#3370FF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_1705_316" x1="131.526" y1="59.1487" x2="27.8803" y2="115.987"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3370FF" />
|
||||
<stop offset="1" stop-color="#3370FF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_1705_316" x1="40.4844" y1="145.317" x2="134.681" y2="27.5716"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3370FF" />
|
||||
<stop offset="1" stop-color="#3370FF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
@@ -0,0 +1,36 @@
|
||||
<svg width="152" height="152" viewBox="0 0 152 152" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="76" cy="76.0002" r="46.9163" stroke="url(#paint0_linear_1705_318)" stroke-opacity="0.1"/>
|
||||
<circle cx="76" cy="75.9996" r="62.7749" stroke="url(#paint1_linear_1705_318)" stroke-opacity="0.05" stroke-width="0.955398"/>
|
||||
<circle cx="76" cy="75.9996" r="74.9694" stroke="url(#paint2_linear_1705_318)" stroke-opacity="0.05"/>
|
||||
<g filter="url(#filter0_d_1705_318)">
|
||||
<rect x="48" y="48" width="56" height="56" rx="28" fill="#F0F4FF"/>
|
||||
<rect x="48.75" y="48.75" width="54.5" height="54.5" rx="27.25" stroke="#3370FF" stroke-width="1.5"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M69.0222 79.9443V82.8729H71.8734L72.3079 83.0995C73.4103 83.6742 74.6641 84 75.9999 84C80.4182 84 83.9999 80.4183 83.9999 76C83.9999 71.5817 80.4182 68 75.9999 68C71.5816 68 67.9999 71.5817 67.9999 76C67.9999 77.2698 68.2943 78.4652 68.8167 79.5267L69.0222 79.9443ZM85.9999 76C85.9999 81.5228 81.5227 86 75.9999 86C74.3346 86 72.7644 85.5929 71.3833 84.8729H68.2222C67.5595 84.8729 67.0222 84.3356 67.0222 83.6729V80.4098C66.3676 79.0796 65.9999 77.5827 65.9999 76C65.9999 70.4772 70.477 66 75.9999 66C81.5227 66 85.9999 70.4772 85.9999 76Z" fill="#3370FF"/>
|
||||
<path d="M72.5961 76C72.5961 76.7028 72.0264 77.2726 71.3236 77.2726C70.6208 77.2726 70.051 76.7028 70.051 76C70.051 75.2972 70.6208 74.7275 71.3236 74.7275C72.0264 74.7275 72.5961 75.2972 72.5961 76Z" fill="#3370FF"/>
|
||||
<path d="M77.1723 76C77.1723 76.7028 76.6026 77.2726 75.8997 77.2726C75.1969 77.2726 74.6272 76.7028 74.6272 76C74.6272 75.2972 75.1969 74.7275 75.8997 74.7275C76.6026 74.7275 77.1723 75.2972 77.1723 76Z" fill="#3370FF"/>
|
||||
<path d="M80.4759 77.2726C81.1787 77.2726 81.7484 76.7028 81.7484 76C81.7484 75.2972 81.1787 74.7275 80.4759 74.7275C79.773 74.7275 79.2033 75.2972 79.2033 76C79.2033 76.7028 79.773 77.2726 80.4759 77.2726Z" fill="#3370FF"/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_d_1705_318" x="44.75" y="44.75" width="62.5" height="62.5" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feMorphology radius="3.25" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_1705_318"/>
|
||||
<feOffset/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0.2 0 0 0 0 0.439216 0 0 0 0 1 0 0 0 0.15 0"/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1705_318"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1705_318" result="shape"/>
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear_1705_318" x1="28.5837" y1="76.0002" x2="123.416" y2="76.0002" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3370FF"/>
|
||||
<stop offset="1" stop-color="#3370FF" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_1705_318" x1="131.526" y1="59.1487" x2="27.8803" y2="115.987" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3370FF"/>
|
||||
<stop offset="1" stop-color="#3370FF" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_1705_318" x1="40.4844" y1="145.317" x2="134.681" y2="27.5716" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3370FF"/>
|
||||
<stop offset="1" stop-color="#3370FF" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.0 KiB |
@@ -1 +1,4 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689854044643" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3460" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M892.1 805L781.9 621.3V458c0-71.8-28.1-139.5-79.3-190.6-36.2-36.2-80.7-60.8-129-72.2v-22.7c0-34-27.6-61.6-61.6-61.6s-61.6 27.6-61.6 61.6v22.7c-48.4 11.3-92.9 36-129 72.2-51.1 51.1-79.3 118.8-79.3 190.6v163.3L131.9 805h257.7c7.6 60.8 59.5 108 122.3 108s114.8-47.2 122.3-108h257.9zM496.4 172.6c0-8.6 7-15.6 15.6-15.6s15.6 7 15.6 15.6v16c-5.2-0.3-10.4-0.5-15.6-0.5s-10.4 0.2-15.6 0.5v-16zM288.1 634.1V458c0-123.4 100.4-223.9 223.9-223.9 123.4 0 223.9 100.4 223.9 223.9v176.1L810.8 759H213.2l74.9-124.9zM512 867c-37.4 0-68.6-26.7-75.8-62h151.5c-7.1 35.3-38.3 62-75.7 62z" p-id="3461"></path></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M9.99978 2.81218C9.33815 2.81218 8.80178 3.34854 8.80178 4.01018C8.80178 4.18675 8.83967 4.35399 8.90804 4.50464C9.26591 4.44167 9.63155 4.40951 9.99978 4.40951C10.368 4.40951 10.7337 4.44167 11.0915 4.50464C11.1599 4.35399 11.1978 4.18675 11.1978 4.01018C11.1978 3.34854 10.6614 2.81218 9.99978 2.81218ZM12.62 4.98573C12.7331 4.68191 12.7951 4.35311 12.7951 4.01018C12.7951 2.46636 11.5436 1.21484 9.99978 1.21484C8.45596 1.21484 7.20445 2.46636 7.20445 4.01018C7.20445 4.35311 7.26642 4.68191 7.37961 4.98573C6.91167 5.20519 6.47602 5.48498 6.08826 5.82104C5.03031 6.73793 4.40911 8.00808 4.40911 9.36125C4.40911 11.0446 3.9936 12.2364 3.50445 13.0636L3.49635 13.0773C3.18181 13.6093 2.93616 14.0247 2.77139 14.323C2.68904 14.472 2.61657 14.6102 2.56389 14.7285C2.53776 14.7872 2.50894 14.8576 2.48649 14.9324C2.46974 14.9882 2.42854 15.1328 2.44568 15.3081C2.45509 15.4043 2.47667 15.5954 2.58795 15.7905C2.69923 15.9856 2.85276 16.1014 2.93081 16.1585C3.05799 16.2515 3.18526 16.2914 3.24864 16.309C3.32345 16.3297 3.39614 16.3419 3.45641 16.35C3.57691 16.3661 3.71722 16.3743 3.86347 16.3794C4.155 16.3895 4.5626 16.3895 5.07621 16.3895H6.90576C7.2604 17.7674 8.5112 18.7855 9.99978 18.7855C11.4884 18.7855 12.7392 17.7674 13.0938 16.3895H14.9234C15.437 16.3895 15.8446 16.3895 16.1361 16.3794C16.2823 16.3743 16.4227 16.3661 16.5432 16.35C16.6034 16.3419 16.6761 16.3297 16.7509 16.309C16.8143 16.2914 16.9416 16.2515 17.0688 16.1585C17.1468 16.1014 17.3003 15.9856 17.4116 15.7905C17.5229 15.5954 17.5445 15.4043 17.5539 15.3081C17.571 15.1328 17.5298 14.9882 17.5131 14.9324C17.4906 14.8576 17.4618 14.7872 17.4357 14.7285C17.383 14.6102 17.3105 14.472 17.2282 14.323C17.0634 14.0247 16.8177 13.6092 16.5032 13.0773L16.4951 13.0636C16.006 12.2364 15.5905 11.0446 15.5905 9.36125C15.5905 8.00808 14.9693 6.73793 13.9113 5.82104C13.5236 5.48498 13.0879 5.20519 12.62 4.98573ZM11.2091 6.16505C11.2192 6.16802 11.2294 6.17078 11.2396 6.17334C11.8541 6.34274 12.4127 6.63601 12.8652 7.02813C13.6046 7.66895 13.9931 8.51149 13.9931 9.36125C13.9931 11.3227 14.4815 12.7965 15.1202 13.8766C15.3399 14.2482 15.5179 14.5494 15.6572 14.7906C15.4501 14.7921 15.2015 14.7922 14.905 14.7922H5.09452C4.7981 14.7922 4.54947 14.7921 4.34239 14.7906C4.48165 14.5494 4.65971 14.2482 4.8794 13.8766C5.51808 12.7965 6.00645 11.3227 6.00645 9.36125C6.00645 8.51149 6.39499 7.66895 7.1344 7.02813C7.58685 6.63601 8.14546 6.34274 8.75999 6.17334C8.77019 6.17078 8.78035 6.16802 8.79047 6.16505C9.17611 6.06162 9.58332 6.00685 9.99978 6.00685C10.4163 6.00685 10.8235 6.06162 11.2091 6.16505ZM8.61614 16.3895C8.89233 16.867 9.40855 17.1882 9.99978 17.1882C10.591 17.1882 11.1072 16.867 11.3834 16.3895H8.61614Z" />
|
||||
</svg>
|
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 2.8 KiB |
@@ -28,4 +28,4 @@ const MyIcon = ({ name, w = 'auto', h = 'auto', ...props }: { name: IconNameType
|
||||
) : null;
|
||||
};
|
||||
|
||||
export default MyIcon;
|
||||
export default React.memo(MyIcon);
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import React from 'react';
|
||||
import Editor, { loader } from '@monaco-editor/react';
|
||||
import { useCallback, useRef, useState } from 'react';
|
||||
import { Box, BoxProps } from '@chakra-ui/react';
|
||||
import { Box, BoxProps, useToast } from '@chakra-ui/react';
|
||||
import MyIcon from '../../Icon';
|
||||
|
||||
loader.config({
|
||||
paths: { vs: "/js/monaco-editor.0.43.0" },
|
||||
paths: { vs: '/js/monaco-editor.0.43.0' }
|
||||
});
|
||||
|
||||
type Props = Omit<BoxProps, 'onChange' | 'resize' | 'height'> & {
|
||||
@@ -39,6 +39,7 @@ const options = {
|
||||
};
|
||||
|
||||
const JSONEditor = ({ defaultValue, value, onChange, resize, ...props }: Props) => {
|
||||
const toast = useToast();
|
||||
const [height, setHeight] = useState(props.height || 100);
|
||||
const initialY = useRef(0);
|
||||
|
||||
@@ -108,6 +109,22 @@ const JSONEditor = ({ defaultValue, value, onChange, resize, ...props }: Props)
|
||||
defaultValue={defaultValue}
|
||||
value={value}
|
||||
onChange={(e) => onChange?.(e || '')}
|
||||
wrapperProps={{
|
||||
onBlur: () => {
|
||||
try {
|
||||
JSON.parse(value as string);
|
||||
} catch (error: any) {
|
||||
toast({
|
||||
title: 'Invalid JSON',
|
||||
description: error.message,
|
||||
position: 'top',
|
||||
status: 'error',
|
||||
duration: 3000,
|
||||
isClosable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { useState, useRef } from 'react';
|
||||
import { useState, useRef, useTransition, useEffect } from 'react';
|
||||
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
||||
import { PlainTextPlugin } from '@lexical/react/LexicalPlainTextPlugin';
|
||||
import { ContentEditable } from '@lexical/react/LexicalContentEditable';
|
||||
@@ -11,11 +11,12 @@ import styles from './index.module.scss';
|
||||
import VariablePlugin from './plugins/VariablePlugin';
|
||||
import { VariableNode } from './plugins/VariablePlugin/node';
|
||||
import { EditorState, LexicalEditor } from 'lexical';
|
||||
import { textToEditorState } from './utils';
|
||||
import OnBlurPlugin from './plugins/OnBlurPlugin';
|
||||
import MyIcon from '../../Icon';
|
||||
import { PickerMenuItemType } from './type.d';
|
||||
import { EditorVariablePickerType } from './type.d';
|
||||
import { getNanoid } from '@fastgpt/global/common/string/tools';
|
||||
import FocusPlugin from './plugins/FocusPlugin';
|
||||
import { textToEditorState } from './utils';
|
||||
|
||||
export default function Editor({
|
||||
h = 200,
|
||||
@@ -25,31 +26,34 @@ export default function Editor({
|
||||
variables,
|
||||
onChange,
|
||||
onBlur,
|
||||
defaultValue,
|
||||
value,
|
||||
placeholder = ''
|
||||
}: {
|
||||
h?: number;
|
||||
showResize?: boolean;
|
||||
showOpenModal?: boolean;
|
||||
onOpenModal?: () => void;
|
||||
variables: PickerMenuItemType[];
|
||||
variables: EditorVariablePickerType[];
|
||||
onChange?: (editorState: EditorState) => void;
|
||||
onBlur?: (editor: LexicalEditor) => void;
|
||||
defaultValue?: string;
|
||||
value?: string;
|
||||
placeholder?: string;
|
||||
}) {
|
||||
const key = useRef(getNanoid(6));
|
||||
const [key, setKey] = useState(getNanoid(6));
|
||||
const [_, startSts] = useTransition();
|
||||
const [height, setHeight] = useState(h);
|
||||
const [initialConfig, setInitialConfig] = useState({
|
||||
const [focus, setFocus] = useState(false);
|
||||
|
||||
const initialConfig = {
|
||||
namespace: 'promptEditor',
|
||||
nodes: [VariableNode],
|
||||
editorState: textToEditorState(defaultValue),
|
||||
editorState: textToEditorState(value),
|
||||
onError: (error: Error) => {
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
const initialY = useRef(0);
|
||||
};
|
||||
|
||||
const initialY = useRef(0);
|
||||
const handleMouseDown = (e: React.MouseEvent) => {
|
||||
initialY.current = e.clientY;
|
||||
|
||||
@@ -68,9 +72,14 @@ export default function Editor({
|
||||
document.addEventListener('mouseup', handleMouseUp);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (focus) return;
|
||||
setKey(getNanoid(6));
|
||||
}, [value, variables, focus]);
|
||||
|
||||
return (
|
||||
<Box position={'relative'} width={'full'} h={`${height}px`} cursor={'text'}>
|
||||
<LexicalComposer initialConfig={initialConfig} key={key.current}>
|
||||
<LexicalComposer initialConfig={initialConfig} key={key}>
|
||||
<PlainTextPlugin
|
||||
contentEditable={<ContentEditable className={styles.contentEditable} />}
|
||||
placeholder={
|
||||
@@ -100,7 +109,14 @@ export default function Editor({
|
||||
ErrorBoundary={LexicalErrorBoundary}
|
||||
/>
|
||||
<HistoryPlugin />
|
||||
<OnChangePlugin onChange={(e) => onChange?.(e)} />
|
||||
<FocusPlugin focus={focus} setFocus={setFocus} />
|
||||
<OnChangePlugin
|
||||
onChange={(e) => {
|
||||
startSts(() => {
|
||||
onChange?.(e);
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<VariablePickerPlugin variables={variables} />
|
||||
<VariablePlugin variables={variables} />
|
||||
<OnBlurPlugin onBlur={onBlur} />
|
||||
|
@@ -5,13 +5,13 @@ import Editor from './Editor';
|
||||
import MyModal from '../../MyModal';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { $getRoot, EditorState, type LexicalEditor } from 'lexical';
|
||||
import { PickerMenuItemType } from './type.d';
|
||||
import { EditorVariablePickerType } from './type.d';
|
||||
import { useCallback, useTransition } from 'react';
|
||||
|
||||
const PromptEditor = ({
|
||||
showOpenModal = true,
|
||||
variables = [],
|
||||
defaultValue,
|
||||
value,
|
||||
onChange,
|
||||
onBlur,
|
||||
h,
|
||||
@@ -19,8 +19,8 @@ const PromptEditor = ({
|
||||
title
|
||||
}: {
|
||||
showOpenModal?: boolean;
|
||||
variables?: PickerMenuItemType[];
|
||||
defaultValue?: string;
|
||||
variables?: EditorVariablePickerType[];
|
||||
value?: string;
|
||||
onChange?: (text: string) => void;
|
||||
onBlur?: (text: string) => void;
|
||||
h?: number;
|
||||
@@ -53,7 +53,7 @@ const PromptEditor = ({
|
||||
onOpenModal={onOpen}
|
||||
variables={variables}
|
||||
h={h}
|
||||
defaultValue={defaultValue}
|
||||
value={value}
|
||||
onChange={onChangeInput}
|
||||
onBlur={onBlurInput}
|
||||
placeholder={placeholder}
|
||||
@@ -65,7 +65,7 @@ const PromptEditor = ({
|
||||
showResize
|
||||
showOpenModal={false}
|
||||
variables={variables}
|
||||
defaultValue={defaultValue}
|
||||
value={value}
|
||||
onChange={onChangeInput}
|
||||
onBlur={onBlurInput}
|
||||
placeholder={placeholder}
|
||||
|
@@ -0,0 +1,41 @@
|
||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
||||
import { useEffect } from 'react';
|
||||
import { BLUR_COMMAND, COMMAND_PRIORITY_LOW, FOCUS_COMMAND } from 'lexical';
|
||||
|
||||
export default function FocusPlugin({ focus, setFocus }: { focus: Boolean; setFocus: any }) {
|
||||
const [editor] = useLexicalComposerContext();
|
||||
|
||||
useEffect(
|
||||
() =>
|
||||
editor.registerCommand(
|
||||
BLUR_COMMAND,
|
||||
() => {
|
||||
setFocus(false);
|
||||
return false;
|
||||
},
|
||||
COMMAND_PRIORITY_LOW
|
||||
),
|
||||
[]
|
||||
);
|
||||
|
||||
useEffect(
|
||||
() =>
|
||||
editor.registerCommand(
|
||||
FOCUS_COMMAND,
|
||||
() => {
|
||||
setFocus(true);
|
||||
return false;
|
||||
},
|
||||
COMMAND_PRIORITY_LOW
|
||||
),
|
||||
[]
|
||||
);
|
||||
|
||||
// useEffect(() => {
|
||||
// if (focus) {
|
||||
// editor.focus();
|
||||
// }
|
||||
// }, [focus]);
|
||||
|
||||
return null;
|
||||
}
|
@@ -9,9 +9,13 @@ import { useTranslation } from 'next-i18next';
|
||||
import MyIcon from '../../../../Icon';
|
||||
import { Box, Flex } from '@chakra-ui/react';
|
||||
import { useBasicTypeaheadTriggerMatch } from '../../utils';
|
||||
import { PickerMenuItemType } from '../../type.d';
|
||||
import { EditorVariablePickerType } from '../../type.d';
|
||||
|
||||
export default function VariablePickerPlugin({ variables }: { variables: PickerMenuItemType[] }) {
|
||||
export default function VariablePickerPlugin({
|
||||
variables
|
||||
}: {
|
||||
variables: EditorVariablePickerType[];
|
||||
}) {
|
||||
const [editor] = useLexicalComposerContext();
|
||||
const [queryString, setQueryString] = useState<string | null>(null);
|
||||
const { t } = useTranslation();
|
||||
|
@@ -6,11 +6,11 @@ import { useCallback, useEffect, useMemo } from 'react';
|
||||
import { getHashtagRegexString } from './utils';
|
||||
import { registerLexicalTextEntity } from '../../utils';
|
||||
import { $createVariableNode, VariableNode } from './node';
|
||||
import { PickerMenuItemType } from '../../type';
|
||||
import { EditorVariablePickerType } from '../../type';
|
||||
|
||||
const REGEX = new RegExp(getHashtagRegexString(), 'i');
|
||||
|
||||
export default function VariablePlugin({ variables }: { variables: PickerMenuItemType[] }) {
|
||||
export default function VariablePlugin({ variables }: { variables: EditorVariablePickerType[] }) {
|
||||
const [editor] = useLexicalComposerContext();
|
||||
useEffect(() => {
|
||||
if (!editor.hasNodes([VariableNode]))
|
||||
@@ -28,7 +28,6 @@ export default function VariablePlugin({ variables }: { variables: PickerMenuIte
|
||||
const getVariableMatch = useCallback((text: string) => {
|
||||
const matches = REGEX.exec(text);
|
||||
if (!matches) return null;
|
||||
|
||||
if (variableKeys.indexOf(matches[3]) === -1) return null;
|
||||
const hashtagLength = matches[3].length + 4;
|
||||
const startOffset = matches.index;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
export type PickerMenuItemType = {
|
||||
export type EditorVariablePickerType = {
|
||||
key: string;
|
||||
label: string;
|
||||
icon?: string;
|
||||
|
14922
pnpm-lock.yaml
generated
@@ -5,112 +5,82 @@
|
||||
"qaMaxProcess": 15,
|
||||
"pgHNSWEfSearch": 100
|
||||
},
|
||||
"chatModels": [
|
||||
"llmModels": [
|
||||
{
|
||||
"model": "gpt-3.5-turbo",
|
||||
"name": "GPT35",
|
||||
"model": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo",
|
||||
"maxContext": 16000,
|
||||
"maxResponse": 4000,
|
||||
"quoteMaxToken": 13000,
|
||||
"maxTemperature": 1.2,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"maxContext": 4000,
|
||||
"maxResponse": 4000,
|
||||
"quoteMaxToken": 2000,
|
||||
"maxTemperature": 1.2,
|
||||
"censor": false,
|
||||
"vision": false,
|
||||
"defaultSystemChatPrompt": ""
|
||||
"datasetProcess": false,
|
||||
"toolChoice": true,
|
||||
"functionCall": false,
|
||||
"customCQPrompt": "",
|
||||
"customExtractPrompt": "",
|
||||
"defaultSystemChatPrompt": "",
|
||||
"defaultConfig": {}
|
||||
},
|
||||
{
|
||||
"model": "gpt-3.5-turbo-16k",
|
||||
"name": "GPT35-16k",
|
||||
"name": "gpt-3.5-turbo-16k",
|
||||
"maxContext": 16000,
|
||||
"maxResponse": 16000,
|
||||
"quoteMaxToken": 13000,
|
||||
"maxTemperature": 1.2,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"quoteMaxToken": 8000,
|
||||
"maxTemperature": 1.2,
|
||||
"censor": false,
|
||||
"vision": false,
|
||||
"defaultSystemChatPrompt": ""
|
||||
"datasetProcess": true,
|
||||
"toolChoice": true,
|
||||
"functionCall": false,
|
||||
"customCQPrompt": "",
|
||||
"customExtractPrompt": "",
|
||||
"defaultSystemChatPrompt": "",
|
||||
"defaultConfig": {}
|
||||
},
|
||||
{
|
||||
"model": "gpt-4",
|
||||
"name": "GPT4-8k",
|
||||
"maxContext": 8000,
|
||||
"maxResponse": 8000,
|
||||
"model": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-turbo",
|
||||
"maxContext": 125000,
|
||||
"maxResponse": 125000,
|
||||
"quoteMaxToken": 100000,
|
||||
"maxTemperature": 1.2,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"quoteMaxToken": 4000,
|
||||
"maxTemperature": 1.2,
|
||||
"censor": false,
|
||||
"vision": false,
|
||||
"defaultSystemChatPrompt": ""
|
||||
"datasetProcess": false,
|
||||
"toolChoice": true,
|
||||
"functionCall": false,
|
||||
"customCQPrompt": "",
|
||||
"customExtractPrompt": "",
|
||||
"defaultSystemChatPrompt": "",
|
||||
"defaultConfig": {}
|
||||
},
|
||||
{
|
||||
"model": "gpt-4-vision-preview",
|
||||
"name": "GPT4-Vision",
|
||||
"name": "gpt-4-vision",
|
||||
"maxContext": 128000,
|
||||
"maxResponse": 4000,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"quoteMaxToken": 100000,
|
||||
"maxTemperature": 1.2,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"censor": false,
|
||||
"vision": true,
|
||||
"defaultSystemChatPrompt": ""
|
||||
}
|
||||
],
|
||||
"qaModels": [
|
||||
{
|
||||
"model": "gpt-3.5-turbo-16k",
|
||||
"name": "GPT35-16k",
|
||||
"maxContext": 16000,
|
||||
"maxResponse": 16000,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0
|
||||
}
|
||||
],
|
||||
"cqModels": [
|
||||
{
|
||||
"model": "gpt-3.5-turbo",
|
||||
"name": "GPT35",
|
||||
"maxContext": 4000,
|
||||
"maxResponse": 4000,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"vision": false,
|
||||
"datasetProcess": false,
|
||||
"toolChoice": true,
|
||||
"functionPrompt": ""
|
||||
},
|
||||
{
|
||||
"model": "gpt-4",
|
||||
"name": "GPT4-8k",
|
||||
"maxContext": 8000,
|
||||
"maxResponse": 8000,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"toolChoice": true,
|
||||
"functionPrompt": ""
|
||||
}
|
||||
],
|
||||
"extractModels": [
|
||||
{
|
||||
"model": "gpt-3.5-turbo-1106",
|
||||
"name": "GPT35-1106",
|
||||
"maxContext": 16000,
|
||||
"maxResponse": 4000,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"toolChoice": true,
|
||||
"functionPrompt": ""
|
||||
}
|
||||
],
|
||||
"qgModels": [
|
||||
{
|
||||
"model": "gpt-3.5-turbo-1106",
|
||||
"name": "GPT35-1106",
|
||||
"maxContext": 1600,
|
||||
"maxResponse": 4000,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0
|
||||
"functionCall": false,
|
||||
"customCQPrompt": "",
|
||||
"customExtractPrompt": "",
|
||||
"defaultSystemChatPrompt": "",
|
||||
"defaultConfig": {}
|
||||
}
|
||||
],
|
||||
"vectorModels": [
|
||||
|
@@ -38,10 +38,10 @@
|
||||
{
|
||||
"key": "DYNAMIC_INPUT_KEY",
|
||||
"valueType": "any",
|
||||
"label": "字符串变量",
|
||||
"label": "需要加工的输入",
|
||||
"type": "addInputParam",
|
||||
"required": false,
|
||||
"description": "可动态的添加字符串类型变量,在文本编辑中通过 {{key}} 使用变量。",
|
||||
"description": "可动态的添加字符串类型变量,在文本编辑中通过 {{key}} 使用变量。非字符串类型,会自动转成字符串类型。",
|
||||
"edit": true,
|
||||
"editField": {
|
||||
"key": true,
|
||||
@@ -79,7 +79,7 @@
|
||||
{
|
||||
"key": "DYNAMIC_INPUT_KEY",
|
||||
"valueType": "any",
|
||||
"label": "字符串变量",
|
||||
"label": "需要加工的输入",
|
||||
"type": "source",
|
||||
"edit": true,
|
||||
"targets": [
|
||||
|
@@ -45,7 +45,13 @@ const nextConfig = {
|
||||
},
|
||||
transpilePackages: ['@fastgpt/*'],
|
||||
experimental: {
|
||||
serverComponentsExternalPackages: ['mongoose', 'pg', '@chakra-ui/react', '@lexical/react'],
|
||||
serverComponentsExternalPackages: [
|
||||
'mongoose',
|
||||
'pg',
|
||||
'react',
|
||||
'@chakra-ui/react',
|
||||
'@lexical/react'
|
||||
],
|
||||
outputFileTracingRoot: path.join(__dirname, '../../')
|
||||
}
|
||||
};
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "app",
|
||||
"version": "4.6.7",
|
||||
"version": "4.6.8",
|
||||
"private": false,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
@@ -21,6 +21,7 @@
|
||||
"@fastgpt/plugins": "workspace:*",
|
||||
"@fastgpt/service": "workspace:*",
|
||||
"@fastgpt/web": "workspace:*",
|
||||
"@fortaine/fetch-event-source": "^3.0.6",
|
||||
"@node-rs/jieba": "^1.7.2",
|
||||
"@tanstack/react-query": "^4.24.10",
|
||||
"@types/nprogress": "^0.2.0",
|
||||
|
@@ -1,12 +1,11 @@
|
||||
### Fast GPT V4.6.7
|
||||
### Fast GPT V4.6.8
|
||||
|
||||
1. 修改了知识库UI及新的导入交互方式。
|
||||
2. 优化知识库和对话的数据索引,加快数据操作。
|
||||
3. 知识库 openAPI,支持通过 API 操作知识库。
|
||||
4. 新增 - 输入框变量提示。输入 { 号后将会获得可用变量提示。根据社区针对高级编排的反馈,我们计划于 2 月份的版本中,优化变量内容,支持模块的局部变量以及更多全局变量写入。
|
||||
5. 优化 - 切换团队后会保存记录,下次登录时优先登录该团队。
|
||||
6. 修复 - API 对话时,chatId 冲突问题。
|
||||
7. 修复 - Iframe 嵌入网页可能导致的 window.onLoad 冲突。
|
||||
2. 新增 - 知识库搜索合并模块。
|
||||
3. 优化 - LLM 模型配置,不再区分对话、分类、提取模型。同时支持模型的默认参数,避免不同模型参数冲突,可通过`defaultConfig`传入默认的配置。
|
||||
4. 优化 - HTTP 模块,支持输出字符串自动序列化(JSON可自动转成字符串)
|
||||
5. 修复 - 语音输入文件无法上传。
|
||||
6. 修复 - 对话框重新生成无法使用。
|
||||
7. [点击查看高级编排介绍文档](https://doc.fastgpt.in/docs/workflow/intro)
|
||||
8. [使用文档](https://doc.fastgpt.in/docs/intro/)
|
||||
9. [点击查看高级编排介绍文档](https://doc.fastgpt.in/docs/workflow)
|
||||
10. [点击查看商业版](https://doc.fastgpt.in/docs/commercial/)
|
||||
9. [点击查看商业版](https://doc.fastgpt.in/docs/commercial/)
|
||||
|
@@ -1 +0,0 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1700746289796" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="44851" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M939.795692 421.415385a248.832 248.832 0 0 0-21.385846-204.386462 251.667692 251.667692 0 0 0-271.064615-120.753231 248.832 248.832 0 0 0-187.687385-83.672615 251.687385 251.687385 0 0 0-240.088615 174.257231 248.910769 248.910769 0 0 0-166.4 120.713846 251.707077 251.707077 0 0 0 30.956307 295.108923 248.832 248.832 0 0 0 21.385847 204.386461 251.687385 251.687385 0 0 0 271.064615 120.753231 248.832 248.832 0 0 0 187.687385 83.672616 251.687385 251.687385 0 0 0 240.167384-174.355693 248.910769 248.910769 0 0 0 166.4-120.713846A251.707077 251.707077 0 0 0 939.795692 421.415385zM564.342154 946.195692a186.663385 186.663385 0 0 1-119.827692-43.323077c1.516308-0.827077 4.174769-2.284308 5.907692-3.347692l198.892308-114.884923a32.334769 32.334769 0 0 0 16.344615-28.297846V475.943385l84.066461 48.541538a2.993231 2.993231 0 0 1 1.634462 2.304v232.211692a187.431385 187.431385 0 0 1-187.017846 187.195077z m-402.195692-171.776a186.564923 186.564923 0 0 1-22.331077-125.44c1.476923 0.886154 4.056615 2.461538 5.907692 3.524923l198.892308 114.884923a32.374154 32.374154 0 0 0 32.669538 0l242.825846-140.20923v97.083077a3.012923 3.012923 0 0 1-1.201231 2.579692l-201.058461 116.086154a187.392 187.392 0 0 1-255.704615-68.509539z m-52.322462-434.195692a186.505846 186.505846 0 0 1 97.437538-82.077538c0 1.713231-0.098462 4.745846-0.098461 6.852923v229.769846a32.315077 32.315077 0 0 0 16.324923 28.278154L466.313846 663.236923l-84.066461 48.541539a3.012923 3.012923 0 0 1-2.835693 0.256l-201.078154-116.184616a187.392 187.392 0 0 1-68.509538-255.625846z m690.688 160.728615l-242.825846-140.20923 84.066461-48.521847a3.012923 3.012923 0 0 1 2.835693-0.256l201.078154 116.086154a187.234462 187.234462 0 0 1-28.928 337.821539V529.230769a32.295385 32.295385 0 0 0-16.226462-28.278154zM884.184615 375.020308c-1.476923-0.905846-4.056615-2.461538-5.907692-3.524923l-198.892308-114.884923a32.413538 32.413538 0 0 0-32.669538 0l-242.825846 140.20923v-97.083077a3.012923 3.012923 0 0 1 1.201231-2.579692l201.058461-115.987692A187.214769 187.214769 0 0 1 884.184615 375.020308z m-526.00123 173.036307l-84.086154-48.541538a2.993231 2.993231 0 0 1-1.634462-2.304V264.999385a187.214769 187.214769 0 0 1 307.003077-143.753847c-1.516308 0.827077-4.155077 2.284308-5.907692 3.347693l-198.892308 114.884923a32.315077 32.315077 0 0 0-16.344615 28.278154z m45.666461-98.461538L512 387.131077l108.150154 62.424615v124.888616L512 636.868923l-108.150154-62.424615z" fill="#202123" p-id="44852"></path></svg>
|
Before Width: | Height: | Size: 2.8 KiB |
1
projects/app/public/imgs/module/concat.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1706771092322" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5411" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M861.045651 64.447824 162.614611 64.447824c-54.376445 0-98.455359 44.079938-98.455359 98.456383l0 698.430016c0 54.376445 44.079938 98.456383 98.455359 98.456383l698.430016 0c54.376445 0 98.456383-44.079938 98.456383-98.456383L959.50101 162.904207C959.502034 108.528785 915.422096 64.447824 861.045651 64.447824zM153.315828 211.438597l172.208107 0c8.748245 11.125385 129.704061 222.88223 129.704061 222.88223l-43.320645 56.170301L291.082518 280.322453 153.315828 280.322453c-19.018146 0-34.441417-12.853749-34.441417-31.67235C118.874411 229.833549 134.297682 211.438597 153.315828 211.438597zM909.225977 513.596358 763.121388 624.062262c-10.277064 10.17064-42.363853 14.696724-52.640917 4.526083l0.004093-86.708827L532.163225 541.879518 325.522911 812.799834 153.314805 812.799834c-19.018146 0-34.441417-18.392906-34.441417-37.21253 0-18.809391 15.423271-31.668257 34.441417-31.668257l137.76669 0L497.721809 472.995661l212.759685 0-0.001023-9.076726 0.004093-94.929046c10.273994-10.169617 42.35976-12.849656 52.636824-2.686179l146.105612 110.471021C919.506111 486.942301 919.506111 503.429811 909.225977 513.596358z" fill="#1296db" p-id="5412"></path></svg>
|
After Width: | Height: | Size: 1.5 KiB |