pub struct ModelService { /* private fields */ }Expand description
Implements a client for the Vertex AI Search for commerce API.
§Example
let client = ModelService::builder().build().await?;
// use `client` to make requests to the Vertex AI Search for commerce API.§Service Description
Service for performing CRUD operations on models.
Recommendation models contain all the metadata necessary to generate a set of
models for the Predict() API. A model is queried
indirectly via a ServingConfig, which associates a model with a
given Placement (e.g. Frequently Bought Together on Home Page).
This service allows you to do the following:
- Initiate training of a model.
- Pause training of an existing model.
- List all the available models along with their metadata.
- Control their tuning schedule.
§Configuration
To configure ModelService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://retail.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
ModelService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap ModelService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl ModelService
impl ModelService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for ModelService.
let client = ModelService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: ModelService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: ModelService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_model(&self) -> CreateModel
pub fn create_model(&self) -> CreateModel
Creates a new model.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn pause_model(&self) -> PauseModel
pub fn pause_model(&self) -> PauseModel
Pauses the training of an existing model.
Sourcepub fn resume_model(&self) -> ResumeModel
pub fn resume_model(&self) -> ResumeModel
Resumes the training of an existing model.
Sourcepub fn delete_model(&self) -> DeleteModel
pub fn delete_model(&self) -> DeleteModel
Deletes an existing model.
Sourcepub fn list_models(&self) -> ListModels
pub fn list_models(&self) -> ListModels
Lists all the models linked to this event store.
Sourcepub fn update_model(&self) -> UpdateModel
pub fn update_model(&self) -> UpdateModel
Update of model metadata. Only fields that
currently can be updated are: filtering_option and
periodic_tuning_state.
If other values are provided, this API method ignores them.
Sourcepub fn tune_model(&self) -> TuneModel
pub fn tune_model(&self) -> TuneModel
Tunes an existing model.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn list_operations(&self) -> ListOperations
pub fn list_operations(&self) -> ListOperations
Provides the Operations service functionality in this service.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
Trait Implementations§
Source§impl Clone for ModelService
impl Clone for ModelService
Source§fn clone(&self) -> ModelService
fn clone(&self) -> ModelService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more