pub struct AgentValue {
pub name: String,
pub system_prompt: String,
pub user_prompt: Option<String>,
pub tools: Vec<String>,
pub max_steps: Option<u32>,
pub model: Option<String>,
pub output_schema: Option<OutputSchema>,
pub output_retries: u32,
pub output_instructions: Option<String>,
pub retry_prompt: Option<String>,
}Expand description
Represents a defined agent at runtime
Fields§
§name: StringName of the agent
system_prompt: StringSystem prompt for the agent
user_prompt: Option<String>User prompt for the agent (optional)
tools: Vec<String>Tools available to this agent
max_steps: Option<u32>Maximum steps before stopping (None = default 10)
model: Option<String>Model to use (None = default)
output_schema: Option<OutputSchema>Output schema for structured responses
output_retries: u32Number of retries for output validation
output_instructions: Option<String>Custom instructions for schema output (None = default)
retry_prompt: Option<String>Custom prompt for validation retries (None = default)
Implementations§
Source§impl AgentValue
impl AgentValue
Sourcepub fn new(name: impl Into<String>, system_prompt: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, system_prompt: impl Into<String>) -> Self
Create a new agent value
Sourcepub fn with_tools(self, tools: Vec<String>) -> Self
pub fn with_tools(self, tools: Vec<String>) -> Self
Add tools to the agent
Sourcepub fn with_max_steps(self, steps: u32) -> Self
pub fn with_max_steps(self, steps: u32) -> Self
Set max steps
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set model
Sourcepub fn with_output_schema(self, schema: OutputSchema) -> Self
pub fn with_output_schema(self, schema: OutputSchema) -> Self
Set output schema
Sourcepub fn with_output_retries(self, retries: u32) -> Self
pub fn with_output_retries(self, retries: u32) -> Self
Set output retries
Sourcepub fn with_output_instructions(self, instructions: impl Into<String>) -> Self
pub fn with_output_instructions(self, instructions: impl Into<String>) -> Self
Set custom output instructions
Sourcepub fn with_retry_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_retry_prompt(self, prompt: impl Into<String>) -> Self
Set custom retry prompt
Sourcepub fn with_user_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_user_prompt(self, prompt: impl Into<String>) -> Self
Set user prompt
Trait Implementations§
Source§impl Clone for AgentValue
impl Clone for AgentValue
Source§fn clone(&self) -> AgentValue
fn clone(&self) -> AgentValue
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 AgentValue
impl Debug for AgentValue
Source§impl Display for AgentValue
impl Display for AgentValue
Source§impl PartialEq for AgentValue
impl PartialEq for AgentValue
impl StructuralPartialEq for AgentValue
Auto Trait Implementations§
impl Freeze for AgentValue
impl RefUnwindSafe for AgentValue
impl Send for AgentValue
impl Sync for AgentValue
impl Unpin for AgentValue
impl UnwindSafe for AgentValue
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.