#[non_exhaustive]pub struct Parameter {
pub name: String,
pub display_name: String,
pub value: String,
pub default_value: String,
pub entity_type_display_name: String,
pub mandatory: bool,
pub prompts: Vec<String>,
pub is_list: bool,
/* private fields */
}answer-records or intents or participants or sessions only.Expand description
Represents intent parameters.
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.name: StringThe unique identifier of this parameter.
display_name: StringRequired. The name of the parameter.
value: StringOptional. The definition of the parameter value. It can be:
- a constant string,
- a parameter value defined as
$parameter_name, - an original parameter value defined as
$parameter_name.original, - a parameter value from some context defined as
#context_name.parameter_name.
default_value: StringOptional. The default value to use when the value yields an empty
result.
Default values can be extracted from contexts by using the following
syntax: #context_name.parameter_name.
entity_type_display_name: StringOptional. The name of the entity type, prefixed with @, that
describes values of the parameter. If the parameter is
required, this must be provided.
mandatory: boolOptional. Indicates whether the parameter is required. That is, whether the intent cannot be completed without collecting the parameter value.
prompts: Vec<String>Optional. The collection of prompts that the agent can present to the user in order to collect a value for the parameter.
is_list: boolOptional. Indicates whether the parameter represents a list of values.
Implementations§
Source§impl Parameter
impl Parameter
pub fn new() -> Self
Sourcepub fn set_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_display_name<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_default_value<T: Into<String>>(self, v: T) -> Self
pub fn set_default_value<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_entity_type_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_entity_type_display_name<T: Into<String>>(self, v: T) -> Self
Sets the value of entity_type_display_name.
§Example
let x = Parameter::new().set_entity_type_display_name("example");