Skip to content

Commit 1094c65

Browse files
authored
perf: http empty params (#3773)
* model config * feat: normalization embedding * perf: http empty params * doc
1 parent abe082b commit 1094c65

File tree

9 files changed

+26
-20
lines changed

9 files changed

+26
-20
lines changed

docSite/content/zh-cn/docs/development/upgrading/4821.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ weight: 804
1313

1414
1. 新增 - 弃用/已删除的插件提示。
1515
2. 新增 - 对话日志按来源分类、标题检索、导出功能。
16-
3. 新增 - LLM 模型支持 top_p, response_format, json_schema 参数。
17-
4. 新增 - Doubao1.5 模型预设。
18-
5. 新增 - 向量模型支持归一化配置,以便适配未归一化的向量模型,例如 Doubao 的 embedding 模型。
16+
3. 新增 - 全局变量支持拖拽排序。
17+
4. 新增 - LLM 模型支持 top_p, response_format, json_schema 参数。
18+
5. 新增 - Doubao1.5 模型预设。阿里 embedding3 预设。
19+
6. 新增 - 向量模型支持归一化配置,以便适配未归一化的向量模型,例如 Doubao 的 embedding 模型。
1920
6. 新增 - AI 对话节点,支持输出思考过程结果,可用于其他节点引用。
2021
7. 优化 - 模型未配置时错误提示。
2122
8. 优化 - 适配非 Stream 模式思考输出。

packages/global/common/string/tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const simpleText = (text = '') => {
2626
};
2727

2828
export const valToStr = (val: any) => {
29-
if (val === undefined) return 'undefined';
29+
if (val === undefined) return '';
3030
if (val === null) return 'null';
3131

3232
if (typeof val === 'object') return JSON.stringify(val);

packages/global/core/workflow/runtime/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,12 @@ export const getReferenceVariableValue = ({
292292

293293
export const formatVariableValByType = (val: any, valueType?: WorkflowIOValueTypeEnum) => {
294294
if (!valueType) return val;
295+
if (val === undefined || val === null) return;
295296
// Value type check, If valueType invalid, return undefined
296297
if (valueType.startsWith('array') && !Array.isArray(val)) return undefined;
297298
if (valueType === WorkflowIOValueTypeEnum.boolean) return Boolean(val);
298299
if (valueType === WorkflowIOValueTypeEnum.number) return Number(val);
299300
if (valueType === WorkflowIOValueTypeEnum.string) {
300-
if (val === undefined) return 'undefined';
301-
if (val === null) return 'null';
302301
return typeof val === 'object' ? JSON.stringify(val) : String(val);
303302
}
304303
if (

packages/service/core/ai/config/provider/Qwen.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@
245245
"showTopP": true,
246246
"showStopSign": true,
247247
"responseFormatList": ["text", "json_object"]
248+
},
249+
{
250+
"model": "text-embedding-v3",
251+
"name": "text-embedding-v3",
252+
"defaultToken": 512,
253+
"maxToken": 8000,
254+
"type": "embedding"
248255
}
249256
]
250257
}

packages/service/core/workflow/dispatch/chat/oneapi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import { ModelTypeEnum } from '@fastgpt/global/core/ai/model';
5151

5252
export type ChatProps = ModuleDispatchProps<
5353
AIChatNodeProps & {
54-
[NodeInputKeyEnum.userChatInput]: string;
54+
[NodeInputKeyEnum.userChatInput]?: string;
5555
[NodeInputKeyEnum.history]?: ChatItemType[] | number;
5656
[NodeInputKeyEnum.aiChatDatasetQuote]?: SearchDataResponseItemType[];
5757
}
@@ -81,7 +81,7 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
8181
maxToken,
8282
history = 6,
8383
quoteQA,
84-
userChatInput,
84+
userChatInput = '',
8585
isResponseAnswerText = true,
8686
systemPrompt = '',
8787
aiChatQuoteRole = 'system',

packages/service/core/workflow/dispatch/dataset/search.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ type DatasetSearchProps = ModuleDispatchProps<{
2323
[NodeInputKeyEnum.datasetSimilarity]: number;
2424
[NodeInputKeyEnum.datasetMaxTokens]: number;
2525
[NodeInputKeyEnum.datasetSearchMode]: `${DatasetSearchModeEnum}`;
26-
[NodeInputKeyEnum.userChatInput]: string;
26+
[NodeInputKeyEnum.userChatInput]?: string;
2727
[NodeInputKeyEnum.datasetSearchUsingReRank]: boolean;
2828
[NodeInputKeyEnum.collectionFilterMatch]: string;
29-
[NodeInputKeyEnum.authTmbId]: boolean;
29+
[NodeInputKeyEnum.authTmbId]?: boolean;
3030

3131
[NodeInputKeyEnum.datasetSearchUsingExtensionQuery]: boolean;
3232
[NodeInputKeyEnum.datasetSearchExtensionModel]: string;
@@ -55,7 +55,7 @@ export async function dispatchDatasetSearch(
5555
limit = 1500,
5656
usingReRank,
5757
searchMode,
58-
userChatInput,
58+
userChatInput = '',
5959
authTmbId = false,
6060
collectionFilterMatch,
6161

packages/service/core/workflow/dispatch/tools/http468.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ type HttpRequestProps = ModuleDispatchProps<{
3838
[NodeInputKeyEnum.abandon_httpUrl]: string;
3939
[NodeInputKeyEnum.httpMethod]: string;
4040
[NodeInputKeyEnum.httpReqUrl]: string;
41-
[NodeInputKeyEnum.httpHeaders]: PropsArrType[];
42-
[NodeInputKeyEnum.httpParams]: PropsArrType[];
43-
[NodeInputKeyEnum.httpJsonBody]: string;
44-
[NodeInputKeyEnum.httpFormBody]: PropsArrType[];
41+
[NodeInputKeyEnum.httpHeaders]?: PropsArrType[];
42+
[NodeInputKeyEnum.httpParams]?: PropsArrType[];
43+
[NodeInputKeyEnum.httpJsonBody]?: string;
44+
[NodeInputKeyEnum.httpFormBody]?: PropsArrType[];
4545
[NodeInputKeyEnum.httpContentType]: ContentTypes;
4646
[NodeInputKeyEnum.addInputParam]: Record<string, any>;
4747
[NodeInputKeyEnum.httpTimeout]?: number;
@@ -76,10 +76,10 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
7676
params: {
7777
system_httpMethod: httpMethod = 'POST',
7878
system_httpReqUrl: httpReqUrl,
79-
system_httpHeader: httpHeader,
79+
system_httpHeader: httpHeader = [],
8080
system_httpParams: httpParams = [],
81-
system_httpJsonBody: httpJsonBody,
82-
system_httpFormBody: httpFormBody,
81+
system_httpJsonBody: httpJsonBody = '',
82+
system_httpFormBody: httpFormBody = [],
8383
system_httpContentType: httpContentType = ContentTypes.json,
8484
system_httpTimeout: httpTimeout = 60,
8585
[NodeInputKeyEnum.addInputParam]: dynamicInput,

projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeHttp/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import LightRowTabs from '@fastgpt/web/components/common/Tabs/LightRowTabs';
3434
import MyIcon from '@fastgpt/web/components/common/Icon';
3535
import { FlowNodeInputItemType } from '@fastgpt/global/core/workflow/type/io.d';
3636
import { useToast } from '@fastgpt/web/hooks/useToast';
37-
import JSONEditor from '@fastgpt/web/components/common/Textarea/JsonEditor';
3837
import { EditorVariableLabelPickerType } from '@fastgpt/web/components/common/Textarea/PromptEditor/type';
3938
import HttpInput from '@fastgpt/web/components/common/Input/HttpInput';
4039
import dynamic from 'next/dynamic';

projects/app/src/pages/login/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const Login = ({ ChineseRedirectUrl }: { ChineseRedirectUrl: string }) => {
8181
router.push(navigateTo);
8282
}, 300);
8383
},
84-
[lastRoute, router, setUserInfo, llmModelList]
84+
[setUserInfo, llmModelList?.length, lastRoute, toast, t, router]
8585
);
8686

8787
const DynamicComponent = useMemo(() => {

0 commit comments

Comments
 (0)