pub struct ProposedContent {
pub id: String,
pub kind: ContentKind,
pub content: String,
pub structured: Option<Value>,
pub confidence: Option<f32>,
pub requires_human: bool,
}Expand description
A proposed piece of content (not yet a Fact).
This is the backend-level proposal type. It gets wrapped in
KernelProposal at the kernel boundary.
Fields§
§id: StringUnique identifier
kind: ContentKindThe content type
content: StringThe actual content
structured: Option<Value>Structured content (if applicable)
confidence: Option<f32>Confidence score (0.0 - 1.0)
requires_human: boolWhether this requires human approval
Implementations§
Source§impl ProposedContent
impl ProposedContent
Sourcepub fn new(
id: impl Into<String>,
kind: ContentKind,
content: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, kind: ContentKind, content: impl Into<String>, ) -> Self
Create a new proposed content with minimal fields.
Sourcepub fn with_human_required(self) -> Self
pub fn with_human_required(self) -> Self
Mark this proposal as requiring human approval.
Sourcepub fn with_confidence(self, confidence: f32) -> Self
pub fn with_confidence(self, confidence: f32) -> Self
Add confidence score.
Trait Implementations§
Source§impl Clone for ProposedContent
impl Clone for ProposedContent
Source§fn clone(&self) -> ProposedContent
fn clone(&self) -> ProposedContent
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 ProposedContent
impl Debug for ProposedContent
Source§impl<'de> Deserialize<'de> for ProposedContent
impl<'de> Deserialize<'de> for ProposedContent
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
Auto Trait Implementations§
impl Freeze for ProposedContent
impl RefUnwindSafe for ProposedContent
impl Send for ProposedContent
impl Sync for ProposedContent
impl Unpin for ProposedContent
impl UnwindSafe for ProposedContent
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