pub struct ConversationModels { /* private fields */ }conversation-models only.Expand description
Implements a client for the Dialogflow API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
async fn sample(
parent: &str,
) -> anyhow::Result<()> {
let client = ConversationModels::builder().build().await?;
let mut list = client.list_conversation_models()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}§Service Description
Manages a collection of models for human agent assistant.
§Configuration
To configure ConversationModels 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://dialogflow.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
ConversationModels holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap ConversationModels in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl ConversationModels
impl ConversationModels
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for ConversationModels.
let client = ConversationModels::builder().build().await?;Sourcepub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: ConversationModels + 'static,
pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: ConversationModels + '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_conversation_model(&self) -> CreateConversationModel
pub fn create_conversation_model(&self) -> CreateConversationModel
Creates a model.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: CreateConversationModelOperationMetadataresponse: ConversationModel
§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.
§Example
use google_cloud_lro::Poller;
use google_cloud_dialogflow_v2::model::ConversationModel;
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels, parent: &str
) -> Result<()> {
let response = client.create_conversation_model()
.set_parent(parent)
.set_conversation_model(
ConversationModel::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_conversation_model(&self) -> GetConversationModel
pub fn get_conversation_model(&self) -> GetConversationModel
Gets conversation model.
§Example
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels
) -> Result<()> {
let response = client.get_conversation_model()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_conversation_models(&self) -> ListConversationModels
pub fn list_conversation_models(&self) -> ListConversationModels
Lists conversation models.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels, parent: &str
) -> Result<()> {
let mut list = client.list_conversation_models()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn delete_conversation_model(&self) -> DeleteConversationModel
pub fn delete_conversation_model(&self) -> DeleteConversationModel
Deletes a model.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: DeleteConversationModelOperationMetadataresponse: An Empty message
§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.
§Example
use google_cloud_lro::Poller;
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels
) -> Result<()> {
client.delete_conversation_model()
/* set fields */
.poller().until_done().await?;
Ok(())
}Sourcepub fn deploy_conversation_model(&self) -> DeployConversationModel
pub fn deploy_conversation_model(&self) -> DeployConversationModel
Deploys a model. If a model is already deployed, deploying it has no effect. A model can only serve prediction requests after it gets deployed. For article suggestion, custom model will not be used unless it is deployed.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: DeployConversationModelOperationMetadataresponse: An Empty message
§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.
§Example
use google_cloud_lro::Poller;
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels
) -> Result<()> {
client.deploy_conversation_model()
/* set fields */
.poller().until_done().await?;
Ok(())
}Sourcepub fn undeploy_conversation_model(&self) -> UndeployConversationModel
pub fn undeploy_conversation_model(&self) -> UndeployConversationModel
Undeploys a model. If the model is not deployed this method has no effect. If the model is currently being used:
- For article suggestion, article suggestion will fallback to the default model if model is undeployed.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: UndeployConversationModelOperationMetadataresponse: An Empty message
§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.
§Example
use google_cloud_lro::Poller;
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels
) -> Result<()> {
client.undeploy_conversation_model()
/* set fields */
.poller().until_done().await?;
Ok(())
}Sourcepub fn get_conversation_model_evaluation(
&self,
) -> GetConversationModelEvaluation
pub fn get_conversation_model_evaluation( &self, ) -> GetConversationModelEvaluation
Gets an evaluation of conversation model.
§Example
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels
) -> Result<()> {
let response = client.get_conversation_model_evaluation()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_conversation_model_evaluations(
&self,
) -> ListConversationModelEvaluations
pub fn list_conversation_model_evaluations( &self, ) -> ListConversationModelEvaluations
Lists evaluations of a conversation model.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels, parent: &str
) -> Result<()> {
let mut list = client.list_conversation_model_evaluations()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn create_conversation_model_evaluation(
&self,
) -> CreateConversationModelEvaluation
pub fn create_conversation_model_evaluation( &self, ) -> CreateConversationModelEvaluation
Creates evaluation of a conversation 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.
§Example
use google_cloud_lro::Poller;
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels
) -> Result<()> {
let response = client.create_conversation_model_evaluation()
/* set fields */
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_locations(&self) -> ListLocations
pub fn list_locations(&self) -> ListLocations
Lists information about the supported locations for this service.
This method lists locations based on the resource scope provided in the [ListLocationsRequest.name] field:
- Global locations: If
nameis empty, the method lists the public locations available to all projects. * Project-specific locations: Ifnamefollows the formatprojects/{project}, the method lists locations visible to that specific project. This includes public, private, or other project-specific locations enabled for the project.
For gRPC and client library implementations, the resource name is
passed as the name field. For direct service calls, the resource
name is
incorporated into the request path based on the specific service
implementation and version.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels
) -> Result<()> {
let mut list = client.list_locations()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_location(&self) -> GetLocation
pub fn get_location(&self) -> GetLocation
Gets information about a location.
§Example
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels
) -> Result<()> {
let response = client.get_location()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_operations(&self) -> ListOperations
pub fn list_operations(&self) -> ListOperations
Provides the Operations service functionality in this service.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels
) -> Result<()> {
let mut list = client.list_operations()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
§Example
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels
) -> Result<()> {
let response = client.get_operation()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn cancel_operation(&self) -> CancelOperation
pub fn cancel_operation(&self) -> CancelOperation
Provides the Operations service functionality in this service.
§Example
use google_cloud_dialogflow_v2::Result;
async fn sample(
client: &ConversationModels
) -> Result<()> {
client.cancel_operation()
/* set fields */
.send().await?;
Ok(())
}Trait Implementations§
Source§impl Clone for ConversationModels
impl Clone for ConversationModels
Source§fn clone(&self) -> ConversationModels
fn clone(&self) -> ConversationModels
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more