pub struct SelfModel {
pub self_context: Vec<Message>,
pub user_context: Vec<Message>,
pub collective_context: Vec<Message>,
}Expand description
The agent’s model of itself and its context.
Users populate these — the library provides the structure. The cognitive graph reads from all three during processing.
§Example
use pe_core::self_model::SelfModel;
use pe_core::Message;
let model = SelfModel::new()
.with_self_context(vec![Message::system("I am a code review agent.")]);
assert_eq!(model.self_context.len(), 1);Fields§
§self_context: Vec<Message>Self-awareness: what am I? capabilities, limits, strengths, weaknesses.
user_context: Vec<Message>User model: who am I talking to? expertise, preferences, history.
collective_context: Vec<Message>Collective context: team goal, shared knowledge, other agents’ findings.
Implementations§
Source§impl SelfModel
impl SelfModel
Sourcepub fn with_self_context(self, messages: Vec<Message>) -> Self
pub fn with_self_context(self, messages: Vec<Message>) -> Self
Set self-awareness context.
Sourcepub fn with_user_context(self, messages: Vec<Message>) -> Self
pub fn with_user_context(self, messages: Vec<Message>) -> Self
Set user model context.
Sourcepub fn with_collective_context(self, messages: Vec<Message>) -> Self
pub fn with_collective_context(self, messages: Vec<Message>) -> Self
Set collective context.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SelfModel
impl<'de> Deserialize<'de> for SelfModel
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 SelfModel
impl RefUnwindSafe for SelfModel
impl Send for SelfModel
impl Sync for SelfModel
impl Unpin for SelfModel
impl UnsafeUnpin for SelfModel
impl UnwindSafe for SelfModel
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