Created
May 13, 2025 20:41
-
-
Save bbrowning/4f94f4a6db09672bf8c960631778982c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py b/vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py | |
index bb91a35af..2947bc8db 100644 | |
--- a/vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py | |
+++ b/vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py | |
@@ -189,6 +189,8 @@ def _get_parameter_value(val: ast.expr) -> Any: | |
} | |
elif isinstance(val, ast.List): | |
return [_get_parameter_value(v) for v in val.elts] | |
+ elif isinstance(val, ast.Name) and val.id in ["true", "false"]: | |
+ return True if val.id == "true" else False | |
else: | |
raise _UnexpectedAstError("Tool call arguments must be literals") |
The function call output it's trying to parse is get_boiling_point(liquid_name='polyjuice', celcius=true)
. It's the true
that messes things up, as it was getting treated as a variable name (because it's lowercase) instead of as the Python boolean True
value.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This change is required to get the remote-vllm provider of Llama Stack passing this integration test: