pub struct TurnPrompt {
pub attachments: Vec<TurnPromptAttachment>,
pub text: String,
pub text_source: TurnPromptTextSource,
}Expand description
Structured prompt payload for one agent turn.
Fields§
§attachments: Vec<TurnPromptAttachment>Ordered local image attachments referenced by text.
text: StringPrompt text payload, including inline placeholders when present.
text_source: TurnPromptTextSourceSource classification that controls prompt-only text rewrites.
Implementations§
Source§impl TurnPrompt
impl TurnPrompt
Sourcepub fn from_agent_data(text: String) -> Self
pub fn from_agent_data(text: String) -> Self
Creates a generated-data prompt payload that is sent to the agent
without user prompt @path lookup rewriting.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns whether the payload contains no text and no attachments.
Sourcepub fn has_attachments(&self) -> bool
pub fn has_attachments(&self) -> bool
Returns whether the payload contains one or more image attachments.
Sourcepub fn local_image_paths(&self) -> impl Iterator<Item = &PathBuf>
pub fn local_image_paths(&self) -> impl Iterator<Item = &PathBuf>
Returns the local image paths referenced by this prompt payload.
Sourcepub fn ends_with(&self, suffix: &str) -> bool
pub fn ends_with(&self, suffix: &str) -> bool
Returns whether the prompt text ends with suffix.
Sourcepub fn agent_text(&self) -> String
pub fn agent_text(&self) -> String
Returns the prompt text as it should be sent to an agent runtime.
User-authored @path lookups are rewritten to quoted path tokens for
transport. Generated agent data is returned unchanged so source content
such as Python decorators keeps its leading @.
Sourcepub fn content_parts(&self) -> Vec<TurnPromptContentPart<'_>>
pub fn content_parts(&self) -> Vec<TurnPromptContentPart<'_>>
Returns prompt text spans and image attachments in transport order.
Attachments are ordered by their placeholder position in text. Any
attachment whose placeholder no longer exists in the text is appended
after the trailing text so transports can still serialize the image
instead of dropping it silently.
Sourcepub fn transcript_text(&self) -> String
pub fn transcript_text(&self) -> String
Returns the prompt text as it should be written into persisted transcripts.
Inline [Image #n] markers are preserved verbatim. If attachment
metadata somehow survives without its placeholder still present in the
text, the missing placeholders are appended in attachment order so the
transcript does not silently become text-only.
Trait Implementations§
Source§impl Clone for TurnPrompt
impl Clone for TurnPrompt
Source§fn clone(&self) -> TurnPrompt
fn clone(&self) -> TurnPrompt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more