pub struct PromptContext {
pub task_description: String,
pub examples: Vec<ExampleData>,
pub input_text: String,
pub additional_context: Option<String>,
pub schema_hint: Option<String>,
pub variables: HashMap<String, String>,
}
Expand description
Context for rendering prompts
Fields§
§task_description: String
Task description for what to extract
examples: Vec<ExampleData>
Example data to guide extraction
input_text: String
Input text to process
additional_context: Option<String>
Additional context information
schema_hint: Option<String>
Schema hint for structured output
variables: HashMap<String, String>
Custom variables for template substitution
Implementations§
Source§impl PromptContext
impl PromptContext
Sourcepub fn with_examples(self, examples: Vec<ExampleData>) -> Self
pub fn with_examples(self, examples: Vec<ExampleData>) -> Self
Add examples to the context
Sourcepub fn with_context(self, context: String) -> Self
pub fn with_context(self, context: String) -> Self
Add additional context
Sourcepub fn with_variable(self, key: String, value: String) -> Self
pub fn with_variable(self, key: String, value: String) -> Self
Add a custom variable
Sourcepub fn with_schema_hint(self, hint: String) -> Self
pub fn with_schema_hint(self, hint: String) -> Self
Add schema hint
Trait Implementations§
Source§impl Clone for PromptContext
impl Clone for PromptContext
Source§fn clone(&self) -> PromptContext
fn clone(&self) -> PromptContext
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 moreAuto Trait Implementations§
impl Freeze for PromptContext
impl RefUnwindSafe for PromptContext
impl Send for PromptContext
impl Sync for PromptContext
impl Unpin for PromptContext
impl UnwindSafe for PromptContext
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