pub struct Personality {
pub personality: PersonalityCore,
pub tools: ToolConfig,
pub prompt: PromptConfig,
pub naming: NamingConfig,
}Expand description
A named agent personality preset.
Personalities define everything needed to spawn an agent: model, tool
restrictions, prompt, and naming conventions. They are resolved from
user-defined TOML files (~/.room/personalities/<name>.toml) first,
then built-in defaults compiled into the binary.
Fields§
§personality: PersonalityCore§tools: ToolConfig§prompt: PromptConfig§naming: NamingConfigImplementations§
Source§impl Personality
impl Personality
Sourcepub fn validate(&self) -> Result<(), PersonalityError>
pub fn validate(&self) -> Result<(), PersonalityError>
Validate that all fields have sensible values.
Returns Ok(()) if valid, or Err(PersonalityError::Validation) with
a list of human-readable error messages.
Sourcepub fn generate_username(&self, used_names: &[String]) -> String
pub fn generate_username(&self, used_names: &[String]) -> String
Generate a username for this personality.
If a name pool is configured and used_names doesn’t exhaust it,
picks an unused name from the pool. Otherwise falls back to
<personality>-<short-uuid>.
Trait Implementations§
Source§impl Clone for Personality
impl Clone for Personality
Source§fn clone(&self) -> Personality
fn clone(&self) -> Personality
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 Personality
impl Debug for Personality
Source§impl<'de> Deserialize<'de> for Personality
impl<'de> Deserialize<'de> for Personality
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 Personality
impl RefUnwindSafe for Personality
impl Send for Personality
impl Sync for Personality
impl Unpin for Personality
impl UnsafeUnpin for Personality
impl UnwindSafe for Personality
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