fix: toolNode max tokens and toolDescription i18n (#2655)

* fix: toolNode max tokens

* fix: toolNode max tokens

* fix: workflow  tool desc i18n
This commit is contained in:
Archer
2024-09-09 22:26:20 +08:00
committed by GitHub
parent 6a85c8c2b6
commit 08190c2f0d
7 changed files with 69 additions and 60 deletions

View File

@@ -62,10 +62,12 @@ export const nodeTemplate2FlowNode = ({
};
export const storeNode2FlowNode = ({
item: storeNode,
selected = false
selected = false,
t
}: {
item: StoreNodeItemType;
selected?: boolean;
t: TFunction;
}): Node<FlowNodeItemType> => {
// init some static data
const template =
@@ -99,6 +101,9 @@ export const storeNode2FlowNode = ({
...storeInput,
...templateInput,
debugLabel: t(templateInput.debugLabel ?? (storeInput.debugLabel as any)),
toolDescription: t(templateInput.toolDescription ?? (storeInput.toolDescription as any)),
selectedTypeIndex: storeInput.selectedTypeIndex ?? templateInput.selectedTypeIndex,
value: storeInput.value ?? templateInput.value,
label: storeInput.label ?? templateInput.label
@@ -126,6 +131,8 @@ export const storeNode2FlowNode = ({
...storeOutput,
...templateOutput,
description: t(templateOutput.description ?? (storeOutput.description as any)),
id: storeOutput.id ?? templateOutput.id,
label: storeOutput.label ?? templateOutput.label,
value: storeOutput.value ?? templateOutput.value