pub enum AgentStyle {
GeneralPurpose,
Plan,
Verification,
Explore,
CodeReview,
}Expand description
Agent style — determines which system prompt template is used.
Each style has a different focus and behavior, selected based on the user’s apparent intent from their message.
Variants§
GeneralPurpose
Default — general purpose coding agent for research and multi-step tasks.
Plan
Read-only planning and architecture analysis. Prohibited from modifying files, focuses on design and planning.
Verification
Adversarial verification specialist — tries to break code, not confirm it works.
Explore
Fast file search and codebase exploration. Read-only, optimized for finding files and patterns quickly.
CodeReview
Code review focused — analyzes code quality, best practices, potential issues.
Implementations§
Source§impl AgentStyle
impl AgentStyle
Sourcepub fn base_prompt(&self) -> &'static str
pub fn base_prompt(&self) -> &'static str
Returns the base system prompt for this style.
Sourcepub fn guidelines(&self) -> Option<&'static str>
pub fn guidelines(&self) -> Option<&'static str>
Returns style-specific guidelines if any.
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Returns a one-line description of this style.
Sourcepub fn requires_planning(&self) -> bool
pub fn requires_planning(&self) -> bool
Returns true if this style benefits from a planning phase.
Planning is beneficial for styles that involve multi-step execution or where a structured approach improves outcomes.
Sourcepub fn detect_with_confidence(message: &str) -> (Self, DetectionConfidence)
pub fn detect_with_confidence(message: &str) -> (Self, DetectionConfidence)
Detects the most appropriate agent style based on user message content, along with a confidence level.
Use this for fast-path keyword matching. When confidence is [Low],
consider using detect_with_llm for
more accurate classification.
Sourcepub fn detect_from_message(message: &str) -> Self
pub fn detect_from_message(message: &str) -> Self
Detects the most appropriate agent style based on user message content.
This is a simple keyword-based heuristic. For more precise control,
users can explicitly set the style via SystemPromptSlots::with_style().
Sourcepub async fn detect_with_llm(llm: &dyn LlmClient, message: &str) -> Result<Self>
pub async fn detect_with_llm(llm: &dyn LlmClient, message: &str) -> Result<Self>
Classifies user intent using LLM when keyword confidence is low.
This is called when [detect_with_confidence] returns [Low] confidence,
indicating the message doesn’t have clear keyword indicators.
Uses a lightweight classification prompt that returns a single word.
Trait Implementations§
Source§impl Clone for AgentStyle
impl Clone for AgentStyle
Source§fn clone(&self) -> AgentStyle
fn clone(&self) -> AgentStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentStyle
impl Debug for AgentStyle
Source§impl Default for AgentStyle
impl Default for AgentStyle
Source§fn default() -> AgentStyle
fn default() -> AgentStyle
Source§impl PartialEq for AgentStyle
impl PartialEq for AgentStyle
impl Copy for AgentStyle
impl Eq for AgentStyle
impl StructuralPartialEq for AgentStyle
Auto Trait Implementations§
impl Freeze for AgentStyle
impl RefUnwindSafe for AgentStyle
impl Send for AgentStyle
impl Sync for AgentStyle
impl Unpin for AgentStyle
impl UnsafeUnpin for AgentStyle
impl UnwindSafe for AgentStyle
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
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§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
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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