pub enum PromptContentReference {
Inline(String),
FilePath {
path: PathBuf,
description: String,
},
}Expand description
Represents content that can be either inline or referenced by path.
When content is small enough, it’s embedded directly in the prompt.
When content exceeds MAX_INLINE_CONTENT_SIZE, instructions are
provided to the agent to read the content from a file.
Variants§
Inline(String)
Content is small enough to embed inline in the prompt.
FilePath
Content is too large; agent should read from this absolute path.
Implementations§
Source§impl PromptContentReference
impl PromptContentReference
Sourcepub fn from_content(
content: String,
backup_path: &Path,
description: &str,
) -> Self
pub fn from_content( content: String, backup_path: &Path, description: &str, ) -> Self
Create a content reference, choosing inline vs path based on size.
If content.len() <= MAX_INLINE_CONTENT_SIZE, the content is stored inline.
Otherwise, a file path reference is created.
§Arguments
content- The content to referencebackup_path- Path where the content can be read if too largedescription- Description of the content for agent instructions
Sourcepub fn file_path(path: PathBuf, description: &str) -> Self
pub fn file_path(path: PathBuf, description: &str) -> Self
Create a file path reference (for large content).
Sourcepub fn render_for_template(&self) -> String
pub fn render_for_template(&self) -> String
Get the content for template rendering.
For inline: returns the content directly. For file path: returns instructions to read from the file.
Trait Implementations§
Source§impl Clone for PromptContentReference
impl Clone for PromptContentReference
Source§fn clone(&self) -> PromptContentReference
fn clone(&self) -> PromptContentReference
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 PromptContentReference
impl Debug for PromptContentReference
Source§impl PartialEq for PromptContentReference
impl PartialEq for PromptContentReference
impl Eq for PromptContentReference
impl StructuralPartialEq for PromptContentReference
Auto Trait Implementations§
impl Freeze for PromptContentReference
impl RefUnwindSafe for PromptContentReference
impl Send for PromptContentReference
impl Sync for PromptContentReference
impl Unpin for PromptContentReference
impl UnwindSafe for PromptContentReference
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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