pub enum SlotRecognizer {
Integer,
IntegerNear(Vec<String>),
Money,
Regex(String),
OneOf(Vec<String>),
Fuzzy(Vec<String>),
YesNo,
DateTime,
}Expand description
A serializable description of the deterministic recognizer that fills a slot.
Mirrors Recognizer but is serde-friendly (it holds patterns/options as
data, not a compiled Regex), so a FrameSpec — and the conversation spec
that embeds it — round-trips through JSON/YAML. Lower to a runtime recognizer
with SlotRecognizer::to_recognizer.
Variants§
Integer
First integer in the text.
IntegerNear(Vec<String>)
First integer, but only when one of these anchor words is present.
Money
A monetary amount.
Regex(String)
First capture (or whole match) of this regex pattern.
OneOf(Vec<String>)
The first of these options to appear (case-insensitive substring).
Fuzzy(Vec<String>)
The best Jaro-Winkler match among these options.
YesNo
Affirmative/negative → boolean.
DateTime
A calendar/clock expression → a JSON object.
Implementations§
Source§impl SlotRecognizer
impl SlotRecognizer
Sourcepub fn to_recognizer(&self) -> Recognizer
pub fn to_recognizer(&self) -> Recognizer
Lower to a runtime Recognizer.
Trait Implementations§
Source§impl Clone for SlotRecognizer
impl Clone for SlotRecognizer
Source§fn clone(&self) -> SlotRecognizer
fn clone(&self) -> SlotRecognizer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SlotRecognizer
impl Debug for SlotRecognizer
Source§impl<'de> Deserialize<'de> for SlotRecognizer
impl<'de> Deserialize<'de> for SlotRecognizer
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for SlotRecognizer
impl JsonSchema for SlotRecognizer
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for SlotRecognizer
impl PartialEq for SlotRecognizer
Source§impl Serialize for SlotRecognizer
impl Serialize for SlotRecognizer
impl StructuralPartialEq for SlotRecognizer
Auto Trait Implementations§
impl Freeze for SlotRecognizer
impl RefUnwindSafe for SlotRecognizer
impl Send for SlotRecognizer
impl Sync for SlotRecognizer
impl Unpin for SlotRecognizer
impl UnwindSafe for SlotRecognizer
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].