mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:28:10 +08:00
fix: support tool call badge & disable tools in llm when model not support tool call
This commit is contained in:
@ -8,8 +8,9 @@ type MaxIterationsProps = {
|
||||
value?: number
|
||||
onChange?: (value: number) => void
|
||||
className?: string
|
||||
disabled?: boolean
|
||||
}
|
||||
const MaxIterations = ({ value = 10, onChange, className }: MaxIterationsProps) => {
|
||||
const MaxIterations = ({ value = 10, onChange, className, disabled }: MaxIterationsProps) => {
|
||||
return (
|
||||
<div className={cn('mt-3 flex h-10 items-center justify-between', className)}>
|
||||
<div className="flex items-center">
|
||||
@ -20,11 +21,12 @@ const MaxIterations = ({ value = 10, onChange, className }: MaxIterationsProps)
|
||||
/>
|
||||
</div>
|
||||
<InputNumber
|
||||
className="w-14 shrink-0"
|
||||
className={cn('w-14 shrink-0', disabled && 'opacity-50')}
|
||||
value={value}
|
||||
onChange={onChange ?? (() => {})}
|
||||
min={1}
|
||||
step={1}
|
||||
disabled={disabled}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -290,7 +290,7 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
|
||||
tools={inputs.tools}
|
||||
maxIterations={inputs.max_iterations}
|
||||
hideMaxIterations
|
||||
disabled={isToolsBlocked}
|
||||
disabled={isToolsBlocked || !isModelSupportToolCall}
|
||||
disabledTip={toolsDisabledTip}
|
||||
/>
|
||||
)}
|
||||
@ -335,6 +335,7 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
|
||||
className="flex h-10 items-center"
|
||||
value={inputs.max_iterations}
|
||||
onChange={handleMaxIterationsChange}
|
||||
disabled={!isModelSupportToolCall}
|
||||
/>
|
||||
</div>
|
||||
</FieldCollapse>
|
||||
|
||||
Reference in New Issue
Block a user