mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-03 13:38:00 +00:00
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>
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import { AppSimpleEditFormType } from '@fastgpt/global/core/app/type';
|
||||
import { ModuleItemType } from '@fastgpt/global/core/module/type';
|
||||
import { POST } from '@/web/common/api/request';
|
||||
import { chatModelList } from '@/web/common/system/staticData';
|
||||
import { FlowNodeInputTypeEnum, FlowNodeTypeEnum } from '@fastgpt/global/core/module/node/constant';
|
||||
import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants';
|
||||
import type { FormatForm2ModulesProps } from '@fastgpt/global/core/app/api.d';
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
|
||||
export async function postForm2Modules(
|
||||
data: AppSimpleEditFormType,
|
||||
templateId = 'fastgpt-universal'
|
||||
) {
|
||||
const llmModelList = useSystemStore.getState().llmModelList;
|
||||
function userGuideTemplate(formData: AppSimpleEditFormType): ModuleItemType[] {
|
||||
return [
|
||||
{
|
||||
@@ -51,12 +52,12 @@ export async function postForm2Modules(
|
||||
];
|
||||
}
|
||||
const maxToken =
|
||||
chatModelList.find((item) => item.model === data.aiSettings.model)?.maxResponse || 4000;
|
||||
llmModelList.find((item) => item.model === data.aiSettings.model)?.maxResponse || 4000;
|
||||
|
||||
const props: FormatForm2ModulesProps = {
|
||||
formData: data,
|
||||
chatModelMaxToken: maxToken,
|
||||
chatModelList
|
||||
llmModelList
|
||||
};
|
||||
|
||||
const modules = await POST<ModuleItemType[]>(`/core/app/form2Modules/${templateId}`, props);
|
||||
|
@@ -1,10 +1,12 @@
|
||||
import { chatModelList } from '@/web/common/system/staticData';
|
||||
import { FlowNodeTypeEnum } from '@fastgpt/global/core/module/node/constant';
|
||||
import { ModuleItemType } from '@fastgpt/global/core/module/type.d';
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
|
||||
export function checkChatSupportSelectFileByChatModels(models: string[] = []) {
|
||||
const llmModelList = useSystemStore.getState().llmModelList;
|
||||
|
||||
for (const model of models) {
|
||||
const modelData = chatModelList.find((item) => item.model === model || item.name === model);
|
||||
const modelData = llmModelList.find((item) => item.model === model || item.name === model);
|
||||
if (modelData?.vision) {
|
||||
return true;
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import MyBox from '@/components/common/MyBox';
|
||||
import { useSelectFile } from '@/web/common/file/hooks/useSelectFile';
|
||||
import { useToast } from '@/web/common/hooks/useToast';
|
||||
import { useToast } from '@fastgpt/web/hooks/useToast';
|
||||
import { Box, FlexProps } from '@chakra-ui/react';
|
||||
import { formatFileSize } from '@fastgpt/global/common/file/tools';
|
||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||
|
@@ -69,9 +69,9 @@ export async function chunksUpload({
|
||||
}
|
||||
|
||||
// add chunk index
|
||||
chunks = chunks.map((chunk, i) => ({
|
||||
chunks = chunks.map((chunk) => ({
|
||||
...chunk,
|
||||
chunkIndex: i
|
||||
chunkIndex: chunk.chunkIndex
|
||||
}));
|
||||
|
||||
let successInsert = 0;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { UserGuideModule } from '@fastgpt/global/core/module/template/system/userGuide';
|
||||
import { UserInputModule } from '@fastgpt/global/core/module/template/system/userInput';
|
||||
import { HistoryModule } from '@fastgpt/global/core/module/template/system/abandon/history';
|
||||
import { AiChatModule } from '@fastgpt/global/core/module/template/system/aiChat';
|
||||
import { DatasetSearchModule } from '@fastgpt/global/core/module/template/system/datasetSearch';
|
||||
import { DatasetConcatModule } from '@fastgpt/global/core/module/template/system/datasetConcat';
|
||||
import { AssignedAnswerModule } from '@fastgpt/global/core/module/template/system/assignedAnswer';
|
||||
import { ClassifyQuestionModule } from '@fastgpt/global/core/module/template/system/classifyQuestion';
|
||||
import { ContextExtractModule } from '@fastgpt/global/core/module/template/system/contextExtract';
|
||||
@@ -25,6 +25,7 @@ export const appSystemModuleTemplates: FlowModuleTemplateType[] = [
|
||||
AiChatModule,
|
||||
AssignedAnswerModule,
|
||||
DatasetSearchModule,
|
||||
DatasetConcatModule,
|
||||
RunAppModule,
|
||||
ClassifyQuestionModule,
|
||||
ContextExtractModule,
|
||||
@@ -37,18 +38,20 @@ export const pluginSystemModuleTemplates: FlowModuleTemplateType[] = [
|
||||
AiChatModule,
|
||||
AssignedAnswerModule,
|
||||
DatasetSearchModule,
|
||||
DatasetConcatModule,
|
||||
RunAppModule,
|
||||
ClassifyQuestionModule,
|
||||
ContextExtractModule,
|
||||
HttpModule,
|
||||
AiCFR
|
||||
];
|
||||
|
||||
export const moduleTemplatesFlat: FlowModuleTemplateType[] = [
|
||||
UserGuideModule,
|
||||
UserInputModule,
|
||||
HistoryModule,
|
||||
AiChatModule,
|
||||
DatasetSearchModule,
|
||||
DatasetConcatModule,
|
||||
AssignedAnswerModule,
|
||||
ClassifyQuestionModule,
|
||||
ContextExtractModule,
|
||||
@@ -71,11 +74,6 @@ export const moduleTemplatesList: moduleTemplateListType = [
|
||||
label: 'core.module.template.System input module',
|
||||
list: []
|
||||
},
|
||||
{
|
||||
type: ModuleTemplateTypeEnum.tools,
|
||||
label: 'core.module.template.Tool module',
|
||||
list: []
|
||||
},
|
||||
{
|
||||
type: ModuleTemplateTypeEnum.textAnswer,
|
||||
label: 'core.module.template.Response module',
|
||||
@@ -86,6 +84,11 @@ export const moduleTemplatesList: moduleTemplateListType = [
|
||||
label: 'core.module.template.Function module',
|
||||
list: []
|
||||
},
|
||||
{
|
||||
type: ModuleTemplateTypeEnum.tools,
|
||||
label: 'core.module.template.Tool module',
|
||||
list: []
|
||||
},
|
||||
{
|
||||
type: ModuleTemplateTypeEnum.externalCall,
|
||||
label: 'core.module.template.External module',
|
||||
|
Reference in New Issue
Block a user