Commit 108e1b92 by Archer Committed by GitHub

perf: model provider show; perf: get init data buffer (#3459)

* pr code

* perf: model table show

* perf: model provider show

* perf: get init data buffer

* perf: get init data buffer

* perf: icon
parent f646ef85
...@@ -12,4 +12,5 @@ weight: 807 ...@@ -12,4 +12,5 @@ weight: 807
1. 1.
2. 新增 - LLM 模型参数支持关闭 max_tokens 和 temperature。 2. 新增 - LLM 模型参数支持关闭 max_tokens 和 temperature。
3. 优化 - 知识库搜索参数,滑动条支持输入模式,可以更精准的控制。 3. 优化 - 知识库搜索参数,滑动条支持输入模式,可以更精准的控制。
\ No newline at end of file 4. 优化 - 可用模型展示
\ No newline at end of file
...@@ -19,17 +19,20 @@ FastGPT 商业版是基于 FastGPT 开源版的增强版本,增加了一些独 ...@@ -19,17 +19,20 @@ FastGPT 商业版是基于 FastGPT 开源版的增强版本,增加了一些独
| 应用管理与高级编排 | ✅ | ✅ | ✅ | | 应用管理与高级编排 | ✅ | ✅ | ✅ |
| 文档知识库 | ✅ | ✅ | ✅ | | 文档知识库 | ✅ | ✅ | ✅ |
| 外部使用 | ✅ | ✅ | ✅ | | 外部使用 | ✅ | ✅ | ✅ |
| API 知识库 | ✅ | ✅ | ✅ |
| 最大应用数量 | 500 | 无限制 | 由付费套餐决定 | | 最大应用数量 | 500 | 无限制 | 由付费套餐决定 |
| 最大知识库数量(单个知识库内容无限制) | 30 | 无限制 | 由付费套餐决定 | | 最大知识库数量(单个知识库内容无限制) | 30 | 无限制 | 由付费套餐决定 |
| 自定义版权信息 | ❌ | ✅ | 设计中 | | 自定义版权信息 | ❌ | ✅ | 设计中 |
| 多租户与支付 | ❌ | ✅ | ✅ | | 多租户与支付 | ❌ | ✅ | ✅ |
| 团队空间 | ❌ | ✅ | ✅ | | 团队空间 & 权限 | ❌ | ✅ | ✅ |
| 应用发布安全配置 | ❌ | ✅ | ✅ | | 应用发布安全配置 | ❌ | ✅ | ✅ |
| 内容审核 | ❌ | ✅ | ✅ | | 内容审核 | ❌ | ✅ | ✅ |
| web站点同步 | ❌ | ✅ | ✅ | | web站点同步 | ❌ | ✅ | ✅ |
| 管理后台 | ❌ | ✅ | 不需要 | | 主流文档库接入(目前支持:语雀、飞书) | ❌ | ✅ | ✅ |
| 增强训练模式 | ❌ | ✅ | ✅ | | 增强训练模式 | ❌ | ✅ | ✅ |
| 第三方应用快速接入(飞书、公众号) | ❌ | ✅ | ✅ | | 第三方应用快速接入(飞书、公众号) | ❌ | ✅ | ✅ |
| 管理后台 | ❌ | ✅ | 不需要 |
| SSO 登录(可自定义,也可使用内置:Github、公众号、钉钉、谷歌等) | ❌ | ✅ | 不需要 |
| 图片知识库 | ❌ | 设计中 | 设计中 | | 图片知识库 | ❌ | 设计中 | 设计中 |
| 对话日志运营分析 | ❌ | 设计中 | 设计中 | | 对话日志运营分析 | ❌ | 设计中 | 设计中 |
| 完整商业授权 | ❌ | ✅ | ✅ | | 完整商业授权 | ❌ | ✅ | ✅ |
...@@ -50,8 +53,8 @@ FastGPT 商业版软件根据不同的部署方式,分为 3 类收费模式。 ...@@ -50,8 +53,8 @@ FastGPT 商业版软件根据不同的部署方式,分为 3 类收费模式。
{{< table "table-hover table-striped-columns" >}} {{< table "table-hover table-striped-columns" >}}
| 部署方式 | 特有服务 | 上线时长 | 标品价格 | | 部署方式 | 特有服务 | 上线时长 | 标品价格 |
| ---- | ---- | ---- | ---- | | ---- | ---- | ---- | ---- |
| Sealos全托管 | 1. 有效期内免费升级。<br>2. 免运维服务&数据库。 | 半天 | 5000元起/月(3个月起)<br><br>50000元起/年 | | Sealos全托管 | 1. 有效期内免费升级。<br>2. 免运维服务&数据库。 | 半天 | 6000元起/月(3个月起)<br><br>60000元起/年 |
| 自有服务器部署 | 1. 6个版本的升级服务。 | 14天内 | 具体价格可[联系咨询](https://fael3z0zfze.feishu.cn/share/base/form/shrcnRxj3utrzjywsom96Px4sud) | | 自有服务器部署 | 1. 6个版本免费升级支持。 | 14天内 | 具体价格可[联系咨询](https://fael3z0zfze.feishu.cn/share/base/form/shrcnRxj3utrzjywsom96Px4sud) |
{{< /table >}} {{< /table >}}
{{% alert icon="🤖 " context="success" %}} {{% alert icon="🤖 " context="success" %}}
...@@ -62,6 +65,10 @@ FastGPT 商业版软件根据不同的部署方式,分为 3 类收费模式。 ...@@ -62,6 +65,10 @@ FastGPT 商业版软件根据不同的部署方式,分为 3 类收费模式。
- 高可用版适合对外提供在线服务,包含可视化监控、多副本、负载均衡、数据库自动备份等生产环境的基础设施。 - 高可用版适合对外提供在线服务,包含可视化监控、多副本、负载均衡、数据库自动备份等生产环境的基础设施。
{{% /alert %}} {{% /alert %}}
## 联系方式
请填写[咨询问卷](https://fael3z0zfze.feishu.cn/share/base/form/shrcnRxj3utrzjywsom96Px4sud),我们会尽快与您联系。
## 技术支持 ## 技术支持
...@@ -79,9 +86,6 @@ FastGPT 商业版软件根据不同的部署方式,分为 3 类收费模式。 ...@@ -79,9 +86,6 @@ FastGPT 商业版软件根据不同的部署方式,分为 3 类收费模式。
跨版本更新或复杂更新可参考文档自行更新;或付费支持,标准与技术服务费一致。 跨版本更新或复杂更新可参考文档自行更新;或付费支持,标准与技术服务费一致。
## 联系方式
请填写[咨询问卷](https://fael3z0zfze.feishu.cn/share/base/form/shrcnRxj3utrzjywsom96Px4sud),我们会尽快与您联系。
## QA ## QA
...@@ -95,8 +99,14 @@ FastGPT 商业版软件根据不同的部署方式,分为 3 类收费模式。 ...@@ -95,8 +99,14 @@ FastGPT 商业版软件根据不同的部署方式,分为 3 类收费模式。
可以修改开源版部分代码,不支持修改商业版镜像。完整版本=开源版+商业版镜像,所以是可以修改部分内容的。但是如果二开了,后续则需要自己进行代码合并升级。 可以修改开源版部分代码,不支持修改商业版镜像。完整版本=开源版+商业版镜像,所以是可以修改部分内容的。但是如果二开了,后续则需要自己进行代码合并升级。
## Sealos 费用 ### Sealos 运行费用
Sealos 云服务属于按量计费,下面是它的价格表: Sealos 云服务属于按量计费,下面是它的价格表:
![](/imgs/sealos_price.jpg) ![alt text](/imgs/image-58.png)
## 管理后台部分截图
| | | |
| ---- | ---- | ---- |
| ![alt text](/imgs/image-55.png) | ![alt text](/imgs/image-56.png) | ![alt text](/imgs/image-57.png) |
\ No newline at end of file
...@@ -5,7 +5,7 @@ import type { ...@@ -5,7 +5,7 @@ import type {
LLMModelItemType, LLMModelItemType,
VectorModelItemType, VectorModelItemType,
AudioSpeechModels, AudioSpeechModels,
WhisperModelType, STTModelType,
ReRankModelItemType ReRankModelItemType
} from '../../../core/ai/model.d'; } from '../../../core/ai/model.d';
import { SubTypeEnum } from '../../../support/wallet/sub/constants'; import { SubTypeEnum } from '../../../support/wallet/sub/constants';
...@@ -27,7 +27,7 @@ export type FastGPTConfigFileType = { ...@@ -27,7 +27,7 @@ export type FastGPTConfigFileType = {
vectorModels: VectorModelItemType[]; vectorModels: VectorModelItemType[];
reRankModels: ReRankModelItemType[]; reRankModels: ReRankModelItemType[];
audioSpeechModels: AudioSpeechModelType[]; audioSpeechModels: AudioSpeechModelType[];
whisperModel: WhisperModelType; whisperModel: STTModelType;
}; };
export type FastGPTFeConfigsType = { export type FastGPTFeConfigsType = {
......
...@@ -57,13 +57,15 @@ export type ReRankModelItemType = { ...@@ -57,13 +57,15 @@ export type ReRankModelItemType = {
}; };
export type AudioSpeechModelType = { export type AudioSpeechModelType = {
provider: ModelProviderIdType;
model: string; model: string;
name: string; name: string;
charsPointsPrice: number; charsPointsPrice: number;
voices: { label: string; value: string; bufferId: string }[]; voices: { label: string; value: string; bufferId: string }[];
}; };
export type WhisperModelType = { export type STTModelType = {
provider: ModelProviderIdType;
model: string; model: string;
name: string; name: string;
charsPointsPrice: number; // 60s = n points charsPointsPrice: number; // 60s = n points
......
import type { LLMModelItemType, VectorModelItemType } from './model.d'; import { i18nT } from '../../../web/i18n/utils';
import type { LLMModelItemType, STTModelType, VectorModelItemType } from './model.d';
import { getModelProvider, ModelProviderIdType } from './provider'; import { getModelProvider, ModelProviderIdType } from './provider';
export const defaultQAModels: LLMModelItemType[] = [ export const defaultQAModels: LLMModelItemType[] = [
...@@ -35,6 +36,13 @@ export const defaultVectorModels: VectorModelItemType[] = [ ...@@ -35,6 +36,13 @@ export const defaultVectorModels: VectorModelItemType[] = [
} }
]; ];
export const defaultWhisperModel: STTModelType = {
provider: 'OpenAI',
model: 'whisper-1',
name: 'whisper-1',
charsPointsPrice: 0
};
export const getModelFromList = ( export const getModelFromList = (
modelList: { provider: ModelProviderIdType; name: string; model: string }[], modelList: { provider: ModelProviderIdType; name: string; model: string }[],
model: string model: string
...@@ -46,3 +54,16 @@ export const getModelFromList = ( ...@@ -46,3 +54,16 @@ export const getModelFromList = (
avatar: provider.avatar avatar: provider.avatar
}; };
}; };
export enum ModelTypeEnum {
chat = 'chat',
embedding = 'embedding',
tts = 'tts',
stt = 'stt'
}
export const modelTypeList = [
{ label: i18nT('common:model.type.chat'), value: ModelTypeEnum.chat },
{ label: i18nT('common:model.type.embedding'), value: ModelTypeEnum.embedding },
{ label: i18nT('common:model.type.tts'), value: ModelTypeEnum.tts },
{ label: i18nT('common:model.type.stt'), value: ModelTypeEnum.stt }
];
...@@ -5,6 +5,7 @@ export type ModelProviderIdType = ...@@ -5,6 +5,7 @@ export type ModelProviderIdType =
| 'Claude' | 'Claude'
| 'Gemini' | 'Gemini'
| 'MistralAI' | 'MistralAI'
| 'Groq'
| 'Qwen' | 'Qwen'
| 'Doubao' | 'Doubao'
| 'ChatGLM' | 'ChatGLM'
...@@ -44,7 +45,12 @@ export const ModelProviderList: ModelProviderType[] = [ ...@@ -44,7 +45,12 @@ export const ModelProviderList: ModelProviderType[] = [
{ {
id: 'MistralAI', id: 'MistralAI',
name: 'MistralAI', name: 'MistralAI',
avatar: 'model/huggingface' avatar: 'model/mistral'
},
{
id: 'Groq',
name: 'Groq',
avatar: 'model/groq'
}, },
{ {
id: 'Qwen', id: 'Qwen',
...@@ -113,7 +119,7 @@ export const ModelProviderList: ModelProviderType[] = [ ...@@ -113,7 +119,7 @@ export const ModelProviderList: ModelProviderType[] = [
} }
]; ];
export const ModelProviderMap = Object.fromEntries( export const ModelProviderMap = Object.fromEntries(
ModelProviderList.map((item) => [item.id, item]) ModelProviderList.map((item, index) => [item.id, { ...item, order: index }])
); );
export const getModelProvider = (provider: ModelProviderIdType) => { export const getModelProvider = (provider: ModelProviderIdType) => {
......
...@@ -4,7 +4,12 @@ import { FastGPTConfigFileType } from '@fastgpt/global/common/system/types'; ...@@ -4,7 +4,12 @@ import { FastGPTConfigFileType } from '@fastgpt/global/common/system/types';
import { FastGPTProUrl } from '../constants'; import { FastGPTProUrl } from '../constants';
export const getFastGPTConfigFromDB = async () => { export const getFastGPTConfigFromDB = async () => {
if (!FastGPTProUrl) return {} as FastGPTConfigFileType; if (!FastGPTProUrl) {
return {
config: {} as FastGPTConfigFileType,
configId: undefined
};
}
const res = await MongoSystemConfigs.findOne({ const res = await MongoSystemConfigs.findOne({
type: SystemConfigsTypeEnum.fastgpt type: SystemConfigsTypeEnum.fastgpt
...@@ -14,5 +19,8 @@ export const getFastGPTConfigFromDB = async () => { ...@@ -14,5 +19,8 @@ export const getFastGPTConfigFromDB = async () => {
const config = res?.value || {}; const config = res?.value || {};
return config as FastGPTConfigFileType; return {
configId: res ? String(res._id) : undefined,
config: config as FastGPTConfigFileType
};
}; };
...@@ -39,8 +39,6 @@ export const computedTemperature = ({ ...@@ -39,8 +39,6 @@ export const computedTemperature = ({
model: LLMModelItemType; model: LLMModelItemType;
temperature: number; temperature: number;
}) => { }) => {
if (temperature < 1) return temperature;
temperature = +(model.maxTemperature * (temperature / 10)).toFixed(2); temperature = +(model.maxTemperature * (temperature / 10)).toFixed(2);
temperature = Math.max(temperature, 0.01); temperature = Math.max(temperature, 0.01);
......
...@@ -2,6 +2,5 @@ import { PluginTemplateType } from '@fastgpt/global/core/plugin/type.d'; ...@@ -2,6 +2,5 @@ import { PluginTemplateType } from '@fastgpt/global/core/plugin/type.d';
import { SystemPluginTemplateItemType } from '@fastgpt/global/core/workflow/type'; import { SystemPluginTemplateItemType } from '@fastgpt/global/core/workflow/type';
declare global { declare global {
var communityPluginsV1: PluginTemplateType[];
var communityPlugins: SystemPluginTemplateItemType[]; var communityPlugins: SystemPluginTemplateItemType[];
} }
...@@ -2,7 +2,7 @@ import { FastGPTFeConfigsType, SystemEnvType } from '@fastgpt/global/common/syst ...@@ -2,7 +2,7 @@ import { FastGPTFeConfigsType, SystemEnvType } from '@fastgpt/global/common/syst
import { import {
AudioSpeechModelType, AudioSpeechModelType,
ReRankModelItemType, ReRankModelItemType,
WhisperModelType, STTModelType,
VectorModelItemType, VectorModelItemType,
LLMModelItemType LLMModelItemType
} from '@fastgpt/global/core/ai/model.d'; } from '@fastgpt/global/core/ai/model.d';
...@@ -12,6 +12,7 @@ import { Worker } from 'worker_threads'; ...@@ -12,6 +12,7 @@ import { Worker } from 'worker_threads';
import { TemplateMarketItemType } from '@fastgpt/global/core/workflow/type'; import { TemplateMarketItemType } from '@fastgpt/global/core/workflow/type';
declare global { declare global {
var systemInitBufferId: string | undefined;
var systemVersion: string; var systemVersion: string;
var feConfigs: FastGPTFeConfigsType; var feConfigs: FastGPTFeConfigsType;
var systemEnv: SystemEnvType; var systemEnv: SystemEnvType;
...@@ -20,7 +21,7 @@ declare global { ...@@ -20,7 +21,7 @@ declare global {
var llmModels: LLMModelItemType[]; var llmModels: LLMModelItemType[];
var vectorModels: VectorModelItemType[]; var vectorModels: VectorModelItemType[];
var audioSpeechModels: AudioSpeechModelType[]; var audioSpeechModels: AudioSpeechModelType[];
var whisperModel: WhisperModelType; var whisperModel: STTModelType;
var reRankModels: ReRankModelItemType[]; var reRankModels: ReRankModelItemType[];
var workerPoll: Record<WorkerNameEnum, WorkerPool>; var workerPoll: Record<WorkerNameEnum, WorkerPool>;
......
...@@ -56,7 +56,7 @@ export const iconPaths = { ...@@ -56,7 +56,7 @@ export const iconPaths = {
'common/loading': () => import('./icons/common/loading.svg'), 'common/loading': () => import('./icons/common/loading.svg'),
'common/logLight': () => import('./icons/common/logLight.svg'), 'common/logLight': () => import('./icons/common/logLight.svg'),
'common/microsoft': () => import('./icons/common/microsoft.svg'), 'common/microsoft': () => import('./icons/common/microsoft.svg'),
'common/modal': () => import('./icons/common/modal.svg'), 'common/model': () => import('./icons/common/model.svg'),
'common/monitor': () => import('./icons/common/monitor.svg'), 'common/monitor': () => import('./icons/common/monitor.svg'),
'common/more': () => import('./icons/common/more.svg'), 'common/more': () => import('./icons/common/more.svg'),
'common/moreFill': () => import('./icons/common/moreFill.svg'), 'common/moreFill': () => import('./icons/common/moreFill.svg'),
...@@ -348,9 +348,11 @@ export const iconPaths = { ...@@ -348,9 +348,11 @@ export const iconPaths = {
'model/doubao': () => import('./icons/model/doubao.svg'), 'model/doubao': () => import('./icons/model/doubao.svg'),
'model/ernie': () => import('./icons/model/ernie.svg'), 'model/ernie': () => import('./icons/model/ernie.svg'),
'model/gemini': () => import('./icons/model/gemini.svg'), 'model/gemini': () => import('./icons/model/gemini.svg'),
'model/groq': () => import('./icons/model/groq.svg'),
'model/huggingface': () => import('./icons/model/huggingface.svg'), 'model/huggingface': () => import('./icons/model/huggingface.svg'),
'model/hunyuan': () => import('./icons/model/hunyuan.svg'), 'model/hunyuan': () => import('./icons/model/hunyuan.svg'),
'model/minimax': () => import('./icons/model/minimax.svg'), 'model/minimax': () => import('./icons/model/minimax.svg'),
'model/mistral': () => import('./icons/model/mistral.svg'),
'model/moonshot': () => import('./icons/model/moonshot.svg'), 'model/moonshot': () => import('./icons/model/moonshot.svg'),
'model/ollama': () => import('./icons/model/ollama.svg'), 'model/ollama': () => import('./icons/model/ollama.svg'),
'model/openai': () => import('./icons/model/openai.svg'), 'model/openai': () => import('./icons/model/openai.svg'),
...@@ -395,7 +397,6 @@ export const iconPaths = { ...@@ -395,7 +397,6 @@ export const iconPaths = {
'support/team/key': () => import('./icons/support/team/key.svg'), 'support/team/key': () => import('./icons/support/team/key.svg'),
'support/team/memberLight': () => import('./icons/support/team/memberLight.svg'), 'support/team/memberLight': () => import('./icons/support/team/memberLight.svg'),
'support/usage/usageRecordLight': () => import('./icons/support/usage/usageRecordLight.svg'), 'support/usage/usageRecordLight': () => import('./icons/support/usage/usageRecordLight.svg'),
'support/user/individuation': () => import('./icons/support/user/individuation.svg'),
'support/user/informLight': () => import('./icons/support/user/informLight.svg'), 'support/user/informLight': () => import('./icons/support/user/informLight.svg'),
'support/user/userFill': () => import('./icons/support/user/userFill.svg'), 'support/user/userFill': () => import('./icons/support/user/userFill.svg'),
'support/user/userLight': () => import('./icons/support/user/userLight.svg'), 'support/user/userLight': () => import('./icons/support/user/userLight.svg'),
......
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
<path d="M10.0289 1.21117C6.70605 1.18232 3.98312 3.85333 3.95427 7.17623C3.92543 10.4991 6.59644 13.2221 9.91933 13.2509H12.0077V10.9953H10.0289C7.95213 11.0183 6.24453 9.35688 6.22146 7.2743C6.19838 5.19172 7.85983 3.48989 9.94241 3.46682H10.0289C12.1058 3.46682 13.7903 5.15134 13.8018 7.22815V12.7721C13.8018 14.8316 12.1231 16.5103 10.0693 16.5334C9.08284 16.5276 8.14251 16.1296 7.45024 15.4316L5.85225 17.0295C6.95988 18.1429 8.4598 18.7775 10.0289 18.7891H10.1097C13.3922 18.7429 16.0286 16.0777 16.0459 12.7952V7.07816C15.9652 3.81872 13.2941 1.21694 10.0289 1.21117Z" fill="#F04E35"/>
</svg>
\ No newline at end of file
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg t="1735012417413" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4293" width="64" height="64"><path d="M3.796984 0h1018.143079v1018.143079h-1018.143079z" fill="#CCCCCC" fill-opacity="0" p-id="4294"></path><path d="M448.476277 1016.17573l-13.151015-498.465883c-26.514143-9.720085 80.597691-135.736502 124.563442-124.61647 128.917065-32.400282 269.060217-237.58793 13.204043-389.757898-774.159938 0-689.33059 951.857722-124.61647 1012.840251z" fill="#B3DDF2" p-id="4295"></path><path d="M446.021067 1015.942405c-230.673041-53.028285-456.425058-375.800853-180.29617-665.504981 63.421829-55.902418-63.262744-220.942351-167.039099-129.919299-275.725873 381.3264 86.908057 796.458332 347.335269 795.42428z" fill="#0055E9" p-id="4296"></path><path d="M408.827028 536.27505c0-2.651414-6.363394 4.576341 0 0z m0 0v39.771214c0 5.302829-7.42396 40.566638-10.605657 55.679699l39.771214 84.845257s26.514143 7.954243 29.165557 10.605657 15.643344 4.507404 21.211314 5.302829l55.6797 34.468385 92.799499-13.257071 119.313642-37.1198 111.359399-95.450914 34.468386-58.331113 29.165557-148.479199-5.302829-68.936771v-60.982529l-60.982528-111.359399-31.816971-39.771214-55.6797-50.376871-47.725457-29.165557-13.257071-7.954243-15.908486-5.302828-29.165557-10.605657-92.799499-23.862729c201.507484 66.285357 217.41597 270.444255 159.084856 368.546583s-184.713426 154.736537-307.564055 143.176371l-21.211314 18.5599z" fill="#00BCFF" p-id="4297"></path><path d="M461.828799 1016.207546c180.29617 47.698943 575.192508-124.425569 570.054068-493.163053 13.267677-164.414199-140.196181-491.471452-389.757898-503.768711 278.218202 56.660723 384.508097 567.720823 23.915757 694.670538-180.338593 45.074043-246.608041-92.799499-233.324456-190.901827-185.535365 9.375401-283.955862 407.209506 29.112529 493.163053z" fill="#0055DF" p-id="4298"></path></svg>
<g clip-path="url(#clip0_19_417)"> \ No newline at end of file
<path d="M8.69132 19.7708L8.43646 10.1106C7.92262 9.92227 9.99843 7.48009 10.8505 7.6956C13.3489 7.06769 16.0648 3.09118 11.1064 0.142151C-3.89673 0.142151 -2.25275 18.589 8.69132 19.7708Z" fill="#B3DDF2"/>
<path d="M8.64384 19.7663C4.17343 18.7386 -0.201612 12.4833 5.14972 6.86892C6.37883 5.78554 3.9237 2.58709 1.91253 4.3511C-3.43099 11.7411 3.5968 19.7863 8.64384 19.7663Z" fill="#0055E9"/>
<path d="M7.92307 10.4705C7.79974 10.5592 7.92307 10.4191 7.92307 10.4705V10.4705ZM7.92307 10.4705V11.2412C7.92307 11.344 7.77919 12.0274 7.71753 12.3203L8.48829 13.9646C8.48829 13.9646 9.00213 14.1187 9.05351 14.1701C9.1049 14.2215 9.35668 14.2575 9.46459 14.2729L10.5436 14.9409L12.3421 14.684L14.6544 13.9646L16.8125 12.1148L17.4805 10.9843L18.0457 8.1068L17.9429 6.77082V5.58898L16.7611 3.43086L16.1445 2.6601L15.0654 1.6838L14.1405 1.11858L13.8836 0.964424L13.5753 0.861657L13.0101 0.656121L11.2116 0.193665C15.1168 1.47826 15.4251 5.43483 14.2947 7.33604C13.1642 9.23725 10.715 10.3348 8.33414 10.1108L7.92307 10.4705Z" fill="#00BCFF"/>
<path d="M8.95026 19.7715C12.4444 20.6959 20.0974 17.3601 19.9978 10.2141C20.2549 7.02775 17.2808 0.68943 12.4444 0.451111C17.8362 1.54919 19.8961 11.4535 12.9079 13.9137C9.41293 14.7872 8.12863 12.1153 8.38607 10.2141C4.79042 10.3958 2.88305 18.1057 8.95026 19.7715Z" fill="#0055DF"/>
</g>
<defs>
<clipPath id="clip0_19_417">
<rect width="20" height="20" fill="white"/>
</clipPath>
</defs>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
<path d="M3.84003 3.39999H6.48003V6.03999H3.84003V3.39999ZM14.4 3.39999H17.04V6.03999H14.4V3.39999Z" fill="#FECE00"/>
<path d="M3.84003 6.03999H6.48003V8.67999H3.84003V6.03999Z" fill="#FFA301"/>
<path d="M3.84003 11.32H6.48003V13.96H3.84003V11.32ZM9.12003 11.32H11.76V13.96H9.12003V11.32ZM14.4 11.32H17.04V13.96H14.4V11.32Z" fill="#FE4900"/>
<path d="M11.76 6.03999H14.4V8.67999H11.76V6.03999Z" fill="#FFA301"/>
<path d="M3.84003 8.67999H6.48003V11.32H3.84003V8.67999Z" fill="#FF6F00"/>
<path d="M3.84003 13.96H6.48003V16.6H3.84003V13.96ZM14.4 13.96H17.04V16.6H14.4V13.96Z" fill="#FE0107"/>
<path d="M11.76 8.67999H14.4V11.32H11.76V8.67999Z" fill="#FF6F00"/>
<path d="M6.47998 6.03999H9.11998V8.67999H6.47998V6.03999ZM14.4 6.03999H17.04V8.67999H14.4V6.03999Z" fill="#FFA301"/>
<path d="M6.47998 8.67999H9.11998V11.32H6.47998V8.67999ZM14.4 8.67999H17.04V11.32H14.4V8.67999ZM9.11998 8.67999H11.76V11.32H9.11998V8.67999Z" fill="#FF6F00"/>
<path d="M2.96002 3.39999H3.84002V16.6H2.96002V3.39999ZM13.52 3.39999H14.4V6.03999H13.52V3.39999ZM10.88 6.03999H11.76V8.67999H10.88V6.03999ZM8.24002 11.32H9.12002V13.96H8.24002V11.32ZM13.52 11.32H14.4V16.6H13.52V11.32Z" fill="#191D1D"/>
</svg>
\ No newline at end of file
<svg viewBox="0 0 600 600" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
<circle cx="300" cy="300" r="300" fill="white" /> <g clip-path="url(#clip0_12804_895)">
<rect x="409.733" y="340.032" width="42.3862" height="151.648" rx="21.1931" fill="#003425" /> <path d="M10 20C15.5229 20 20 15.5229 20 10C20 4.47712 15.5229 0 10 0C4.47712 0 0 4.47712 0 10C0 15.5229 4.47712 20 10 20Z" fill="#003425"/>
<path fill-rule="evenodd" clip-rule="evenodd" <path d="M15.0706 12.0408C15.0706 11.8535 14.9962 11.6738 14.8637 11.5413C14.7312 11.4088 14.5515 11.3344 14.3642 11.3344C14.1768 11.3344 13.9972 11.4088 13.8647 11.5413C13.7322 11.6738 13.6578 11.8535 13.6578 12.0408V15.6829C13.6578 15.8702 13.7322 16.0499 13.8647 16.1824C13.9972 16.3149 14.1768 16.3893 14.3642 16.3893C14.5515 16.3893 14.7312 16.3149 14.8637 16.1824C14.9962 16.0499 15.0706 15.8702 15.0706 15.6829V12.0408Z" fill="white"/>
d="M422.005 133.354C413.089 125.771 399.714 126.851 392.131 135.768L273.699 275.021C270.643 278.614 268.994 282.932 268.698 287.302C268.532 288.371 268.446 289.466 268.446 290.581V468.603C268.446 480.308 277.934 489.796 289.639 489.796C301.344 489.796 310.832 480.308 310.832 468.603V296.784L424.419 163.228C432.002 154.312 430.921 140.937 422.005 133.354Z" <path d="M14.0669 4.44512C13.9962 4.38501 13.9144 4.33941 13.8261 4.31092C13.7378 4.28243 13.6448 4.27162 13.5523 4.27909C13.4598 4.28656 13.3697 4.31218 13.2872 4.35448C13.2046 4.39677 13.1312 4.45492 13.0711 4.5256L9.12338 9.16752C9.02527 9.28249 8.96681 9.426 8.95666 9.5768C8.95106 9.61248 8.94818 9.6488 8.94818 9.68608V15.6202C8.94818 15.8075 9.02261 15.9872 9.15508 16.1197C9.28756 16.2521 9.46723 16.3266 9.65458 16.3266C9.84193 16.3266 10.0216 16.2521 10.1541 16.1197C10.2866 15.9872 10.361 15.8075 10.361 15.6202V9.8928L14.1474 5.44096C14.2075 5.37029 14.2531 5.28847 14.2816 5.20018C14.3101 5.11189 14.3209 5.01885 14.3134 4.92637C14.3059 4.8339 14.2803 4.7438 14.238 4.66123C14.1957 4.57865 14.1376 4.50522 14.0669 4.44512Z" fill="white"/>
fill="#003425" /> <path d="M5.33953 4.12561C5.28072 4.05387 5.20835 3.99441 5.12656 3.95063C5.04477 3.90686 4.95516 3.87962 4.86285 3.87048C4.77053 3.86133 4.67732 3.87046 4.58853 3.89734C4.49974 3.92422 4.41711 3.96832 4.34537 4.02713C4.27363 4.08594 4.21417 4.15831 4.17039 4.2401C4.12662 4.32189 4.09938 4.4115 4.09023 4.50382C4.08109 4.59613 4.09022 4.68935 4.11709 4.77814C4.14397 4.86692 4.18808 4.94955 4.24689 5.02129L7.04401 8.43329C7.16278 8.57821 7.33426 8.67 7.52072 8.68849C7.70717 8.70697 7.89334 8.65063 8.03825 8.53185C8.18316 8.41308 8.27496 8.2416 8.29344 8.05515C8.31193 7.86869 8.25558 7.68253 8.13681 7.53761L5.33937 4.12561H5.33953Z" fill="white"/>
<rect x="113.972" y="134.25" width="42.3862" height="174.745" rx="21.1931" <path d="M15.3376 10.1727C15.5666 10.1727 15.7862 10.0817 15.9482 9.91975C16.1101 9.75783 16.2011 9.53821 16.2011 9.30921C16.2011 9.08021 16.1101 8.86059 15.9482 8.69867C15.7862 8.53674 15.5666 8.44577 15.3376 8.44577C15.1086 8.44577 14.889 8.53674 14.7271 8.69867C14.5652 8.86059 14.4742 9.08021 14.4742 9.30921C14.4742 9.53821 14.5652 9.75783 14.7271 9.91975C14.889 10.0817 15.1086 10.1727 15.3376 10.1727Z" fill="#00FF25"/>
transform="rotate(-39.3441 113.972 134.25)" fill="#003425" /> </g>
<circle cx="460.126" cy="279.278" r="25.9027" fill="#00DD20" /> <defs>
<clipPath id="clip0_12804_895">
<rect width="20" height="20" fill="white"/>
</clipPath>
</defs>
</svg> </svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M8.95334 16.4281C9.05498 16.5828 8.93673 16.8071 8.75405 16.777C7.16443 16.5146 5.94181 15.8533 5.05187 14.9994C3.73702 13.7379 3.01725 11.931 3.01725 9.9769C3.01725 6.18011 6.09515 3.10221 9.89194 3.10221C13.8727 3.10221 16.9827 5.87983 16.9827 9.50285C16.9827 10.4282 16.7524 10.9955 16.4763 11.3538C16.1992 11.7133 15.7615 12.011 15.0821 12.191C14.485 12.3493 13.879 12.3607 13.0988 12.3754C12.9461 12.3782 12.7868 12.3812 12.6195 12.3855C11.7922 12.4065 10.4224 12.4464 9.36346 13.3001C8.72411 13.8156 8.524 14.5121 8.52868 15.0653C8.5328 15.5521 8.68681 15.9446 8.79908 16.1635C8.84683 16.2566 8.89859 16.3447 8.95334 16.4281ZM15.5091 13.8021C17.4217 13.2951 18.6494 11.9261 18.6494 9.50285C18.6494 4.7856 14.6092 1.43555 9.89194 1.43555C5.17468 1.43555 1.35059 5.25964 1.35059 9.9769C1.35059 14.6942 4.8343 19.0091 11.2788 18.5298C12.2308 18.459 12.5569 17.3597 12.122 16.8903C11.89 16.6399 11.5858 16.4575 11.2857 16.2776C10.8812 16.035 10.4842 15.797 10.2821 15.4029C10.214 15.2701 10.0763 14.8663 10.4095 14.5977C11.0553 14.0771 12.0167 14.0611 13.082 14.0434C13.8631 14.0304 14.7 14.0165 15.5091 13.8021ZM6.85887 9.40095C6.85887 10.1411 6.25883 10.7412 5.51863 10.7412C4.77844 10.7412 4.1784 10.1411 4.1784 9.40095C4.1784 8.66076 4.77844 8.06071 5.51863 8.06071C6.25883 8.06071 6.85887 8.66076 6.85887 9.40095ZM8.09584 7.52192C8.83604 7.52192 9.43608 6.92187 9.43608 6.18168C9.43608 5.44149 8.83604 4.84144 8.09584 4.84144C7.35565 4.84144 6.75561 5.44149 6.75561 6.18168C6.75561 6.92187 7.35565 7.52192 8.09584 7.52192ZM13.4525 6.18168C13.4525 6.92187 12.8525 7.52192 12.1123 7.52192C11.3721 7.52192 10.772 6.92187 10.772 6.18168C10.772 5.44149 11.3721 4.84144 12.1123 4.84144C12.8525 4.84144 13.4525 5.44149 13.4525 6.18168ZM14.4814 10.7412C15.2216 10.7412 15.8216 10.1411 15.8216 9.40095C15.8216 8.66076 15.2216 8.06071 14.4814 8.06071C13.7412 8.06071 13.1411 8.66076 13.1411 9.40095C13.1411 10.1411 13.7412 10.7412 14.4814 10.7412Z" />
</svg>
\ No newline at end of file
...@@ -110,7 +110,7 @@ const MySelect = <T = any,>( ...@@ -110,7 +110,7 @@ const MySelect = <T = any,>(
px={3} px={3}
rightIcon={<MyIcon name={'core/chat/chevronDown'} w={4} color={'myGray.500'} />} rightIcon={<MyIcon name={'core/chat/chevronDown'} w={4} color={'myGray.500'} />}
variant={'whitePrimaryOutline'} variant={'whitePrimaryOutline'}
size={'lg'} size={'md'}
fontSize={'sm'} fontSize={'sm'}
textAlign={'left'} textAlign={'left'}
_active={{ _active={{
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"bills_and_invoices": "Bills", "bills_and_invoices": "Bills",
"confirm_logout": "Confirm to log out?", "confirm_logout": "Confirm to log out?",
"logout": "Sign out", "logout": "Sign out",
"model_provider": "Model Provider",
"notifications": "Notify", "notifications": "Notify",
"personal_information": "Personal", "personal_information": "Personal",
"personalization": "Personalization", "personalization": "Personalization",
......
...@@ -896,6 +896,15 @@ ...@@ -896,6 +896,15 @@
"item_name": "Field Name", "item_name": "Field Name",
"just_now": "just", "just_now": "just",
"key_repetition": "Key Repetition", "key_repetition": "Key Repetition",
"model.billing": "Billing",
"model.model_type": "Model type",
"model.name": "Model name",
"model.provider": "Provider",
"model.search_name_placeholder": "Search by model name",
"model.type.chat": "language model",
"model.type.embedding": "Embedding",
"model.type.stt": "speech recognition",
"model.type.tts": "TTS",
"model_baichuan": "Baichuan", "model_baichuan": "Baichuan",
"model_chatglm": "ChatGLM", "model_chatglm": "ChatGLM",
"model_doubao": "Doubao", "model_doubao": "Doubao",
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
"delete.failed": "Delete failed", "delete.failed": "Delete failed",
"delete.success": "Delete successfully", "delete.success": "Delete successfully",
"has_chosen": "Selected", "has_chosen": "Selected",
"individuation": "Individuation",
"login.error": "Login Error", "login.error": "Login Error",
"login.password_condition": "Password can be up to 60 characters", "login.password_condition": "Password can be up to 60 characters",
"login.success": "Login Successful", "login.success": "Login Successful",
......
{ {
"personal_information": "个人信息",
"usage_records": "使用记录",
"bills_and_invoices": "账单与发票",
"promotion_records": "促销记录",
"api_key": "API 密钥", "api_key": "API 密钥",
"personalization": "个性化", "bills_and_invoices": "账单与发票",
"notifications": "通知",
"logout": "登出",
"confirm_logout": "确认退出登录?", "confirm_logout": "确认退出登录?",
"team": "团队管理" "logout": "登出",
"model_provider": "模型提供商",
"notifications": "通知",
"personal_information": "个人信息",
"personalization": "个性化",
"promotion_records": "促销记录",
"team": "团队管理",
"usage_records": "使用记录"
} }
...@@ -895,13 +895,22 @@ ...@@ -895,13 +895,22 @@
"item_name": "字段名", "item_name": "字段名",
"just_now": "刚刚", "just_now": "刚刚",
"key_repetition": "key 重复", "key_repetition": "key 重复",
"model.billing": "模型计费",
"model.model_type": "模型类型",
"model.name": "模型名",
"model.provider": "模型提供商",
"model.search_name_placeholder": "根据模型名搜索",
"model.type.chat": "语言模型",
"model.type.embedding": "索引模型",
"model.type.stt": "语音识别",
"model.type.tts": "语音合成",
"model_baichuan": "百川智能", "model_baichuan": "百川智能",
"model_chatglm": "ChatGLM", "model_chatglm": "ChatGLM",
"model_doubao": "豆包", "model_doubao": "豆包",
"model_ernie": "文心一言", "model_ernie": "文心一言",
"model_hunyuan": "腾讯混元", "model_hunyuan": "腾讯混元",
"model_moonshot": "月之暗面", "model_moonshot": "月之暗面",
"model_other": "自定义", "model_other": "其他",
"model_qwen": "阿里千问", "model_qwen": "阿里千问",
"model_sparkdesk": "讯飞星火", "model_sparkdesk": "讯飞星火",
"model_yi": "零一万物", "model_yi": "零一万物",
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
"delete.failed": "删除失败", "delete.failed": "删除失败",
"delete.success": "删除成功", "delete.success": "删除成功",
"has_chosen": "已选择", "has_chosen": "已选择",
"individuation": "个性化",
"login.error": "登录异常", "login.error": "登录异常",
"login.password_condition": "密码最多 60 位", "login.password_condition": "密码最多 60 位",
"login.success": "登录成功", "login.success": "登录成功",
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"bills_and_invoices": "帳單與發票", "bills_and_invoices": "帳單與發票",
"confirm_logout": "確認登出登入?", "confirm_logout": "確認登出登入?",
"logout": "登出", "logout": "登出",
"model_provider": "模型提供者",
"notifications": "通知", "notifications": "通知",
"personal_information": "個人資訊", "personal_information": "個人資訊",
"personalization": "個人化", "personalization": "個人化",
......
...@@ -897,13 +897,21 @@ ...@@ -897,13 +897,21 @@
"item_name": "欄位名稱", "item_name": "欄位名稱",
"just_now": "剛剛", "just_now": "剛剛",
"key_repetition": "鍵值重複", "key_repetition": "鍵值重複",
"model.billing": "模型計費",
"model.model_type": "模型類型",
"model.name": "模型名",
"model.provider": "模型提供者",
"model.search_name_placeholder": "根據模型名搜尋",
"model.type.chat": "語言模型",
"model.type.stt": "語音辨識",
"model.type.tts": "語音合成",
"model_baichuan": "百川智能", "model_baichuan": "百川智能",
"model_chatglm": "ChatGLM", "model_chatglm": "ChatGLM",
"model_doubao": "豆包", "model_doubao": "豆包",
"model_ernie": "文心一言", "model_ernie": "文心一言",
"model_hunyuan": "騰訊混元", "model_hunyuan": "騰訊混元",
"model_moonshot": "月之暗面", "model_moonshot": "月之暗面",
"model_other": "自訂", "model_other": "其他",
"model_qwen": "阿里千問", "model_qwen": "阿里千問",
"model_sparkdesk": "訊飛星火", "model_sparkdesk": "訊飛星火",
"model_yi": "零一萬物", "model_yi": "零一萬物",
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
"delete.failed": "刪除失敗", "delete.failed": "刪除失敗",
"delete.success": "刪除成功", "delete.success": "刪除成功",
"has_chosen": "已選擇", "has_chosen": "已選擇",
"individuation": "個人化",
"login.error": "登入失敗", "login.error": "登入失敗",
"login.password_condition": "密碼最多可輸入 60 個字元", "login.password_condition": "密碼最多可輸入 60 個字元",
"login.success": "登入成功", "login.success": "登入成功",
......
...@@ -3,7 +3,7 @@ import account_team from '../i18n/zh-CN/account_team.json'; ...@@ -3,7 +3,7 @@ import account_team from '../i18n/zh-CN/account_team.json';
import account from '../i18n/zh-CN/account.json'; import account from '../i18n/zh-CN/account.json';
import account_promotion from '../i18n/zh-CN/account_promotion.json'; import account_promotion from '../i18n/zh-CN/account_promotion.json';
import account_inform from '../i18n/zh-CN/account_inform.json'; import account_inform from '../i18n/zh-CN/account_inform.json';
import account_individuation from '../i18n/zh-CN/account_individuation.json'; import account_setting from '../i18n/zh-CN/account_setting.json';
import account_apikey from '../i18n/zh-CN/account_apikey.json'; import account_apikey from '../i18n/zh-CN/account_apikey.json';
import account_bill from '../i18n/zh-CN/account_bill.json'; import account_bill from '../i18n/zh-CN/account_bill.json';
import account_usage from '../i18n/zh-CN/account_usage.json'; import account_usage from '../i18n/zh-CN/account_usage.json';
...@@ -32,7 +32,7 @@ export interface I18nNamespaces { ...@@ -32,7 +32,7 @@ export interface I18nNamespaces {
account_usage: typeof account_usage; account_usage: typeof account_usage;
account_bill: typeof account_bill; account_bill: typeof account_bill;
account_apikey: typeof account_apikey; account_apikey: typeof account_apikey;
account_individuation: typeof account_individuation; account_setting: typeof account_setting;
account_inform: typeof account_inform; account_inform: typeof account_inform;
account_promotion: typeof account_promotion; account_promotion: typeof account_promotion;
account: typeof account; account: typeof account;
...@@ -66,7 +66,7 @@ declare module 'i18next' { ...@@ -66,7 +66,7 @@ declare module 'i18next' {
'account_usage', 'account_usage',
'account_bill', 'account_bill',
'account_apikey', 'account_apikey',
'account_individuation', 'account_setting',
'account_inform', 'account_inform',
'account_promotion', 'account_promotion',
'account', 'account',
......
...@@ -61,7 +61,7 @@ const Layout = ({ children }: { children: JSX.Element }) => { ...@@ -61,7 +61,7 @@ const Layout = ({ children }: { children: JSX.Element }) => {
// System hook // System hook
const { data, refetch: refetchUnRead } = useQuery(['getUnreadCount'], getUnreadCount, { const { data, refetch: refetchUnRead } = useQuery(['getUnreadCount'], getUnreadCount, {
enabled: !!userInfo && !!feConfigs.isPlus, enabled: !!userInfo && !!feConfigs.isPlus,
refetchInterval: 10000 refetchInterval: 30000
}); });
const unread = data?.unReadCount || 0; const unread = data?.unReadCount || 0;
const importantInforms = data?.importantInforms || []; const importantInforms = data?.importantInforms || [];
......
...@@ -83,9 +83,10 @@ const Navbar = ({ unread }: { unread: number }) => { ...@@ -83,9 +83,10 @@ const Navbar = ({ unread }: { unread: number }) => {
'/account/team', '/account/team',
'/account/usage', '/account/usage',
'/account/apikey', '/account/apikey',
'/account/individuation', '/account/setting',
'/account/inform', '/account/inform',
'/account/promotion' '/account/promotion',
'/account/model'
] ]
} }
], ],
......
...@@ -55,9 +55,10 @@ const NavbarPhone = ({ unread }: { unread: number }) => { ...@@ -55,9 +55,10 @@ const NavbarPhone = ({ unread }: { unread: number }) => {
'/account/team', '/account/team',
'/account/usage', '/account/usage',
'/account/apikey', '/account/apikey',
'/account/individuation', '/account/setting',
'/account/inform', '/account/inform',
'/account/promotion' '/account/promotion',
'/account/model'
], ],
unread unread
} }
......
...@@ -12,8 +12,8 @@ import { ModelProviderList } from '@fastgpt/global/core/ai/provider'; ...@@ -12,8 +12,8 @@ import { ModelProviderList } from '@fastgpt/global/core/ai/provider';
import MultipleRowSelect from '@fastgpt/web/components/common/MySelect/MultipleRowSelect'; import MultipleRowSelect from '@fastgpt/web/components/common/MySelect/MultipleRowSelect';
import { getModelFromList } from '@fastgpt/global/core/ai/model'; import { getModelFromList } from '@fastgpt/global/core/ai/model';
const AiPointsModal = dynamic(() => const ModelPriceModal = dynamic(() =>
import('@/pages/price/components/Points').then((mod) => mod.AiPointsModal) import('@/components/core/ai/ModelTable').then((mod) => mod.ModelPriceModal)
); );
type Props = SelectProps & { type Props = SelectProps & {
...@@ -103,7 +103,7 @@ const OneRowSelector = ({ list, onchange, disableTip, ...props }: Props) => { ...@@ -103,7 +103,7 @@ const OneRowSelector = ({ list, onchange, disableTip, ...props }: Props) => {
/> />
</MyTooltip> </MyTooltip>
{isOpenAiPointsModal && <AiPointsModal onClose={onCloseAiPointsModal} />} {isOpenAiPointsModal && <ModelPriceModal onClose={onCloseAiPointsModal} />}
</Box> </Box>
); );
}; };
...@@ -212,7 +212,7 @@ const MultipleRowSelector = ({ list, onchange, disableTip, ...props }: Props) => ...@@ -212,7 +212,7 @@ const MultipleRowSelector = ({ list, onchange, disableTip, ...props }: Props) =>
/> />
</MyTooltip> </MyTooltip>
{isOpenAiPointsModal && <AiPointsModal onClose={onCloseAiPointsModal} />} {isOpenAiPointsModal && <ModelPriceModal onClose={onCloseAiPointsModal} />}
</Box> </Box>
); );
}; };
......
...@@ -33,8 +33,8 @@ import MyIcon from '@fastgpt/web/components/common/Icon'; ...@@ -33,8 +33,8 @@ import MyIcon from '@fastgpt/web/components/common/Icon';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
import InputSlider from '@fastgpt/web/components/common/MySlider/InputSlider'; import InputSlider from '@fastgpt/web/components/common/MySlider/InputSlider';
const AiPointsModal = dynamic(() => const ModelPriceModal = dynamic(() =>
import('@/pages/price/components/Points').then((mod) => mod.AiPointsModal) import('@/components/core/ai/ModelTable').then((mod) => mod.ModelPriceModal)
); );
const FlexItemStyles: FlexProps = { const FlexItemStyles: FlexProps = {
...@@ -328,7 +328,7 @@ const AIChatSettingsModal = ({ ...@@ -328,7 +328,7 @@ const AIChatSettingsModal = ({
</Button> </Button>
</ModalFooter> </ModalFooter>
{isOpenAiPointsModal && <AiPointsModal onClose={onCloseAiPointsModal} />} {isOpenAiPointsModal && <ModelPriceModal onClose={onCloseAiPointsModal} />}
</MyModal> </MyModal>
); );
}; };
......
import {
Box,
Flex,
HStack,
ModalBody,
Table,
TableContainer,
Tbody,
Td,
Th,
Thead,
Tr
} from '@chakra-ui/react';
import MyModal from '@fastgpt/web/components/common/MyModal';
import { useTranslation } from 'next-i18next';
import React, { useMemo, useRef, useState } from 'react';
import {
ModelProviderList,
ModelProviderIdType,
getModelProvider
} from '@fastgpt/global/core/ai/provider';
import MySelect from '@fastgpt/web/components/common/MySelect';
import { modelTypeList, ModelTypeEnum } from '@fastgpt/global/core/ai/model';
import SearchInput from '@fastgpt/web/components/common/Input/SearchInput';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import Avatar from '@fastgpt/web/components/common/Avatar';
import MyTag from '@fastgpt/web/components/common/Tag/index';
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
const ModelTable = () => {
const { t } = useTranslation();
const [provider, setProvider] = useState<ModelProviderIdType | ''>('');
const providerList = useRef<{ label: any; value: ModelProviderIdType | '' }[]>([
{ label: t('common:common.All'), value: '' },
...ModelProviderList.map((item) => ({
label: (
<HStack>
<Avatar src={item.avatar} w={'1rem'} />
<Box>{t(item.name as any)}</Box>
</HStack>
),
value: item.id
}))
]);
const [modelType, setModelType] = useState<ModelTypeEnum | ''>('');
const selectModelTypeList = useRef<{ label: string; value: ModelTypeEnum | '' }[]>([
{ label: t('common:common.All'), value: '' },
...modelTypeList.map((item) => ({ label: t(item.label), value: item.value }))
]);
const [search, setSearch] = useState('');
const { llmModelList, audioSpeechModelList, vectorModelList, whisperModel } = useSystemStore();
const modelList = useMemo(() => {
const formatLLMModelList = llmModelList.map((item) => ({
...item,
typeLabel: t('common:model.type.chat'),
priceLabel: (
<Flex color={'myGray.700'}>
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
{item.charsPointsPrice}
</Box>
{`${t('common:support.wallet.subscription.point')} / 1K Tokens`}
</Flex>
),
tagColor: 'blue'
}));
const formatVectorModelList = vectorModelList.map((item) => ({
...item,
typeLabel: t('common:model.type.embedding'),
priceLabel: (
<Flex color={'myGray.700'}>
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
{item.charsPointsPrice}
</Box>
{` ${t('common:support.wallet.subscription.point')} / 1K Tokens`}
</Flex>
),
tagColor: 'yellow'
}));
const formatAudioSpeechModelList = audioSpeechModelList.map((item) => ({
...item,
typeLabel: t('common:model.type.tts'),
priceLabel: (
<Flex color={'myGray.700'}>
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
{item.charsPointsPrice}
</Box>
{` ${t('common:support.wallet.subscription.point')} / 1K ${t('common:unit.character')}`}
</Flex>
),
tagColor: 'green'
}));
const formatWhisperModel = {
...whisperModel,
typeLabel: t('common:model.type.stt'),
priceLabel: (
<Flex color={'myGray.700'}>
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
{whisperModel.charsPointsPrice}
</Box>
{` ${t('common:support.wallet.subscription.point')} / 60${t('common:unit.seconds')}`}
</Flex>
),
tagColor: 'purple'
};
const list = (() => {
if (modelType === ModelTypeEnum.chat) return formatLLMModelList;
if (modelType === ModelTypeEnum.embedding) return formatVectorModelList;
if (modelType === ModelTypeEnum.tts) return formatAudioSpeechModelList;
if (modelType === ModelTypeEnum.stt) return [formatWhisperModel];
return [
...formatLLMModelList,
...formatVectorModelList,
...formatAudioSpeechModelList,
formatWhisperModel
];
})();
const formatList = list.map((item) => {
const provider = getModelProvider(item.provider);
return {
name: item.name,
avatar: provider.avatar,
providerId: provider.id,
providerName: t(provider.name as any),
typeLabel: item.typeLabel,
priceLabel: item.priceLabel,
order: provider.order,
tagColor: item.tagColor
};
});
formatList.sort((a, b) => a.order - b.order);
const filterList = formatList.filter((item) => {
const providerFilter = provider ? item.providerId === provider : true;
const regx = new RegExp(search, 'i');
const nameFilter = search ? regx.test(item.name) : true;
return providerFilter && nameFilter;
});
return filterList;
}, [
provider,
modelType,
llmModelList,
vectorModelList,
audioSpeechModelList,
whisperModel,
t,
search
]);
return (
<Flex flexDirection={'column'} h={'100%'}>
<Flex>
<HStack flexShrink={0}>
<Box fontSize={'sm'} color={'myGray.900'}>
{t('common:model.provider')}
</Box>
<MySelect
w={'200px'}
bg={'myGray.50'}
value={provider}
onchange={setProvider}
list={providerList.current}
/>
</HStack>
<HStack flexShrink={0} ml={6}>
<Box fontSize={'sm'} color={'myGray.900'}>
{t('common:model.model_type')}
</Box>
<MySelect
w={'150px'}
bg={'myGray.50'}
value={modelType}
onchange={setModelType}
list={selectModelTypeList.current}
/>
</HStack>
<Box flex={1} />
<Box flex={'0 0 250px'}>
<SearchInput
bg={'myGray.50'}
value={search}
onChange={(e) => setSearch(e.target.value)}
placeholder={t('common:model.search_name_placeholder')}
/>
</Box>
</Flex>
<TableContainer mt={5} flex={'1 0 0'} h={0} overflowY={'auto'}>
<Table>
<Thead>
<Tr color={'myGray.600'}>
<Th fontSize={'xs'}>{t('common:model.name')}</Th>
<Th fontSize={'xs'}>{t('common:model.model_type')}</Th>
<Th fontSize={'xs'}>{t('common:model.billing')}</Th>
</Tr>
</Thead>
<Tbody>
{modelList.map((item) => (
<Tr key={item.name} _hover={{ bg: 'myGray.50' }}>
<Td fontSize={'sm'}>
<MyTooltip title={item.providerName}>
<HStack>
<Avatar src={item.avatar} w={'1.2rem'} />
<Box color={'myGray.900'}>{item.name}</Box>
</HStack>
</MyTooltip>
</Td>
<Td>
<MyTag colorSchema={item.tagColor as any}>{item.typeLabel}</MyTag>
</Td>
<Td fontSize={'sm'}>{item.priceLabel}</Td>
</Tr>
))}
</Tbody>
</Table>
</TableContainer>
</Flex>
);
};
export default ModelTable;
export const ModelPriceModal = ({ onClose }: { onClose: () => void }) => {
const { t } = useTranslation();
return (
<MyModal
isCentered
iconSrc="/imgs/modal/bill.svg"
title={t('common:support.wallet.subscription.Ai points')}
isOpen
onClose={onClose}
w={'100%'}
h={'100%'}
maxW={'90vw'}
maxH={'90vh'}
>
<ModalBody flex={'1 0 0'}>
<ModelTable />
</ModalBody>
</MyModal>
);
};
...@@ -8,8 +8,8 @@ import { useTranslation } from 'next-i18next'; ...@@ -8,8 +8,8 @@ import { useTranslation } from 'next-i18next';
import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip'; import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
const AiPointsModal = dynamic(() => const ModelPriceModal = dynamic(() =>
import('@/pages/price/components/Points').then((mod) => mod.AiPointsModal) import('@/components/core/ai/ModelTable').then((mod) => mod.ModelPriceModal)
); );
const StandardPlanContentList = ({ const StandardPlanContentList = ({
...@@ -127,7 +127,7 @@ const StandardPlanContentList = ({ ...@@ -127,7 +127,7 @@ const StandardPlanContentList = ({
<Box color={'myGray.600'}>{t('common:support.wallet.subscription.web_site_sync')}</Box> <Box color={'myGray.600'}>{t('common:support.wallet.subscription.web_site_sync')}</Box>
</Flex> </Flex>
)} )}
{isOpenAiPointsModal && <AiPointsModal onClose={onCloseAiPointsModal} />} {isOpenAiPointsModal && <ModelPriceModal onClose={onCloseAiPointsModal} />}
</Grid> </Grid>
) : null; ) : null;
}; };
......
...@@ -2,7 +2,7 @@ import type { ...@@ -2,7 +2,7 @@ import type {
LLMModelItemType, LLMModelItemType,
VectorModelItemType, VectorModelItemType,
AudioSpeechModels, AudioSpeechModels,
WhisperModelType, STTModelType,
ReRankModelItemType ReRankModelItemType
} from '@fastgpt/global/core/ai/model.d'; } from '@fastgpt/global/core/ai/model.d';
...@@ -10,11 +10,12 @@ import type { FastGPTFeConfigsType } from '@fastgpt/global/common/system/types/i ...@@ -10,11 +10,12 @@ import type { FastGPTFeConfigsType } from '@fastgpt/global/common/system/types/i
import { SubPlanType } from '@fastgpt/global/support/wallet/sub/type'; import { SubPlanType } from '@fastgpt/global/support/wallet/sub/type';
export type InitDateResponse = { export type InitDateResponse = {
bufferId?: string;
llmModels: LLMModelItemType[]; llmModels: LLMModelItemType[];
vectorModels: VectorModelItemType[]; vectorModels: VectorModelItemType[];
audioSpeechModels: AudioSpeechModels[]; audioSpeechModels: AudioSpeechModels[];
reRankModels: ReRankModelItemType[]; reRankModels: ReRankModelItemType[];
whisperModel: WhisperModelType; whisperModel: STTModelType;
feConfigs: FastGPTFeConfigsType; feConfigs: FastGPTFeConfigsType;
subPlans?: SubPlanType; subPlans?: SubPlanType;
systemVersion: string; systemVersion: string;
......
...@@ -8,9 +8,7 @@ import PageContainer from '@/components/PageContainer'; ...@@ -8,9 +8,7 @@ import PageContainer from '@/components/PageContainer';
import SideTabs from '@/components/SideTabs'; import SideTabs from '@/components/SideTabs';
import LightRowTabs from '@fastgpt/web/components/common/Tabs/LightRowTabs'; import LightRowTabs from '@fastgpt/web/components/common/Tabs/LightRowTabs';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import Script from 'next/script';
import { useSystem } from '@fastgpt/web/hooks/useSystem'; import { useSystem } from '@fastgpt/web/hooks/useSystem';
import { getWebReqUrl } from '@fastgpt/web/common/system/utils';
export enum TabEnum { export enum TabEnum {
'info' = 'info', 'info' = 'info',
...@@ -18,10 +16,11 @@ export enum TabEnum { ...@@ -18,10 +16,11 @@ export enum TabEnum {
'usage' = 'usage', 'usage' = 'usage',
'bill' = 'bill', 'bill' = 'bill',
'inform' = 'inform', 'inform' = 'inform',
'individuation' = 'individuation', 'setting' = 'setting',
'apikey' = 'apikey', 'apikey' = 'apikey',
'loginout' = 'loginout', 'loginout' = 'loginout',
'team' = 'team' 'team' = 'team',
'model' = 'model'
} }
const AccountContainer = ({ const AccountContainer = ({
...@@ -71,6 +70,11 @@ const AccountContainer = ({ ...@@ -71,6 +70,11 @@ const AccountContainer = ({
} }
] ]
: []), : []),
{
icon: 'common/model',
label: t('account:model_provider'),
value: TabEnum.model
},
...(feConfigs?.show_promotion && userInfo?.team?.permission.isOwner ...(feConfigs?.show_promotion && userInfo?.team?.permission.isOwner
? [ ? [
{ {
...@@ -89,11 +93,7 @@ const AccountContainer = ({ ...@@ -89,11 +93,7 @@ const AccountContainer = ({
} }
] ]
: []), : []),
{
icon: 'support/user/individuation',
label: t('account:personalization'),
value: TabEnum.individuation
},
...(feConfigs.isPlus ...(feConfigs.isPlus
? [ ? [
{ {
...@@ -104,6 +104,11 @@ const AccountContainer = ({ ...@@ -104,6 +104,11 @@ const AccountContainer = ({
] ]
: []), : []),
{ {
icon: 'common/settingLight',
label: t('common:common.Setting'),
value: TabEnum.setting
},
{
icon: 'support/account/loginoutLight', icon: 'support/account/loginoutLight',
label: t('account:logout'), label: t('account:logout'),
value: TabEnum.loginout value: TabEnum.loginout
......
...@@ -48,15 +48,16 @@ import { serviceSideProps } from '@fastgpt/web/common/system/nextjs'; ...@@ -48,15 +48,16 @@ import { serviceSideProps } from '@fastgpt/web/common/system/nextjs';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import TeamSelector from '../components/TeamSelector'; import TeamSelector from '../components/TeamSelector';
const StandDetailModal = dynamic(() => import('./components/standardDetailModal')); const StandDetailModal = dynamic(() => import('./components/standardDetailModal'), { ssr: false });
const ConversionModal = dynamic(() => import('./components/ConversionModal')); const ConversionModal = dynamic(() => import('./components/ConversionModal'));
const UpdatePswModal = dynamic(() => import('./components/UpdatePswModal')); const UpdatePswModal = dynamic(() => import('./components/UpdatePswModal'));
const UpdateNotification = dynamic(() => import('./components/UpdateNotificationModal')); const UpdateNotification = dynamic(() => import('./components/UpdateNotificationModal'));
const OpenAIAccountModal = dynamic(() => import('./components/OpenAIAccountModal')); const OpenAIAccountModal = dynamic(() => import('./components/OpenAIAccountModal'));
const LafAccountModal = dynamic(() => import('@/components/support/laf/LafAccountModal')); const LafAccountModal = dynamic(() => import('@/components/support/laf/LafAccountModal'));
const CommunityModal = dynamic(() => import('@/components/CommunityModal')); const CommunityModal = dynamic(() => import('@/components/CommunityModal'));
const AiPointsModal = dynamic(() =>
import('@/pages/price/components/Points').then((mod) => mod.AiPointsModal) const ModelPriceModal = dynamic(() =>
import('@/components/core/ai/ModelTable').then((mod) => mod.ModelPriceModal)
); );
const Info = () => { const Info = () => {
...@@ -583,7 +584,7 @@ const PlanUsage = () => { ...@@ -583,7 +584,7 @@ const PlanUsage = () => {
</Box> </Box>
</Box> </Box>
{isOpenStandardModal && <StandDetailModal onClose={onCloseStandardModal} />} {isOpenStandardModal && <StandDetailModal onClose={onCloseStandardModal} />}
{isOpenAiPointsModal && <AiPointsModal onClose={onCloseAiPointsModal} />} {isOpenAiPointsModal && <ModelPriceModal onClose={onCloseAiPointsModal} />}
</Box> </Box>
) : null; ) : null;
}; };
......
import { serviceSideProps } from '@fastgpt/web/common/system/nextjs';
import React from 'react';
import AccountContainer from '../components/AccountContainer';
import { Box } from '@chakra-ui/react';
import ModelTable from '@/components/core/ai/ModelTable';
const ModelProvider = () => {
return (
<AccountContainer>
<Box h={'100%'} py={4} px={6}>
<ModelTable />
</Box>
</AccountContainer>
);
};
export async function getServerSideProps(content: any) {
return {
props: {
...(await serviceSideProps(content, ['account']))
}
};
}
export default ModelProvider;
...@@ -28,7 +28,7 @@ const Individuation = () => { ...@@ -28,7 +28,7 @@ const Individuation = () => {
}); });
reset(data); reset(data);
toast({ toast({
title: t('account_individuation:update_data_success'), title: t('account_setting:update_data_success'),
status: 'success' status: 'success'
}); });
}, },
...@@ -39,19 +39,19 @@ const Individuation = () => { ...@@ -39,19 +39,19 @@ const Individuation = () => {
<AccountContainer> <AccountContainer>
<Box py={[3, '28px']} px={['5vw', '64px']}> <Box py={[3, '28px']} px={['5vw', '64px']}>
<Flex alignItems={'center'} fontSize={'lg'} h={'30px'}> <Flex alignItems={'center'} fontSize={'lg'} h={'30px'}>
<MyIcon mr={2} name={'support/user/individuation'} w={'20px'} /> <MyIcon mr={2} name={'common/settingLight'} w={'20px'} />
{t('account_individuation:personalization')} {t('common:common.Setting')}
</Flex> </Flex>
<Card mt={6} px={[3, 10]} py={[3, 7]} fontSize={'sm'}> <Card mt={6} px={[3, 10]} py={[3, 7]} fontSize={'sm'}>
<Flex alignItems={'center'} w={['85%', '350px']}> <Flex alignItems={'center'} w={['85%', '350px']}>
<Box flex={'0 0 80px'}>{t('account_individuation:language')}:&nbsp;</Box> <Box flex={'0 0 80px'}>{t('account_setting:language')}:&nbsp;</Box>
<Box flex={'1 0 0'}> <Box flex={'1 0 0'}>
<I18nLngSelector /> <I18nLngSelector />
</Box> </Box>
</Flex> </Flex>
<Flex mt={6} alignItems={'center'} w={['85%', '350px']}> <Flex mt={6} alignItems={'center'} w={['85%', '350px']}>
<Box flex={'0 0 80px'}>{t('account_individuation:timezone')}:&nbsp;</Box> <Box flex={'0 0 80px'}>{t('account_setting:timezone')}:&nbsp;</Box>
<TimezoneSelect <TimezoneSelect
value={userInfo?.timezone} value={userInfo?.timezone}
onChange={(e) => { onChange={(e) => {
...@@ -69,7 +69,7 @@ const Individuation = () => { ...@@ -69,7 +69,7 @@ const Individuation = () => {
export async function getServerSideProps(content: any) { export async function getServerSideProps(content: any) {
return { return {
props: { props: {
...(await serviceSideProps(content, ['account', 'account_individuation'])) ...(await serviceSideProps(content, ['account', 'account_setting']))
} }
}; };
} }
......
import type { NextApiRequest, NextApiResponse } from 'next'; import type { NextApiResponse } from 'next';
import type { InitDateResponse } from '@/global/common/api/systemRes'; import { ApiRequestProps } from '@fastgpt/service/type/next';
import { connectToDatabase } from '@/service/mongo'; import { NextAPI } from '@/service/middleware/entry';
import { jsonRes } from '@fastgpt/service/common/response';
async function handler(req: NextApiRequest, res: NextApiResponse) { async function handler(req: ApiRequestProps<{}, { bufferId?: string }>, res: NextApiResponse) {
await connectToDatabase(); const { bufferId } = req.query;
jsonRes<InitDateResponse>(res, { // If bufferId is the same as the current bufferId, return directly
data: { if (bufferId && global.systemInitBufferId && global.systemInitBufferId === bufferId) {
feConfigs: global.feConfigs, return {
subPlans: global.subPlans, bufferId: global.systemInitBufferId
llmModels: global.llmModels.map((model) => ({ };
...model, }
customCQPrompt: '',
customExtractPrompt: '', return {
defaultSystemChatPrompt: '' bufferId: global.systemInitBufferId,
})), feConfigs: global.feConfigs,
vectorModels: global.vectorModels, subPlans: global.subPlans,
reRankModels: llmModels: global.llmModels.map((model) => ({
global.reRankModels?.map((item) => ({ ...model,
...item, customCQPrompt: '',
requestUrl: '', customExtractPrompt: '',
requestAuth: '' defaultSystemChatPrompt: ''
})) || [], })),
whisperModel: global.whisperModel, vectorModels: global.vectorModels,
audioSpeechModels: global.audioSpeechModels, reRankModels:
systemVersion: global.systemVersion || '0.0.0' global.reRankModels?.map((item) => ({
} ...item,
}); requestUrl: '',
requestAuth: ''
})) || [],
whisperModel: global.whisperModel,
audioSpeechModels: global.audioSpeechModels,
systemVersion: global.systemVersion || '0.0.0'
};
} }
export default handler; export default NextAPI(handler);
...@@ -109,7 +109,7 @@ const ExtraPlan = () => { ...@@ -109,7 +109,7 @@ const ExtraPlan = () => {
return ( return (
<Flex <Flex
mt={['40px', '200px']} mt={['40px', '100px']}
flexDirection={'column'} flexDirection={'column'}
alignItems={'center'} alignItems={'center'}
position={'relative'} position={'relative'}
......
...@@ -41,7 +41,7 @@ const FAQ = () => { ...@@ -41,7 +41,7 @@ const FAQ = () => {
return ( return (
<Flex <Flex
mt={['40px', '200px']} mt={['40px', '100px']}
pb={'10vh'} pb={'10vh'}
flexDirection={'column'} flexDirection={'column'}
alignItems={'center'} alignItems={'center'}
......
import React from 'react'; import React from 'react';
import { Box, Flex, Grid, Link, ModalBody } from '@chakra-ui/react'; import { Box, Flex, Grid, Link } from '@chakra-ui/react';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useSystemStore } from '@/web/common/system/useSystemStore';
import MyModal from '@fastgpt/web/components/common/MyModal'; import ModelTable from '@/components/core/ai/ModelTable';
const Points = () => { const Points = () => {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<Flex <Flex
mt={['40px', '200px']} mt={['40px', '100px']}
flexDirection={'column'} flexDirection={'column'}
alignItems={'center'} alignItems={'center'}
position={'relative'} position={'relative'}
...@@ -17,10 +17,12 @@ const Points = () => { ...@@ -17,10 +17,12 @@ const Points = () => {
<Box id="point-card" fontWeight={'bold'} fontSize={['24px', '36px']} color={'myGray.900'}> <Box id="point-card" fontWeight={'bold'} fontSize={['24px', '36px']} color={'myGray.900'}>
{t('common:support.wallet.subscription.Ai points')} {t('common:support.wallet.subscription.Ai points')}
</Box> </Box>
<Link href="https://tiktokenizer.vercel.app/" target="_blank" mb={['30px', 14]}> <Link href="https://tiktokenizer.vercel.app/" target="_blank" mb={['30px', 10]}>
{t('common:support.wallet.subscription.token_compute')} {t('common:support.wallet.subscription.token_compute')}
</Link> </Link>
<AiPointsTable /> <Box p={5} w={'100%'} h={'666px'} bg={'white'} borderRadius={'lg'} boxShadow={'md'}>
<ModelTable />
</Box>
</Flex> </Flex>
); );
}; };
...@@ -150,24 +152,3 @@ export const AiPointsTable = () => { ...@@ -150,24 +152,3 @@ export const AiPointsTable = () => {
</Grid> </Grid>
); );
}; };
export const AiPointsModal = ({ onClose }: { onClose: () => void }) => {
const { t } = useTranslation();
return (
<MyModal
isCentered
iconSrc="/imgs/modal/bill.svg"
title={t('common:support.wallet.subscription.Ai points')}
isOpen
onClose={onClose}
w={'100%'}
maxW={'90vw'}
maxH={'90vh'}
>
<ModalBody>
<AiPointsTable />
</ModalBody>
</MyModal>
);
};
...@@ -52,8 +52,7 @@ export async function getInitConfig() { ...@@ -52,8 +52,7 @@ export async function getInitConfig() {
getSystemVersion(), getSystemVersion(),
// abandon // abandon
getSystemPlugin(), getSystemPlugin()
getSystemPluginV1()
]); ]);
} }
...@@ -79,7 +78,7 @@ const defaultFeConfigs: FastGPTFeConfigsType = { ...@@ -79,7 +78,7 @@ const defaultFeConfigs: FastGPTFeConfigsType = {
export async function initSystemConfig() { export async function initSystemConfig() {
// load config // load config
const [dbConfig, fileConfig] = await Promise.all([ const [{ config: dbConfig, configId }, fileConfig] = await Promise.all([
getFastGPTConfigFromDB(), getFastGPTConfigFromDB(),
readConfigData('config.json') readConfigData('config.json')
]); ]);
...@@ -106,7 +105,9 @@ export async function initSystemConfig() { ...@@ -106,7 +105,9 @@ export async function initSystemConfig() {
}; };
// set config // set config
global.systemInitBufferId = configId;
initFastGPTConfig(config); initFastGPTConfig(config);
console.log({ console.log({
feConfigs: global.feConfigs, feConfigs: global.feConfigs,
systemEnv: global.systemEnv, systemEnv: global.systemEnv,
...@@ -162,32 +163,6 @@ function getSystemPlugin() { ...@@ -162,32 +163,6 @@ function getSystemPlugin() {
global.communityPlugins = fileTemplates; global.communityPlugins = fileTemplates;
} }
function getSystemPluginV1() {
if (global.communityPluginsV1 && global.communityPluginsV1.length > 0) return;
const basePath =
process.env.NODE_ENV === 'development'
? 'data/pluginTemplates/v1'
: '/app/data/pluginTemplates/v1';
// read data/pluginTemplates directory, get all json file
const files = readdirSync(basePath);
// filter json file
const filterFiles = files.filter((item) => item.endsWith('.json'));
// read json file
const fileTemplates: (PluginTemplateType & { weight: number })[] = filterFiles.map((filename) => {
const content = readFileSync(`${basePath}/${filename}`, 'utf-8');
return {
...JSON.parse(content),
id: `${PluginSourceEnum.community}-${filename.replace('.json', '')}`,
source: PluginSourceEnum.community
};
});
fileTemplates.sort((a, b) => b.weight - a.weight);
global.communityPluginsV1 = fileTemplates;
}
export async function initSystemPlugins() { export async function initSystemPlugins() {
try { try {
......
...@@ -5,7 +5,7 @@ import { ...@@ -5,7 +5,7 @@ import {
LLMModelItemType, LLMModelItemType,
ReRankModelItemType, ReRankModelItemType,
VectorModelItemType, VectorModelItemType,
WhisperModelType STTModelType
} from '@fastgpt/global/core/ai/model.d'; } from '@fastgpt/global/core/ai/model.d';
import { TrackEventName } from '@/web/common/system/constants'; import { TrackEventName } from '@/web/common/system/constants';
import { SubPlanType } from '@fastgpt/global/support/wallet/sub/type'; import { SubPlanType } from '@fastgpt/global/support/wallet/sub/type';
......
import type { InitDateResponse } from '@/global/common/api/systemRes'; import type { InitDateResponse } from '@/global/common/api/systemRes';
import { GET } from '@/web/common/api/request'; import { GET } from '@/web/common/api/request';
export const getSystemInitData = () => GET<InitDateResponse>('/common/system/getInitData'); export const getSystemInitData = (bufferId?: string) =>
GET<InitDateResponse>('/common/system/getInitData', {
bufferId
});
...@@ -10,7 +10,7 @@ export const clientInitData = async ( ...@@ -10,7 +10,7 @@ export const clientInitData = async (
feConfigs: FastGPTFeConfigsType; feConfigs: FastGPTFeConfigsType;
}> => { }> => {
try { try {
const res = await getSystemInitData(); const res = await getSystemInitData(useSystemStore.getState().initDataBufferId);
useSystemStore.getState().initStaticData(res); useSystemStore.getState().initStaticData(res);
return { return {
......
...@@ -8,11 +8,12 @@ import type { ...@@ -8,11 +8,12 @@ import type {
LLMModelItemType, LLMModelItemType,
ReRankModelItemType, ReRankModelItemType,
VectorModelItemType, VectorModelItemType,
WhisperModelType STTModelType
} from '@fastgpt/global/core/ai/model.d'; } from '@fastgpt/global/core/ai/model.d';
import { InitDateResponse } from '@/global/common/api/systemRes'; import { InitDateResponse } from '@/global/common/api/systemRes';
import { FastGPTFeConfigsType } from '@fastgpt/global/common/system/types'; import { FastGPTFeConfigsType } from '@fastgpt/global/common/system/types';
import { SubPlanType } from '@fastgpt/global/support/wallet/sub/type'; import { SubPlanType } from '@fastgpt/global/support/wallet/sub/type';
import { defaultWhisperModel } from '@fastgpt/global/core/ai/model';
type LoginStoreType = { provider: `${OAuthEnum}`; lastRoute: string; state: string }; type LoginStoreType = { provider: `${OAuthEnum}`; lastRoute: string; state: string };
...@@ -35,6 +36,7 @@ type State = { ...@@ -35,6 +36,7 @@ type State = {
isNotSufficientModal: boolean; isNotSufficientModal: boolean;
setIsNotSufficientModal: (val: boolean) => void; setIsNotSufficientModal: (val: boolean) => void;
initDataBufferId?: string;
feConfigs: FastGPTFeConfigsType; feConfigs: FastGPTFeConfigsType;
subPlans?: SubPlanType; subPlans?: SubPlanType;
systemVersion: string; systemVersion: string;
...@@ -43,7 +45,7 @@ type State = { ...@@ -43,7 +45,7 @@ type State = {
vectorModelList: VectorModelItemType[]; vectorModelList: VectorModelItemType[];
audioSpeechModelList: AudioSpeechModelType[]; audioSpeechModelList: AudioSpeechModelType[];
reRankModelList: ReRankModelItemType[]; reRankModelList: ReRankModelItemType[];
whisperModel?: WhisperModelType; whisperModel: STTModelType;
initStaticData: (e: InitDateResponse) => void; initStaticData: (e: InitDateResponse) => void;
appType?: string; appType?: string;
setAppType: (e?: string) => void; setAppType: (e?: string) => void;
...@@ -110,6 +112,7 @@ export const useSystemStore = create<State>()( ...@@ -110,6 +112,7 @@ export const useSystemStore = create<State>()(
}); });
}, },
initDataBufferId: undefined,
feConfigs: {}, feConfigs: {},
subPlans: undefined, subPlans: undefined,
systemVersion: '0.0.0', systemVersion: '0.0.0',
...@@ -118,26 +121,38 @@ export const useSystemStore = create<State>()( ...@@ -118,26 +121,38 @@ export const useSystemStore = create<State>()(
vectorModelList: [], vectorModelList: [],
audioSpeechModelList: [], audioSpeechModelList: [],
reRankModelList: [], reRankModelList: [],
whisperModel: undefined, whisperModel: defaultWhisperModel,
initStaticData(res) { initStaticData(res) {
set((state) => { set((state) => {
state.feConfigs = res.feConfigs || {}; state.initDataBufferId = res.bufferId;
state.subPlans = res.subPlans;
state.systemVersion = res.systemVersion; state.feConfigs = res.feConfigs ?? state.feConfigs;
state.subPlans = res.subPlans ?? state.subPlans;
state.systemVersion = res.systemVersion ?? state.systemVersion;
state.llmModelList = res.llmModels ?? state.llmModelList; state.llmModelList = res.llmModels ?? state.llmModelList;
state.datasetModelList = state.llmModelList.filter((item) => item.datasetProcess); state.datasetModelList = state.llmModelList.filter((item) => item.datasetProcess);
state.vectorModelList = res.vectorModels ?? state.vectorModelList; state.vectorModelList = res.vectorModels ?? state.vectorModelList;
state.audioSpeechModelList = res.audioSpeechModels ?? state.audioSpeechModelList; state.audioSpeechModelList = res.audioSpeechModels ?? state.audioSpeechModelList;
state.reRankModelList = res.reRankModels ?? state.reRankModelList; state.reRankModelList = res.reRankModels ?? state.reRankModelList;
state.whisperModel = res.whisperModel; state.whisperModel = res.whisperModel ?? state.whisperModel;
}); });
} }
})), })),
{ {
name: 'globalStore', name: 'globalStore',
partialize: (state) => ({ partialize: (state) => ({
loginStore: state.loginStore loginStore: state.loginStore,
initDataBufferId: state.initDataBufferId,
feConfigs: state.feConfigs,
subPlans: state.subPlans,
systemVersion: state.systemVersion,
llmModelList: state.llmModelList,
datasetModelList: state.datasetModelList,
vectorModelList: state.vectorModelList,
audioSpeechModelList: state.audioSpeechModelList,
reRankModelList: state.reRankModelList,
whisperModel: state.whisperModel
}) })
} }
) )
......
...@@ -5,6 +5,7 @@ import { useSystemStore } from '@/web/common/system/useSystemStore'; ...@@ -5,6 +5,7 @@ import { useSystemStore } from '@/web/common/system/useSystemStore';
import type { FastGPTFeConfigsType } from '@fastgpt/global/common/system/types/index.d'; import type { FastGPTFeConfigsType } from '@fastgpt/global/common/system/types/index.d';
import { useMemoizedFn, useMount } from 'ahooks'; import { useMemoizedFn, useMount } from 'ahooks';
import { TrackEventName } from '../common/system/constants'; import { TrackEventName } from '../common/system/constants';
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
export const useInitApp = () => { export const useInitApp = () => {
const router = useRouter(); const router = useRouter();
...@@ -41,8 +42,6 @@ export const useInitApp = () => { ...@@ -41,8 +42,6 @@ export const useInitApp = () => {
}); });
useMount(() => { useMount(() => {
initFetch();
const errorTrack = (event: ErrorEvent) => { const errorTrack = (event: ErrorEvent) => {
window.umami?.track(TrackEventName.windowError, { window.umami?.track(TrackEventName.windowError, {
device: { device: {
...@@ -62,6 +61,11 @@ export const useInitApp = () => { ...@@ -62,6 +61,11 @@ export const useInitApp = () => {
}; };
}); });
useRequest2(initFetch, {
manual: false,
pollingInterval: 300000
});
useEffect(() => { useEffect(() => {
hiId && localStorage.setItem('inviterId', hiId); hiId && localStorage.setItem('inviterId', hiId);
bd_vid && sessionStorage.setItem('bd_vid', bd_vid); bd_vid && sessionStorage.setItem('bd_vid', bd_vid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment