pub struct IrisAgent { /* private fields */ }Expand description
The unified Iris agent that can handle any Git-Iris task
Note: This struct is Send + Sync safe - we don’t store the client builder,
instead we create it fresh when needed. This allows the agent to be used
across async boundaries with tokio::spawn.
Implementations§
Source§impl IrisAgent
impl IrisAgent
Sourcepub fn new(provider: &str, model: &str) -> Result<Self>
pub fn new(provider: &str, model: &str) -> Result<Self>
Create a new Iris agent with the given provider and model
Sourcepub fn set_content_update_sender(&mut self, sender: ContentUpdateSender)
pub fn set_content_update_sender(&mut self, sender: ContentUpdateSender)
Set the content update sender for Studio chat mode
When set, the agent will have access to tools for updating commit messages, PR descriptions, and reviews.
Sourcepub async fn execute_task(
&mut self,
capability: &str,
user_prompt: &str,
) -> Result<StructuredResponse>
pub async fn execute_task( &mut self, capability: &str, user_prompt: &str, ) -> Result<StructuredResponse>
Execute a task with the given capability and user prompt
This now automatically uses structured output based on the capability type
Sourcepub async fn execute_task_streaming<F>(
&mut self,
capability: &str,
user_prompt: &str,
on_chunk: F,
) -> Result<StructuredResponse>
pub async fn execute_task_streaming<F>( &mut self, capability: &str, user_prompt: &str, on_chunk: F, ) -> Result<StructuredResponse>
Execute a task with streaming, calling the callback with each text chunk
This enables real-time display of LLM output in the TUI.
The callback receives (chunk, aggregated_text) for each delta.
Returns the final structured response after streaming completes.
Sourcepub fn current_capability(&self) -> Option<&str>
pub fn current_capability(&self) -> Option<&str>
Get the current capability being executed
Sourcepub async fn chat(&self, message: &str) -> Result<String>
pub async fn chat(&self, message: &str) -> Result<String>
Simple single-turn execution for basic queries
Sourcepub fn set_capability(&mut self, capability: &str)
pub fn set_capability(&mut self, capability: &str)
Set the current capability
Sourcepub fn provider_config(&self) -> &HashMap<String, String>
pub fn provider_config(&self) -> &HashMap<String, String>
Get provider configuration
Sourcepub fn set_provider_config(&mut self, config: HashMap<String, String>)
pub fn set_provider_config(&mut self, config: HashMap<String, String>)
Set provider configuration
Sourcepub fn set_preamble(&mut self, preamble: String)
pub fn set_preamble(&mut self, preamble: String)
Set custom preamble
Sourcepub fn set_config(&mut self, config: Config)
pub fn set_config(&mut self, config: Config)
Set configuration
Sourcepub fn set_fast_model(&mut self, fast_model: String)
pub fn set_fast_model(&mut self, fast_model: String)
Set fast model for subagents
Auto Trait Implementations§
impl Freeze for IrisAgent
impl RefUnwindSafe for IrisAgent
impl Send for IrisAgent
impl Sync for IrisAgent
impl Unpin for IrisAgent
impl UnwindSafe for IrisAgent
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> 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> 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