mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +08:00
feat: optimize UI-TARS parser with coordinate conversion and action mapping
- Add action mapping for UI-TARS parser to convert action names to option.ActionName - Implement bounding box to center point coordinate conversion for better accuracy - Update coordinate normalization to handle coordinates > 1000 properly - Enhance test cases to verify coordinate scaling and center point conversion - Improve action argument processing with proper coordinate transformation - Add comprehensive test coverage for coordinate conversion edge cases Key improvements: - Bounding box [x1,y1,x2,y2] now converts to center point [cx,cy] for actions - Coordinate scaling properly handles different screen resolutions - Action names are mapped through doubao_1_5_ui_tars_action_mapping - Enhanced error handling for invalid coordinate formats
This commit is contained in:
+3
-2
@@ -64,9 +64,10 @@ func (c *MCPClient4XTDriver) ListTools(ctx context.Context, req mcp.ListToolsReq
|
||||
}
|
||||
|
||||
func (c *MCPClient4XTDriver) CallTool(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) {
|
||||
actionTool := c.Server.GetToolByAction(option.ActionName(req.Params.Name))
|
||||
actionName := strings.TrimPrefix(req.Params.Name, "uixt__")
|
||||
actionTool := c.Server.GetToolByAction(option.ActionName(actionName))
|
||||
if actionTool == nil {
|
||||
return mcp.NewToolResultError(fmt.Sprintf("action %s for tool not found", req.Params.Name)), nil
|
||||
return mcp.NewToolResultError(fmt.Sprintf("action %s for tool not found", actionName)), nil
|
||||
}
|
||||
handler := actionTool.Implement()
|
||||
return handler(ctx, req)
|
||||
|
||||
Reference in New Issue
Block a user