#[non_exhaustive]pub struct ExplainRequest {
pub endpoint: String,
pub instances: Vec<Value>,
pub parameters: Option<Value>,
pub explanation_spec_override: Option<ExplanationSpecOverride>,
pub deployed_model_id: String,
/* private fields */
}prediction-service only.Expand description
Request message for PredictionService.Explain.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.endpoint: StringRequired. The name of the Endpoint requested to serve the explanation.
Format:
projects/{project}/locations/{location}/endpoints/{endpoint}
instances: Vec<Value>Required. The instances that are the input to the explanation call. A DeployedModel may have an upper limit on the number of instances it supports per request, and when it is exceeded the explanation call errors in case of AutoML Models, or, in case of customer created Models, the behaviour is as documented by that Model. The schema of any single instance may be specified via Endpoint’s DeployedModels’ Model’s PredictSchemata’s instance_schema_uri.
parameters: Option<Value>The parameters that govern the prediction. The schema of the parameters may be specified via Endpoint’s DeployedModels’ Model’s PredictSchemata’s parameters_schema_uri.
explanation_spec_override: Option<ExplanationSpecOverride>If specified, overrides the explanation_spec of the DeployedModel. Can be used for explaining prediction results with different configurations, such as:
- Explaining top-5 predictions results as opposed to top-1;
- Increasing path count or step count of the attribution methods to reduce approximate errors;
- Using different baselines for explaining the prediction results.
deployed_model_id: StringIf specified, this ExplainRequest will be served by the chosen DeployedModel, overriding Endpoint.traffic_split.
Implementations§
Source§impl ExplainRequest
impl ExplainRequest
Sourcepub fn set_endpoint<T: Into<String>>(self, v: T) -> Self
pub fn set_endpoint<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_instances<T, V>(self, v: T) -> Self
pub fn set_instances<T, V>(self, v: T) -> Self
Sourcepub fn set_parameters<T>(self, v: T) -> Self
pub fn set_parameters<T>(self, v: T) -> Self
Sets the value of parameters.
§Example
use wkt::Value;
let x = ExplainRequest::new().set_parameters(Value::default()/* use setters */);Sourcepub fn set_or_clear_parameters<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_parameters<T>(self, v: Option<T>) -> Self
Sets or clears the value of parameters.
§Example
use wkt::Value;
let x = ExplainRequest::new().set_or_clear_parameters(Some(Value::default()/* use setters */));
let x = ExplainRequest::new().set_or_clear_parameters(None::<Value>);Sourcepub fn set_explanation_spec_override<T>(self, v: T) -> Selfwhere
T: Into<ExplanationSpecOverride>,
pub fn set_explanation_spec_override<T>(self, v: T) -> Selfwhere
T: Into<ExplanationSpecOverride>,
Sets the value of explanation_spec_override.
§Example
use google_cloud_aiplatform_v1::model::ExplanationSpecOverride;
let x = ExplainRequest::new().set_explanation_spec_override(ExplanationSpecOverride::default()/* use setters */);Sourcepub fn set_or_clear_explanation_spec_override<T>(self, v: Option<T>) -> Selfwhere
T: Into<ExplanationSpecOverride>,
pub fn set_or_clear_explanation_spec_override<T>(self, v: Option<T>) -> Selfwhere
T: Into<ExplanationSpecOverride>,
Sets or clears the value of explanation_spec_override.
§Example
use google_cloud_aiplatform_v1::model::ExplanationSpecOverride;
let x = ExplainRequest::new().set_or_clear_explanation_spec_override(Some(ExplanationSpecOverride::default()/* use setters */));
let x = ExplainRequest::new().set_or_clear_explanation_spec_override(None::<ExplanationSpecOverride>);Sourcepub fn set_deployed_model_id<T: Into<String>>(self, v: T) -> Self
pub fn set_deployed_model_id<T: Into<String>>(self, v: T) -> Self
Sets the value of deployed_model_id.
§Example
let x = ExplainRequest::new().set_deployed_model_id("example");Trait Implementations§
Source§impl Clone for ExplainRequest
impl Clone for ExplainRequest
Source§fn clone(&self) -> ExplainRequest
fn clone(&self) -> ExplainRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExplainRequest
impl Debug for ExplainRequest
Source§impl Default for ExplainRequest
impl Default for ExplainRequest
Source§fn default() -> ExplainRequest
fn default() -> ExplainRequest
Source§impl Message for ExplainRequest
impl Message for ExplainRequest
Source§impl PartialEq for ExplainRequest
impl PartialEq for ExplainRequest
impl StructuralPartialEq for ExplainRequest
Auto Trait Implementations§
impl Freeze for ExplainRequest
impl RefUnwindSafe for ExplainRequest
impl Send for ExplainRequest
impl Sync for ExplainRequest
impl Unpin for ExplainRequest
impl UnsafeUnpin for ExplainRequest
impl UnwindSafe for ExplainRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request