@@ -1539,6 +1539,117 @@ async def sample_import_model_evaluation():
1539
1539
# Done; return the response.
1540
1540
return response
1541
1541
1542
+ async def batch_import_model_evaluation_slices (
1543
+ self ,
1544
+ request : Union [
1545
+ model_service .BatchImportModelEvaluationSlicesRequest , dict
1546
+ ] = None ,
1547
+ * ,
1548
+ parent : str = None ,
1549
+ model_evaluation_slices : Sequence [
1550
+ model_evaluation_slice .ModelEvaluationSlice
1551
+ ] = None ,
1552
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
1553
+ timeout : float = None ,
1554
+ metadata : Sequence [Tuple [str , str ]] = (),
1555
+ ) -> model_service .BatchImportModelEvaluationSlicesResponse :
1556
+ r"""Imports a list of externally generated
1557
+ ModelEvaluationSlice.
1558
+
1559
+ .. code-block:: python
1560
+
1561
+ from google.cloud import aiplatform_v1beta1
1562
+
1563
+ async def sample_batch_import_model_evaluation_slices():
1564
+ # Create a client
1565
+ client = aiplatform_v1beta1.ModelServiceAsyncClient()
1566
+
1567
+ # Initialize request argument(s)
1568
+ request = aiplatform_v1beta1.BatchImportModelEvaluationSlicesRequest(
1569
+ parent="parent_value",
1570
+ )
1571
+
1572
+ # Make the request
1573
+ response = await client.batch_import_model_evaluation_slices(request=request)
1574
+
1575
+ # Handle the response
1576
+ print(response)
1577
+
1578
+ Args:
1579
+ request (Union[google.cloud.aiplatform_v1beta1.types.BatchImportModelEvaluationSlicesRequest, dict]):
1580
+ The request object. Request message for
1581
+ [ModelService.BatchImportModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.BatchImportModelEvaluationSlices]
1582
+ parent (:class:`str`):
1583
+ Required. The name of the parent ModelEvaluation
1584
+ resource. Format:
1585
+ ``projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}``
1586
+
1587
+ This corresponds to the ``parent`` field
1588
+ on the ``request`` instance; if ``request`` is provided, this
1589
+ should not be set.
1590
+ model_evaluation_slices (:class:`Sequence[google.cloud.aiplatform_v1beta1.types.ModelEvaluationSlice]`):
1591
+ Required. Model evaluation slice
1592
+ resource to be imported.
1593
+
1594
+ This corresponds to the ``model_evaluation_slices`` field
1595
+ on the ``request`` instance; if ``request`` is provided, this
1596
+ should not be set.
1597
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1598
+ should be retried.
1599
+ timeout (float): The timeout for this request.
1600
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
1601
+ sent along with the request as metadata.
1602
+
1603
+ Returns:
1604
+ google.cloud.aiplatform_v1beta1.types.BatchImportModelEvaluationSlicesResponse:
1605
+ Response message for
1606
+ [ModelService.BatchImportModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.BatchImportModelEvaluationSlices]
1607
+
1608
+ """
1609
+ # Create or coerce a protobuf request object.
1610
+ # Quick check: If we got a request object, we should *not* have
1611
+ # gotten any keyword arguments that map to the request.
1612
+ has_flattened_params = any ([parent , model_evaluation_slices ])
1613
+ if request is not None and has_flattened_params :
1614
+ raise ValueError (
1615
+ "If the `request` argument is set, then none of "
1616
+ "the individual field arguments should be set."
1617
+ )
1618
+
1619
+ request = model_service .BatchImportModelEvaluationSlicesRequest (request )
1620
+
1621
+ # If we have keyword arguments corresponding to fields on the
1622
+ # request, apply these.
1623
+ if parent is not None :
1624
+ request .parent = parent
1625
+ if model_evaluation_slices :
1626
+ request .model_evaluation_slices .extend (model_evaluation_slices )
1627
+
1628
+ # Wrap the RPC method; this adds retry and timeout information,
1629
+ # and friendly error handling.
1630
+ rpc = gapic_v1 .method_async .wrap_method (
1631
+ self ._client ._transport .batch_import_model_evaluation_slices ,
1632
+ default_timeout = None ,
1633
+ client_info = DEFAULT_CLIENT_INFO ,
1634
+ )
1635
+
1636
+ # Certain fields should be provided within the metadata header;
1637
+ # add these here.
1638
+ metadata = tuple (metadata ) + (
1639
+ gapic_v1 .routing_header .to_grpc_metadata ((("parent" , request .parent ),)),
1640
+ )
1641
+
1642
+ # Send the request.
1643
+ response = await rpc (
1644
+ request ,
1645
+ retry = retry ,
1646
+ timeout = timeout ,
1647
+ metadata = metadata ,
1648
+ )
1649
+
1650
+ # Done; return the response.
1651
+ return response
1652
+
1542
1653
async def get_model_evaluation (
1543
1654
self ,
1544
1655
request : Union [model_service .GetModelEvaluationRequest , dict ] = None ,
0 commit comments