pub struct AgentExecutor;Expand description
Executes agent steps by delegating to the ricecoder-agents API
Implementations§
Source§impl AgentExecutor
impl AgentExecutor
Sourcepub fn execute_agent_step(
workflow: &Workflow,
state: &mut WorkflowState,
step_id: &str,
agent_step: &AgentStep,
) -> WorkflowResult<()>
pub fn execute_agent_step( workflow: &Workflow, state: &mut WorkflowState, step_id: &str, agent_step: &AgentStep, ) -> WorkflowResult<()>
Execute an agent step
Delegates to the ricecoder-agents API to execute the agent with the given configuration. Captures the agent output and any errors that occur during execution.
§Arguments
workflow- The workflow containing the stepstate- The current workflow statestep_id- The ID of the agent step to executeagent_step- The agent step configuration
§Returns
Returns Ok(()) if the step executed successfully, or an error if execution failed.
Sourcepub fn execute_agent_step_with_timeout(
workflow: &Workflow,
state: &mut WorkflowState,
step_id: &str,
agent_step: &AgentStep,
timeout_ms: u64,
) -> WorkflowResult<()>
pub fn execute_agent_step_with_timeout( workflow: &Workflow, state: &mut WorkflowState, step_id: &str, agent_step: &AgentStep, timeout_ms: u64, ) -> WorkflowResult<()>
Execute an agent step with timeout
Executes an agent step with a specified timeout. If the agent takes longer than the timeout, the execution is cancelled and an error is returned.
§Arguments
workflow- The workflow containing the stepstate- The current workflow statestep_id- The ID of the agent step to executeagent_step- The agent step configurationtimeout_ms- The timeout in milliseconds
§Returns
Returns Ok(()) if the step executed successfully within the timeout,
or an error if execution failed or timed out.
Sourcepub fn get_agent_id(agent_step: &AgentStep) -> &str
pub fn get_agent_id(agent_step: &AgentStep) -> &str
Get the agent ID from an agent step
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