pub struct ProjectPromptAssembler { /* private fields */ }Expand description
Prepend optional project preamble (e.g. AGENTS.md) to definition instructions.
Implementations§
Source§impl ProjectPromptAssembler
impl ProjectPromptAssembler
Sourcepub fn new() -> Self
pub fn new() -> Self
Empty preamble (equivalent to IdentityAssembler for assembly content).
Sourcepub fn from_project(cwd: impl AsRef<Path>) -> Result<Self, MachiError>
pub fn from_project(cwd: impl AsRef<Path>) -> Result<Self, MachiError>
Load AGENTS.md from cwd when present (missing file is not an error).
§Errors
Read failures when the file exists but cannot be read.
Sourcepub fn with_preamble(text: impl Into<String>) -> Self
pub fn with_preamble(text: impl Into<String>) -> Self
Use an explicit preamble string (trimmed; empty → none).
Sourcepub fn with_separator(self, sep: impl Into<String>) -> Self
pub fn with_separator(self, sep: impl Into<String>) -> Self
Override separator between preamble and agent body.
Sourcepub const fn has_preamble(&self) -> bool
pub const fn has_preamble(&self) -> bool
Whether a non-empty preamble is configured.
Trait Implementations§
Source§impl Clone for ProjectPromptAssembler
impl Clone for ProjectPromptAssembler
Source§fn clone(&self) -> ProjectPromptAssembler
fn clone(&self) -> ProjectPromptAssembler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ProjectPromptAssembler
impl Debug for ProjectPromptAssembler
Source§impl Default for ProjectPromptAssembler
impl Default for ProjectPromptAssembler
Source§impl PromptAssembler for ProjectPromptAssembler
impl PromptAssembler for ProjectPromptAssembler
Source§fn assemble(&self, definition: &AgentDefinition) -> Result<String, MachiError>
fn assemble(&self, definition: &AgentDefinition) -> Result<String, MachiError>
Produce the system prompt string for
definition. Read moreAuto Trait Implementations§
impl Freeze for ProjectPromptAssembler
impl RefUnwindSafe for ProjectPromptAssembler
impl Send for ProjectPromptAssembler
impl Sync for ProjectPromptAssembler
impl Unpin for ProjectPromptAssembler
impl UnsafeUnpin for ProjectPromptAssembler
impl UnwindSafe for ProjectPromptAssembler
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