pub struct AgentConfigBuilder { /* private fields */ }Expand description
Builder for AgentConfig.
Provides a fluent API for constructing AgentConfig instances without needing to specify all 12 fields.
§Example
use ralph_workflow::agents::AgentConfig;
let config = AgentConfig::builder()
.cmd("claude")
.output_flag("--output-format=stream-json")
.yolo_flag("--dangerously-skip-permissions")
.build();Implementations§
Source§impl AgentConfigBuilder
impl AgentConfigBuilder
Sourcepub fn output_flag(self, flag: impl Into<String>) -> Self
pub fn output_flag(self, flag: impl Into<String>) -> Self
Set the output-format flag.
Sourcepub fn verbose_flag(self, flag: impl Into<String>) -> Self
pub fn verbose_flag(self, flag: impl Into<String>) -> Self
Set the verbose output flag.
Sourcepub fn can_commit(self, can_commit: bool) -> Self
pub fn can_commit(self, can_commit: bool) -> Self
Set whether the agent can run git commit.
Sourcepub fn json_parser(self, parser: JsonParserType) -> Self
pub fn json_parser(self, parser: JsonParserType) -> Self
Set the JSON parser type.
Sourcepub fn model_flag(self, flag: impl Into<String>) -> Self
pub fn model_flag(self, flag: impl Into<String>) -> Self
Set the model/provider flag.
Sourcepub fn print_flag(self, flag: impl Into<String>) -> Self
pub fn print_flag(self, flag: impl Into<String>) -> Self
Set the print/non-interactive mode flag.
Sourcepub fn streaming_flag(self, flag: impl Into<String>) -> Self
pub fn streaming_flag(self, flag: impl Into<String>) -> Self
Set the streaming flag.
Sourcepub fn session_flag(self, flag: impl Into<String>) -> Self
pub fn session_flag(self, flag: impl Into<String>) -> Self
Set the session continuation flag template.
Sourcepub fn display_name(self, name: impl Into<String>) -> Self
pub fn display_name(self, name: impl Into<String>) -> Self
Set the display name.
Sourcepub fn build(self) -> AgentConfig
pub fn build(self) -> AgentConfig
Build the AgentConfig.
Uses defaults for any unset fields.
Trait Implementations§
Source§impl Clone for AgentConfigBuilder
impl Clone for AgentConfigBuilder
Source§fn clone(&self) -> AgentConfigBuilder
fn clone(&self) -> AgentConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 · 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 AgentConfigBuilder
impl Debug for AgentConfigBuilder
Source§impl Default for AgentConfigBuilder
impl Default for AgentConfigBuilder
Source§fn default() -> AgentConfigBuilder
fn default() -> AgentConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AgentConfigBuilder
impl RefUnwindSafe for AgentConfigBuilder
impl Send for AgentConfigBuilder
impl Sync for AgentConfigBuilder
impl Unpin for AgentConfigBuilder
impl UnwindSafe for AgentConfigBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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