support variable for number, select, file

This commit is contained in:
JzoNg
2025-02-08 18:06:21 +08:00
parent 1409c81e76
commit 91b89d755e
5 changed files with 39 additions and 26 deletions

View File

@ -36,6 +36,7 @@ export type AgentStrategyProps = {
onFormValueChange: (value: ToolVarInputs) => void
nodeOutputVars?: NodeOutPutVar[],
availableNodes?: Node[],
nodeId?: string
}
type CustomSchema<Type, Field = {}> = Omit<CredentialFormSchema, 'type'> & { type: Type } & Field
@ -46,7 +47,7 @@ type MultipleToolSelectorSchema = CustomSchema<'array[tools]'>
type CustomField = ToolSelectorSchema | MultipleToolSelectorSchema
export const AgentStrategy = memo((props: AgentStrategyProps) => {
const { strategy, onStrategyChange, formSchema, formValue, onFormValueChange, nodeOutputVars, availableNodes } = props
const { strategy, onStrategyChange, formSchema, formValue, onFormValueChange, nodeOutputVars, availableNodes, nodeId } = props
const { t } = useTranslation()
const defaultModel = useDefaultModel(ModelTypeEnum.textGeneration)
const renderI18nObject = useRenderI18nObject()
@ -155,6 +156,7 @@ export const AgentStrategy = memo((props: AgentStrategyProps) => {
>
<ToolSelector
supportVariables
nodeId={nodeId || ''}
nodeOutputVars={nodeOutputVars || []}
availableNodes={availableNodes || []}
scope={schema.scope}
@ -173,6 +175,7 @@ export const AgentStrategy = memo((props: AgentStrategyProps) => {
return (
<MultipleToolSelector
supportVariables
nodeId={nodeId || ''}
nodeOutputVars={nodeOutputVars || []}
availableNodes={availableNodes || []}
scope={schema.scope}