pub enum ModelContentItem {
System(SystemModelContent),
User(UserModelContent),
Agent(AgentModelContent),
MergeDownstream(String),
MergeUpstream(String),
}Expand description
An enum that represents a single piece of content in a conversation or prompt sent to a model. It distinguishes between system instructions, user input, and agent responses.
Each variant wraps a specific content type ([SystemModelContent], [UserModelContent], [AgentModelContent]),
allowing the execution engine to categorize and format different parts of a prompt
appropriately for an external model.
Variants§
System(SystemModelContent)
Content provided by the system, typically for instructions or context.
User(UserModelContent)
Content provided by the user, representing direct input or queries.
Agent(AgentModelContent)
Content generated by an AI agent or a previous model response.
MergeDownstream(String)
Content to merge to next message as a prefix. This is used internally to handle special merging logic during prompt construction.
MergeUpstream(String)
Content to merge to previous message as a postfix. This is used internally to handle special merging logic during prompt construction.
Implementations§
Source§impl ModelContentItem
impl ModelContentItem
Sourcepub fn merge_downstream(text: &str) -> Self
pub fn merge_downstream(text: &str) -> Self
Creates a new ModelContentItem::MergeDownstream from a string slice.
This variant is used internally to indicate that its content should be prepended
to the next non-merge ModelContentItem during prompt construction.
§Arguments
text- The text content to be merged downstream.
§Returns
A ModelContentItem::MergeDownstream variant.
Sourcepub fn merge_upstream(text: &str) -> Self
pub fn merge_upstream(text: &str) -> Self
Creates a new ModelContentItem::MergeUpstream from a string slice.
This variant is used internally to indicate that its content should be appended
to the previous non-merge ModelContentItem during prompt construction.
§Arguments
text- The text content to be merged upstream.
§Returns
A ModelContentItem::MergeUpstream variant.
Trait Implementations§
Source§impl Clone for ModelContentItem
impl Clone for ModelContentItem
Source§fn clone(&self) -> ModelContentItem
fn clone(&self) -> ModelContentItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more