@@ -1288,35 +1288,42 @@ def validate_deployment_params(
12881288
12891289 def recommend_shape (self , ** kwargs ) -> Union [Table , ShapeRecommendationReport ]:
12901290 """
1291- For the CLI (set generate_table = True), generates the table (in rich diff) with valid
1291+ For the CLI (set by default, generate_table = True), generates the table (in rich diff) with valid
12921292 GPU deployment shapes for the provided model and configuration.
12931293
12941294 For the API (set generate_table = False), generates the JSON with valid
12951295 GPU deployment shapes for the provided model and configuration.
12961296
1297- Validates if recommendations are generated, calls method to construct the rich diff
1298- table with the recommendation data.
1297+ Validates the input and determines whether recommendations are available.
12991298
13001299 Parameters
13011300 ----------
1302- model_ocid : str
1303- OCID of the model to recommend feasible compute shapes.
1301+ **kwargs
1302+ model_ocid : str
1303+ (Required) The OCID of the model to recommend feasible compute shapes for.
1304+ generate_table : bool, optional
1305+ If True, generate and return a rich-diff table; if False, return a JSON response (default is False).
1306+ compartment_id : str, optional
1307+ The OCID of the user's compartment to use for the recommendation.
13041308
13051309 Returns
13061310 -------
13071311 Table (generate_table = True)
1308- A table format for the recommendation report with compatible deployment shapes
1309- or troubleshooting info citing the largest shapes if no shape is suitable.
1312+ If `generate_table` is True, a table displaying the recommendation report with compatible deployment shapes,
1313+ or troubleshooting info if no shape is suitable.
13101314
13111315 ShapeRecommendationReport (generate_table = False)
1312- A recommendation report with compatible deployment shapes, or troubleshooting info
1313- citing the largest shapes if no shape is suitable.
1316+ If `generate_table` is False, a structured recommendation report with compatible deployment shapes,
1317+ or troubleshooting info and citing the largest shapes if no shape is suitable.
13141318
13151319 Raises
13161320 ------
13171321 AquaValueError
1318- If model type is unsupported by tool ( no recommendation report generated)
1322+ If the model type is unsupported and no recommendation report can be generated.
13191323 """
1324+ deployment_config = self .get_deployment_config (model_id = kwargs .get ("model_id" ))
1325+ kwargs ["deployment_config" ] = deployment_config
1326+
13201327 try :
13211328 request = RequestRecommend (** kwargs )
13221329 except ValidationError as e :
0 commit comments