[Refactor] Lazy import tool_parser (#27974)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
Chauncey
2025-11-04 10:10:10 +08:00
committed by GitHub
parent 6ddae74054
commit c02fccdbd2
40 changed files with 266 additions and 158 deletions

View File

@@ -1943,7 +1943,7 @@ def create_server_unix_socket(path: str) -> socket.socket:
def validate_api_server_args(args):
valid_tool_parses = ToolParserManager.tool_parsers.keys()
valid_tool_parses = ToolParserManager.list_registered()
if args.enable_auto_tool_choice and args.tool_call_parser not in valid_tool_parses:
raise KeyError(
f"invalid tool call parser: {args.tool_call_parser} "