pub struct Genome {
pub prompt: String,
pub traits: Vec<f64>,
pub trait_names: Vec<String>,
}Expand description
A genome representing agent strategy/behavior
Fields§
§prompt: StringSystem prompt/role (the “DNA”)
traits: Vec<f64>Strategy parameters (0.0 - 1.0 each)
trait_names: Vec<String>Labels for each trait
Implementations§
Source§impl Genome
impl Genome
Sourcepub fn with_traits(prompt: &str, traits: Vec<(String, f64)>) -> Self
pub fn with_traits(prompt: &str, traits: Vec<(String, f64)>) -> Self
Create genome with custom traits
Sourcepub fn to_llm_params(&self) -> LlmParams
pub fn to_llm_params(&self) -> LlmParams
Convert genome traits to LLM parameters Maps:
- exploration → temperature (0.0-1.0 → 0.1-1.5)
- precision → top_p (0.0-1.0 → 0.5-1.0, inverted for precision)
- creativity → presence_penalty (0.0-1.0 → 0.0-1.0)
- skepticism → frequency_penalty (0.0-1.0 → 0.0-0.5)
- verbosity → max_tokens scaling (0.0-1.0 → 0.5-2.0x multiplier)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Genome
impl<'de> Deserialize<'de> for Genome
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 Genome
impl RefUnwindSafe for Genome
impl Send for Genome
impl Sync for Genome
impl Unpin for Genome
impl UnwindSafe for Genome
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)