pub struct AgentConfig {
pub name: CompactString,
pub description: CompactString,
pub system_prompt: String,
pub model: Option<CompactString>,
pub max_iterations: usize,
pub tool_choice: ToolChoice,
}Expand description
Serializable agent configuration.
Contains all parameters for an agent: identity, system prompt, model, and iteration limits. All registered tools are available to every agent.
Fields§
§name: CompactStringAgent identifier.
description: CompactStringHuman-readable description.
system_prompt: StringSystem prompt sent before each LLM request.
model: Option<CompactString>Model to use from the registry. None = registry’s active/default.
max_iterations: usizeMaximum iterations before stopping.
tool_choice: ToolChoiceControls which tool the model calls.
Implementations§
Source§impl AgentConfig
impl AgentConfig
Sourcepub fn new(name: impl Into<CompactString>) -> Self
pub fn new(name: impl Into<CompactString>) -> Self
Create a new config with the given name and defaults for everything else.
Sourcepub fn system_prompt(self, prompt: impl Into<String>) -> Self
pub fn system_prompt(self, prompt: impl Into<String>) -> Self
Set the system prompt.
Sourcepub fn description(self, desc: impl Into<CompactString>) -> Self
pub fn description(self, desc: impl Into<CompactString>) -> Self
Set the description.
Sourcepub fn model(self, name: impl Into<CompactString>) -> Self
pub fn model(self, name: impl Into<CompactString>) -> Self
Set the model to use from the registry.
Trait Implementations§
Source§impl Clone for AgentConfig
impl Clone for AgentConfig
Source§fn clone(&self) -> AgentConfig
fn clone(&self) -> AgentConfig
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 AgentConfig
impl Debug for AgentConfig
Source§impl Default for AgentConfig
impl Default for AgentConfig
Source§impl<'de> Deserialize<'de> for AgentConfig
impl<'de> Deserialize<'de> for AgentConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentConfig
impl RefUnwindSafe for AgentConfig
impl Send for AgentConfig
impl Sync for AgentConfig
impl Unpin for AgentConfig
impl UnsafeUnpin for AgentConfig
impl UnwindSafe for AgentConfig
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