pub trait CodeExecutor: Send + Sync {
// Required method
fn execute_code<'life0, 'async_trait>(
&'life0 self,
input: CodeExecutionInput,
) -> Pin<Box<dyn Future<Output = Result<CodeExecutionResult, CodeExecutorError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn code_block_delimiters(&self) -> Vec<(String, String)> { ... }
fn execution_result_delimiters(&self) -> (String, String) { ... }
fn error_retry_attempts(&self) -> u32 { ... }
fn stateful(&self) -> bool { ... }
}Expand description
Trait for sandboxed code execution in agent pipelines.
Required Methods§
Sourcefn execute_code<'life0, 'async_trait>(
&'life0 self,
input: CodeExecutionInput,
) -> Pin<Box<dyn Future<Output = Result<CodeExecutionResult, CodeExecutorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_code<'life0, 'async_trait>(
&'life0 self,
input: CodeExecutionInput,
) -> Pin<Box<dyn Future<Output = Result<CodeExecutionResult, CodeExecutorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute code and return the result.
Provided Methods§
Sourcefn code_block_delimiters(&self) -> Vec<(String, String)>
fn code_block_delimiters(&self) -> Vec<(String, String)>
Delimiters for identifying code blocks in model output.
Sourcefn execution_result_delimiters(&self) -> (String, String)
fn execution_result_delimiters(&self) -> (String, String)
Delimiters for wrapping execution results.
Sourcefn error_retry_attempts(&self) -> u32
fn error_retry_attempts(&self) -> u32
Number of retry attempts on error.