pub struct CodeAgentBuilder<P: LlmProvider> { /* private fields */ }Expand description
Fluent builder assembling a code-generation AgentRunner (mirror of
BrowserAgentBuilder).
Implementations§
Source§impl<P: LlmProvider> CodeAgentBuilder<P>
impl<P: LlmProvider> CodeAgentBuilder<P>
Sourcepub fn new(provider: Arc<P>, workspace: impl Into<PathBuf>) -> Self
pub fn new(provider: Arc<P>, workspace: impl Into<PathBuf>) -> Self
Start a code harness rooted at workspace (file tools are jailed there).
Sourcepub fn verify_command(self, cmd: impl Into<String>) -> Self
pub fn verify_command(self, cmd: impl Into<String>) -> Self
Append one verification command (run in order, fail-fast).
Sourcepub fn verify_commands(
self,
cmds: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn verify_commands( self, cmds: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Set the verification command list (replaces any existing).
Sourcepub fn system_prompt(self, prompt: impl Into<String>) -> Self
pub fn system_prompt(self, prompt: impl Into<String>) -> Self
Override the loop-invariant system prompt.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Set the agent’s name (for events / observability).
Sourcepub fn max_identical_tool_calls(self, n: u32) -> Self
pub fn max_identical_tool_calls(self, n: u32) -> Self
Doom-loop cure: abort after n identical tool calls in a row.
Sourcepub fn guardrail(self, guard: Arc<dyn Guardrail>) -> Self
pub fn guardrail(self, guard: Arc<dyn Guardrail>) -> Self
Add an extra guardrail (first-Deny-wins, composed with any others).
Sourcepub fn tools_allow(
self,
names: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn tools_allow( self, names: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Restrict the curated builtins to this allowlist (the verify tool is
always kept). Empty = keep all curated tools.
Sourcepub fn goal(self, goal: GoalCondition) -> Self
pub fn goal(self, goal: GoalCondition) -> Self
Gate completion on a goal (typically code_goal).
Sourcepub fn dangerous_tools(self, enabled: bool) -> Self
pub fn dangerous_tools(self, enabled: bool) -> Self
Include/exclude the bash tool (default: included).
Sourcepub fn build(self) -> Result<AgentRunner<P>, Error>
pub fn build(self) -> Result<AgentRunner<P>, Error>
Assemble the AgentRunner.
Auto Trait Implementations§
impl<P> !RefUnwindSafe for CodeAgentBuilder<P>
impl<P> !UnwindSafe for CodeAgentBuilder<P>
impl<P> Freeze for CodeAgentBuilder<P>
impl<P> Send for CodeAgentBuilder<P>
impl<P> Sync for CodeAgentBuilder<P>
impl<P> Unpin for CodeAgentBuilder<P>
impl<P> UnsafeUnpin for CodeAgentBuilder<P>
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