pub struct AgentTemplate {
pub name: String,
pub system_prompt: String,
pub tools: Vec<String>,
pub model: Option<String>,
pub temperature: Option<f32>,
pub max_tokens: Option<usize>,
pub stop_sequences: Vec<String>,
pub capabilities: Vec<String>,
pub config: HashMap<String, String>,
pub description: String,
}Expand description
Agent template definition
Fields§
§name: StringTemplate name
system_prompt: StringSystem prompt for the agent
tools: Vec<String>List of tool names to include
model: Option<String>Model to use (e.g., “gpt-4”, “claude-3”)
temperature: Option<f32>Temperature setting
max_tokens: Option<usize>Maximum tokens for response
stop_sequences: Vec<String>Stop sequences
capabilities: Vec<String>Agent capabilities/tags
config: HashMap<String, String>Additional configuration
description: StringDescription of the template
Implementations§
Source§impl AgentTemplate
impl AgentTemplate
pub fn new(name: impl Into<String>) -> Self
pub fn system_prompt(self, prompt: impl Into<String>) -> Self
pub fn tool(self, tool_name: impl Into<String>) -> Self
pub fn tools<I, S>(self, tools: I) -> Self
pub fn model(self, model: impl Into<String>) -> Self
pub fn temperature(self, temp: f32) -> Self
pub fn max_tokens(self, max: usize) -> Self
pub fn stop_sequence(self, seq: impl Into<String>) -> Self
pub fn capability(self, cap: impl Into<String>) -> Self
pub fn config(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Sourcepub fn extend(self, other: &AgentTemplate) -> Self
pub fn extend(self, other: &AgentTemplate) -> Self
Merge another template’s settings (for inheritance)
Trait Implementations§
Source§impl Clone for AgentTemplate
impl Clone for AgentTemplate
Source§fn clone(&self) -> AgentTemplate
fn clone(&self) -> AgentTemplate
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 AgentTemplate
impl Debug for AgentTemplate
Source§impl<'de> Deserialize<'de> for AgentTemplate
impl<'de> Deserialize<'de> for AgentTemplate
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 AgentTemplate
impl RefUnwindSafe for AgentTemplate
impl Send for AgentTemplate
impl Sync for AgentTemplate
impl Unpin for AgentTemplate
impl UnsafeUnpin for AgentTemplate
impl UnwindSafe for AgentTemplate
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> 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