Skip to content

Commit

Permalink
fix: Missing request parameter for v1beta explain.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 591298842
  • Loading branch information
vertex-sdk-bot authored and copybara-github committed Dec 15, 2023
1 parent 4e891f7 commit 443fa9d
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions google/cloud/aiplatform/preview/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@ def explain(
"""
self.wait()
request = gca_prediction_service_compat.ExplainRequest()
request.endpoint = self.resource_name

if instances is not None:
request.instances.extend(instances)
Expand Down Expand Up @@ -1199,14 +1200,21 @@ async def explain_async(
"""
self.wait()

request = gca_prediction_service_compat.ExplainRequest(
endpoint=self.resource_name,
instances=instances,
parameters=parameters,
deployed_model_id=deployed_model_id,
explanation_spec_override=explanation_spec_override,
concurrent_explanation_spec_override=concurrent_explanation_spec_override,
)
request = gca_prediction_service_compat.ExplainRequest()
request.endpoint = self.resource_name

if instances is not None:
request.instances.extend(instances)
if parameters is not None:
request.parameters = parameters
if deployed_model_id is not None:
request.deployed_model_id = deployed_model_id
if explanation_spec_override is not None:
request.explanation_spec_override = explanation_spec_override
if concurrent_explanation_spec_override is not None:
request.concurrent_explanation_spec_override = (
concurrent_explanation_spec_override
)

explain_response = await self._prediction_async_client.select_version(
"v1beta1"
Expand Down

0 comments on commit 443fa9d

Please sign in to comment.