mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-18 00:45:01 +08:00
Do not use eval() to convert unknown types (#23266)
Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
parent
bf7c99dfc4
commit
4e51fa8cba
@ -208,15 +208,10 @@ class Qwen3CoderToolParser(ToolParser):
|
|||||||
"valid JSON object in tool '%s', will try other "
|
"valid JSON object in tool '%s', will try other "
|
||||||
"methods to parse it.", param_value, param_name,
|
"methods to parse it.", param_value, param_name,
|
||||||
func_name)
|
func_name)
|
||||||
try:
|
logger.warning(
|
||||||
converted_value = eval(param_value)
|
"Parameter '%s' has unknown type '%s'. "
|
||||||
return converted_value
|
"The value will be treated as a string.", param_name,
|
||||||
except Exception:
|
param_type)
|
||||||
logger.warning(
|
|
||||||
"Parsed value '%s' of parameter '%s' cannot be "
|
|
||||||
"converted via Python `eval()` in tool '%s', "
|
|
||||||
"degenerating to string.", param_value, param_name,
|
|
||||||
func_name)
|
|
||||||
return param_value
|
return param_value
|
||||||
|
|
||||||
# Extract function name
|
# Extract function name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user