[Tool Parser][2/3] Use self.tools instead of request.tools in tool parsers (#38189)
Signed-off-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
@@ -142,12 +142,11 @@ class DeepSeekV32ToolParser(ToolParser):
|
||||
self,
|
||||
function_name: str,
|
||||
param_dict: dict[str, str],
|
||||
request: ChatCompletionRequest | None,
|
||||
) -> dict[str, Any]:
|
||||
"""Convert raw string param values using the tool schema types."""
|
||||
param_config: dict = {}
|
||||
if request and request.tools:
|
||||
for tool in request.tools:
|
||||
if self.tools:
|
||||
for tool in self.tools:
|
||||
if (
|
||||
hasattr(tool, "function")
|
||||
and tool.function.name == function_name
|
||||
@@ -241,9 +240,7 @@ class DeepSeekV32ToolParser(ToolParser):
|
||||
invoke_name, invoke_body = complete_invokes[self.current_tool_index]
|
||||
param_dict = self._parse_invoke_params(invoke_body)
|
||||
|
||||
converted = self._convert_params_with_schema(
|
||||
invoke_name, param_dict, request
|
||||
)
|
||||
converted = self._convert_params_with_schema(invoke_name, param_dict)
|
||||
args_json = json.dumps(converted, ensure_ascii=False)
|
||||
idx = self.current_tool_index
|
||||
self.current_tool_index += 1
|
||||
|
||||
Reference in New Issue
Block a user