#[non_exhaustive]pub struct FaqAnswer {
pub answer: String,
pub confidence: f32,
pub question: String,
pub source: String,
pub metadata: HashMap<String, String>,
pub answer_record: String,
/* private fields */
}Available on crate features
answer-records or participants only.Expand description
Represents answer from “frequently asked questions”.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.answer: StringThe piece of text from the source knowledge base document.
confidence: f32The system’s confidence score that this Knowledge answer is a good match for this conversational query, range from 0.0 (completely uncertain) to 1.0 (completely certain).
question: StringThe corresponding FAQ question.
source: StringIndicates which Knowledge Document this answer was extracted
from.
Format: projects/<Project ID>/locations/<Location ID>/agent/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>.
metadata: HashMap<String, String>A map that contains metadata about the answer and the document from which it originates.
answer_record: StringThe name of answer record, in the format of “projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record ID>”
Implementations§
Source§impl FaqAnswer
impl FaqAnswer
pub fn new() -> Self
Sourcepub fn set_answer<T: Into<String>>(self, v: T) -> Self
pub fn set_answer<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_confidence<T: Into<f32>>(self, v: T) -> Self
pub fn set_confidence<T: Into<f32>>(self, v: T) -> Self
Sourcepub fn set_question<T: Into<String>>(self, v: T) -> Self
pub fn set_question<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_source<T: Into<String>>(self, v: T) -> Self
pub fn set_source<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_metadata<T, K, V>(self, v: T) -> Self
pub fn set_metadata<T, K, V>(self, v: T) -> Self
Sourcepub fn set_answer_record<T: Into<String>>(self, v: T) -> Self
pub fn set_answer_record<T: Into<String>>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for FaqAnswer
Auto Trait Implementations§
impl Freeze for FaqAnswer
impl RefUnwindSafe for FaqAnswer
impl Send for FaqAnswer
impl Sync for FaqAnswer
impl Unpin for FaqAnswer
impl UnsafeUnpin for FaqAnswer
impl UnwindSafe for FaqAnswer
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