pub struct Document {
pub text: String,
pub additional_context: Option<String>,
pub document_id: Option<String>,
}
Expand description
Document class for input text
Represents a single document to be processed by the annotation pipeline.
Fields§
§text: String
Raw text content of the document
additional_context: Option<String>
Optional additional context to supplement prompt instructions
document_id: Option<String>
Unique identifier for the document
Implementations§
Source§impl Document
impl Document
Sourcepub fn with_context(text: String, additional_context: String) -> Self
pub fn with_context(text: String, additional_context: String) -> Self
Create a new document with text and additional context
Sourcepub fn get_document_id(&mut self) -> String
pub fn get_document_id(&mut self) -> String
Get or generate a document ID
Sourcepub fn set_document_id(&mut self, id: String)
pub fn set_document_id(&mut self, id: String)
Set a specific document ID
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Document
impl<'de> Deserialize<'de> for Document
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
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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