#[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
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");Sourcepub fn set_mandatory<T: Into<bool>>(self, v: T) -> Self
pub fn set_mandatory<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_prompts<T, V>(self, v: T) -> Self
pub fn set_prompts<T, V>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for Parameter
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnsafeUnpin for Parameter
impl UnwindSafe for Parameter
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