pub struct Agent {
pub provider: String,
pub model: String,
pub session_id: Option<String>,
pub segment_id: Option<String>,
pub policy_id: Option<String>,
pub thought_level: Option<String>,
pub parent: Option<String>,
}Expand description
AI agent identity that performed changes on behalf of a principal.
Fields§
§provider: StringProvider name (e.g., “anthropic”, “openai”).
model: StringModel identifier (e.g., “claude-opus-4-5-20250120”).
session_id: Option<String>Session identifier (opt-in, links to Session.id).
segment_id: Option<String>Segment identifier (opt-in, links to SessionSegment.id).
policy_id: Option<String>Policy or prompt template identifier.
thought_level: Option<String>Frozen harness thought_level (ACP name: Claude effort, Codex reasoning, OpenCode variant).
parent: Option<String>Frozen harness parent actor / agent_id (ACP name).
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn with_session(
self,
session_id: impl Into<String>,
segment_id: impl Into<String>,
) -> Agent
pub fn with_session( self, session_id: impl Into<String>, segment_id: impl Into<String>, ) -> Agent
Create with session linkage.
Sourcepub fn with_policy(self, policy_id: impl Into<String>) -> Agent
pub fn with_policy(self, policy_id: impl Into<String>) -> Agent
Create with policy ID.
Sourcepub fn with_thought_level(self, thought_level: impl Into<String>) -> Agent
pub fn with_thought_level(self, thought_level: impl Into<String>) -> Agent
Freeze a published thought_level onto this agent.
Sourcepub fn with_parent(self, parent: impl Into<String>) -> Agent
pub fn with_parent(self, parent: impl Into<String>) -> Agent
Freeze a published parent actor onto this agent.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Agent
impl<'de> Deserialize<'de> for Agent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Agent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Agent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Agent
Source§impl Serialize for Agent
impl Serialize for Agent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Agent
Auto Trait Implementations§
impl Freeze for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
impl UnwindSafe for Agent
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