mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 11:56:55 +08:00
support extra for tool selector
This commit is contained in:
parent
10218cfe8d
commit
bfecc73de9
@ -41,8 +41,8 @@ type Props = {
|
|||||||
value?: {
|
value?: {
|
||||||
provider: string
|
provider: string
|
||||||
tool_name: string
|
tool_name: string
|
||||||
description?: string
|
|
||||||
parameters?: Record<string, any>
|
parameters?: Record<string, any>
|
||||||
|
extra?: Record<string, any>
|
||||||
}
|
}
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
placement?: Placement
|
placement?: Placement
|
||||||
@ -50,8 +50,8 @@ type Props = {
|
|||||||
onSelect: (tool: {
|
onSelect: (tool: {
|
||||||
provider: string
|
provider: string
|
||||||
tool_name: string
|
tool_name: string
|
||||||
description?: string
|
|
||||||
parameters?: Record<string, any>
|
parameters?: Record<string, any>
|
||||||
|
extra?: Record<string, any>
|
||||||
}) => void
|
}) => void
|
||||||
supportAddCustomTool?: boolean
|
supportAddCustomTool?: boolean
|
||||||
scope?: string
|
scope?: string
|
||||||
@ -101,7 +101,10 @@ const ToolSelector: FC<Props> = ({
|
|||||||
const handleDescriptionChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
const handleDescriptionChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
||||||
onSelect({
|
onSelect({
|
||||||
...value,
|
...value,
|
||||||
description: e.target.value || '',
|
extra: {
|
||||||
|
...value?.extra,
|
||||||
|
description: e.target.value || '',
|
||||||
|
},
|
||||||
} as any)
|
} as any)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +189,7 @@ const ToolSelector: FC<Props> = ({
|
|||||||
<Textarea
|
<Textarea
|
||||||
className='resize-none'
|
className='resize-none'
|
||||||
placeholder={t('plugin.detailPanel.toolSelector.descriptionPlaceholder')}
|
placeholder={t('plugin.detailPanel.toolSelector.descriptionPlaceholder')}
|
||||||
value={value?.description || ''}
|
value={value?.extra?.description || ''}
|
||||||
onChange={handleDescriptionChange}
|
onChange={handleDescriptionChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user