mirror of
https://github.com/langgenius/dify.git
synced 2026-04-23 16:37:44 +08:00
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
|
inPanel?: boolean
|
||||||
currentTool?: Tool
|
currentTool?: Tool
|
||||||
currentProvider?: ToolWithProvider
|
currentProvider?: ToolWithProvider
|
||||||
|
extraParams?: Record<string, any>
|
||||||
}
|
}
|
||||||
|
|
||||||
const ToolForm: FC<Props> = ({
|
const ToolForm: FC<Props> = ({
|
||||||
@ -27,6 +28,7 @@ const ToolForm: FC<Props> = ({
|
|||||||
inPanel,
|
inPanel,
|
||||||
currentTool,
|
currentTool,
|
||||||
currentProvider,
|
currentProvider,
|
||||||
|
extraParams,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div className='space-y-1'>
|
<div className='space-y-1'>
|
||||||
@ -42,6 +44,7 @@ const ToolForm: FC<Props> = ({
|
|||||||
inPanel={inPanel}
|
inPanel={inPanel}
|
||||||
currentTool={currentTool}
|
currentTool={currentTool}
|
||||||
currentProvider={currentProvider}
|
currentProvider={currentProvider}
|
||||||
|
extraParams={extraParams}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@ type Props = {
|
|||||||
inPanel?: boolean
|
inPanel?: boolean
|
||||||
currentTool?: Tool
|
currentTool?: Tool
|
||||||
currentProvider?: ToolWithProvider
|
currentProvider?: ToolWithProvider
|
||||||
|
extraParams?: Record<string, any>
|
||||||
}
|
}
|
||||||
|
|
||||||
const ToolFormItem: FC<Props> = ({
|
const ToolFormItem: FC<Props> = ({
|
||||||
@ -35,6 +36,7 @@ const ToolFormItem: FC<Props> = ({
|
|||||||
inPanel,
|
inPanel,
|
||||||
currentTool,
|
currentTool,
|
||||||
currentProvider,
|
currentProvider,
|
||||||
|
extraParams,
|
||||||
}) => {
|
}) => {
|
||||||
const language = useLanguage()
|
const language = useLanguage()
|
||||||
const { name, label, type, required, tooltip, input_schema } = schema
|
const { name, label, type, required, tooltip, input_schema } = schema
|
||||||
@ -89,6 +91,7 @@ const ToolFormItem: FC<Props> = ({
|
|||||||
inPanel={inPanel}
|
inPanel={inPanel}
|
||||||
currentTool={currentTool}
|
currentTool={currentTool}
|
||||||
currentProvider={currentProvider}
|
currentProvider={currentProvider}
|
||||||
|
extraParams={extraParams}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{isShowSchema && (
|
{isShowSchema && (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user