pub struct AgentExecutor { /* private fields */ }Expand description
Agent execution context with permission checking
Implementations§
Source§impl AgentExecutor
impl AgentExecutor
Sourcepub fn new(
config: Arc<PermissionConfig>,
audit_logger: Arc<AuditLogger>,
) -> Self
pub fn new( config: Arc<PermissionConfig>, audit_logger: Arc<AuditLogger>, ) -> Self
Create a new agent executor
Sourcepub fn with_agent(
config: Arc<PermissionConfig>,
audit_logger: Arc<AuditLogger>,
agent_name: String,
) -> Self
pub fn with_agent( config: Arc<PermissionConfig>, audit_logger: Arc<AuditLogger>, agent_name: String, ) -> Self
Create a new agent executor with a specific agent name
Sourcepub fn execute_with_permission<F, T>(
&self,
tool_name: &str,
tool_description: Option<&str>,
action_description: Option<&str>,
execute_fn: F,
) -> Result<(AgentExecutionResult, Option<T>)>
pub fn execute_with_permission<F, T>( &self, tool_name: &str, tool_description: Option<&str>, action_description: Option<&str>, execute_fn: F, ) -> Result<(AgentExecutionResult, Option<T>)>
Check permission and execute tool with permission handling
§Arguments
tool_name- Name of the tool to executetool_description- Optional description of the toolaction_description- Optional description of what the tool will doexecute_fn- Closure that executes the tool
§Returns
Result containing the execution result and tool output
Sourcepub fn check_permission(&self, tool_name: &str) -> Result<PermissionDecision>
pub fn check_permission(&self, tool_name: &str) -> Result<PermissionDecision>
Check permission for a tool without executing it
Sourcepub fn agent_name(&self) -> Option<&str>
pub fn agent_name(&self) -> Option<&str>
Get the agent name
Sourcepub fn audit_logger(&self) -> Arc<AuditLogger>
pub fn audit_logger(&self) -> Arc<AuditLogger>
Get the audit logger
Auto Trait Implementations§
impl Freeze for AgentExecutor
impl RefUnwindSafe for AgentExecutor
impl Send for AgentExecutor
impl Sync for AgentExecutor
impl Unpin for AgentExecutor
impl UnwindSafe for AgentExecutor
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