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:
Harry 2025-09-29 16:51:14 +08:00
parent e377e90666
commit a06d2892f8
1 changed files with 1 additions and 1 deletions

View File

@ -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 ?? '',