pub struct AgentCallbackContext {
pub execution_id: ExecutionId,
pub step_id: Option<StepId>,
pub agent_name: String,
pub agent_description: Option<String>,
pub input_preview: Option<String>,
pub tenant_id: Option<String>,
pub user_id: Option<String>,
pub trace_id: Option<String>,
pub parent_span_id: Option<String>,
}Expand description
Context passed to agent callbacks
Contains all information needed to identify and trace an agent execution.
Fields§
§execution_id: ExecutionIdExecution ID for this agent run
step_id: Option<StepId>Step ID (if running within a graph)
agent_name: StringAgent name
agent_description: Option<String>Agent description (if available)
input_preview: Option<String>Input provided to the agent (may be truncated for large inputs)
tenant_id: Option<String>Tenant ID (if multi-tenant)
user_id: Option<String>User ID (if authenticated)
trace_id: Option<String>Trace ID for distributed tracing
parent_span_id: Option<String>Parent span ID
Implementations§
Source§impl AgentCallbackContext
impl AgentCallbackContext
Sourcepub fn new(execution_id: ExecutionId, agent_name: impl Into<String>) -> Self
pub fn new(execution_id: ExecutionId, agent_name: impl Into<String>) -> Self
Create a new agent callback context
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Add agent description
Sourcepub fn with_input_preview(self, input: impl Into<String>) -> Self
pub fn with_input_preview(self, input: impl Into<String>) -> Self
Add input preview (truncated if needed)
Sourcepub fn with_tenant(self, tenant_id: impl Into<String>) -> Self
pub fn with_tenant(self, tenant_id: impl Into<String>) -> Self
Add tenant context
Trait Implementations§
Source§impl Clone for AgentCallbackContext
impl Clone for AgentCallbackContext
Source§fn clone(&self) -> AgentCallbackContext
fn clone(&self) -> AgentCallbackContext
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 AgentCallbackContext
impl Debug for AgentCallbackContext
Source§impl<'de> Deserialize<'de> for AgentCallbackContext
impl<'de> Deserialize<'de> for AgentCallbackContext
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 AgentCallbackContext
impl RefUnwindSafe for AgentCallbackContext
impl Send for AgentCallbackContext
impl Sync for AgentCallbackContext
impl Unpin for AgentCallbackContext
impl UnsafeUnpin for AgentCallbackContext
impl UnwindSafe for AgentCallbackContext
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