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