mirror of https://github.com/langgenius/dify.git
fix(plugin): handle optional property in llm_description assignment
- Updated the llm_description assignment in the ToolParameter to safely access the en_US property of paramDescription, ensuring it defaults to an empty string if not present. This change improves the robustness of the parameter handling in the plugin detail panel.
This commit is contained in:
parent
e377e90666
commit
a06d2892f8
|
|
@ -52,7 +52,7 @@ const toToolParameter = (parameter: any): ToolParameter => {
|
|||
human_description: paramDescription || paramLabel,
|
||||
type: parameter.type,
|
||||
form: 'setting',
|
||||
llm_description: typeof paramDescription === 'object' ? (paramDescription.en_US || '') : (paramDescription || ''),
|
||||
llm_description: typeof paramDescription === 'object' ? (paramDescription?.en_US || '') : (paramDescription || ''),
|
||||
required: parameter.required ?? false,
|
||||
multiple: parameter.multiple ?? false,
|
||||
default: parameter.default ?? '',
|
||||
|
|
|
|||
Loading…
Reference in New Issue