mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 19:27:23 +08:00
tool setting schema
This commit is contained in:
parent
91ac660f81
commit
4663af8a60
@ -107,7 +107,7 @@ const ToolSelector: FC<Props> = ({
|
|||||||
|
|
||||||
const [isShowChooseTool, setIsShowChooseTool] = useState(false)
|
const [isShowChooseTool, setIsShowChooseTool] = useState(false)
|
||||||
const handleSelectTool = (tool: ToolDefaultValue) => {
|
const handleSelectTool = (tool: ToolDefaultValue) => {
|
||||||
const paramValues = addDefaultValue(tool.params, toolParametersToFormSchemas(tool.paramSchemas as any))
|
const paramValues = addDefaultValue(tool.params, toolParametersToFormSchemas(tool.paramSchemas.filter(param => param.form !== 'llm') as any))
|
||||||
const toolValue = {
|
const toolValue = {
|
||||||
provider_name: tool.provider_id,
|
provider_name: tool.provider_id,
|
||||||
tool_name: tool.tool_name,
|
tool_name: tool.tool_name,
|
||||||
@ -133,7 +133,7 @@ const ToolSelector: FC<Props> = ({
|
|||||||
|
|
||||||
const currentToolParams = useMemo(() => {
|
const currentToolParams = useMemo(() => {
|
||||||
if (!currentProvider) return []
|
if (!currentProvider) return []
|
||||||
return currentProvider.tools.find(tool => tool.name === value?.tool_name)?.parameters || []
|
return currentProvider.tools.find(tool => tool.name === value?.tool_name)?.parameters.filter(param => param.form !== 'llm') || []
|
||||||
}, [currentProvider, value])
|
}, [currentProvider, value])
|
||||||
|
|
||||||
const formSchemas = useMemo(() => toolParametersToFormSchemas(currentToolParams), [currentToolParams])
|
const formSchemas = useMemo(() => toolParametersToFormSchemas(currentToolParams), [currentToolParams])
|
||||||
|
|||||||
@ -27,6 +27,6 @@ export type ToolDefaultValue = {
|
|||||||
title: string
|
title: string
|
||||||
is_team_authorization: boolean
|
is_team_authorization: boolean
|
||||||
params: Record<string, any>
|
params: Record<string, any>
|
||||||
paramSchemas: Record<string, any>
|
paramSchemas: Record<string, any>[]
|
||||||
output_schema: Record<string, any>
|
output_schema: Record<string, any>
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user