mirror of https://github.com/langgenius/dify.git
feat(tool-form): add extraParams prop to ToolForm and ToolFormItem components
- Introduced extraParams prop to both ToolForm and ToolFormItem components for enhanced flexibility in passing additional parameters. - Updated component usage to accommodate the new prop, improving the overall functionality of the tool forms.
This commit is contained in:
parent
4b253e1f73
commit
5e5ffaa416
|
|
@ -16,6 +16,7 @@ type Props = {
|
|||
inPanel?: boolean
|
||||
currentTool?: Tool
|
||||
currentProvider?: ToolWithProvider
|
||||
extraParams?: Record<string, any>
|
||||
}
|
||||
|
||||
const ToolForm: FC<Props> = ({
|
||||
|
|
@ -27,6 +28,7 @@ const ToolForm: FC<Props> = ({
|
|||
inPanel,
|
||||
currentTool,
|
||||
currentProvider,
|
||||
extraParams,
|
||||
}) => {
|
||||
return (
|
||||
<div className='space-y-1'>
|
||||
|
|
@ -42,6 +44,7 @@ const ToolForm: FC<Props> = ({
|
|||
inPanel={inPanel}
|
||||
currentTool={currentTool}
|
||||
currentProvider={currentProvider}
|
||||
extraParams={extraParams}
|
||||
/>
|
||||
))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ type Props = {
|
|||
inPanel?: boolean
|
||||
currentTool?: Tool
|
||||
currentProvider?: ToolWithProvider
|
||||
extraParams?: Record<string, any>
|
||||
}
|
||||
|
||||
const ToolFormItem: FC<Props> = ({
|
||||
|
|
@ -35,6 +36,7 @@ const ToolFormItem: FC<Props> = ({
|
|||
inPanel,
|
||||
currentTool,
|
||||
currentProvider,
|
||||
extraParams,
|
||||
}) => {
|
||||
const language = useLanguage()
|
||||
const { name, label, type, required, tooltip, input_schema } = schema
|
||||
|
|
@ -89,6 +91,7 @@ const ToolFormItem: FC<Props> = ({
|
|||
inPanel={inPanel}
|
||||
currentTool={currentTool}
|
||||
currentProvider={currentProvider}
|
||||
extraParams={extraParams}
|
||||
/>
|
||||
|
||||
{isShowSchema && (
|
||||
|
|
|
|||
Loading…
Reference in New Issue