#[non_exhaustive]pub struct AIInference {
pub endpoint: String,
pub service_account_email: String,
pub inference_mode: Option<InferenceMode>,
/* private fields */
}Expand description
Configuration for making inference requests against Vertex AI models.
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. An endpoint to a Vertex AI model of the form
projects/{project}/locations/{location}/endpoints/{endpoint} or
projects/{project}/locations/{location}/publishers/{publisher}/models/{model}.
Vertex AI API requests will be sent to this endpoint.
service_account_email: StringOptional. The service account to use to make prediction requests against
endpoints. The resource creator or updater that specifies this field must
have iam.serviceAccounts.actAs permission on the service account. If not
specified, the Pub/Sub service
agent,
service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
inference_mode: Option<InferenceMode>The format of inference requests made to the endpoint.
Implementations§
Source§impl AIInference
impl AIInference
pub fn new() -> Self
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_service_account_email<T: Into<String>>(self, v: T) -> Self
pub fn set_service_account_email<T: Into<String>>(self, v: T) -> Self
Sets the value of service_account_email.
§Example
let x = AIInference::new().set_service_account_email("example");Sourcepub fn set_inference_mode<T: Into<Option<InferenceMode>>>(self, v: T) -> Self
pub fn set_inference_mode<T: Into<Option<InferenceMode>>>(self, v: T) -> Self
Sets the value of inference_mode.
Note that all the setters affecting inference_mode are mutually
exclusive.
§Example
use google_cloud_pubsub::model::ai_inference::UnstructuredInference;
let x = AIInference::new().set_inference_mode(Some(
google_cloud_pubsub::model::ai_inference::InferenceMode::UnstructuredInference(UnstructuredInference::default().into())));Sourcepub fn unstructured_inference(&self) -> Option<&Box<UnstructuredInference>>
pub fn unstructured_inference(&self) -> Option<&Box<UnstructuredInference>>
The value of inference_mode
if it holds a UnstructuredInference, None if the field is not set or
holds a different branch.
Sourcepub fn set_unstructured_inference<T: Into<Box<UnstructuredInference>>>(
self,
v: T,
) -> Self
pub fn set_unstructured_inference<T: Into<Box<UnstructuredInference>>>( self, v: T, ) -> Self
Sets the value of inference_mode
to hold a UnstructuredInference.
Note that all the setters affecting inference_mode are
mutually exclusive.
§Example
use google_cloud_pubsub::model::ai_inference::UnstructuredInference;
let x = AIInference::new().set_unstructured_inference(UnstructuredInference::default()/* use setters */);
assert!(x.unstructured_inference().is_some());Trait Implementations§
Source§impl Clone for AIInference
impl Clone for AIInference
Source§fn clone(&self) -> AIInference
fn clone(&self) -> AIInference
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AIInference
impl Debug for AIInference
Source§impl Default for AIInference
impl Default for AIInference
Source§fn default() -> AIInference
fn default() -> AIInference
Source§impl Message for AIInference
impl Message for AIInference
Source§impl PartialEq for AIInference
impl PartialEq for AIInference
impl StructuralPartialEq for AIInference
Auto Trait Implementations§
impl Freeze for AIInference
impl RefUnwindSafe for AIInference
impl Send for AIInference
impl Sync for AIInference
impl Unpin for AIInference
impl UnwindSafe for AIInference
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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