Skip to content

Commit 1da94e6

Browse files
russellbsimon-mo
authored andcommitted
Do not use eval() to convert unknown types (#23266)
Signed-off-by: Russell Bryant <[email protected]> Signed-off-by: simon-mo <[email protected]>
1 parent d8b736f commit 1da94e6

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

vllm/entrypoints/openai/tool_parsers/qwen3coder_tool_parser.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,10 @@ def convert_param_value(param_value: str, param_name: str,
208208
"valid JSON object in tool '%s', will try other "
209209
"methods to parse it.", param_value, param_name,
210210
func_name)
211-
try:
212-
converted_value = eval(param_value)
213-
return converted_value
214-
except Exception:
215-
logger.warning(
216-
"Parsed value '%s' of parameter '%s' cannot be "
217-
"converted via Python `eval()` in tool '%s', "
218-
"degenerating to string.", param_value, param_name,
219-
func_name)
211+
logger.warning(
212+
"Parameter '%s' has unknown type '%s'. "
213+
"The value will be treated as a string.", param_name,
214+
param_type)
220215
return param_value
221216

222217
# Extract function name

0 commit comments

Comments
 (0)