pub struct BuiltInCodeExecutor;Expand description
Server-side code executor (Gemini 2.0+). Does not run code locally.
Adds {codeExecution: {}} to the LLM request tools.
Implementations§
Source§impl BuiltInCodeExecutor
impl BuiltInCodeExecutor
Sourcepub fn process_llm_request(
&self,
request: &mut LlmRequest,
model: &str,
) -> Result<(), CodeExecutorError>
pub fn process_llm_request( &self, request: &mut LlmRequest, model: &str, ) -> Result<(), CodeExecutorError>
Add code execution capability to the LLM request. Returns error if model is not Gemini 2.0+.
Trait Implementations§
Source§impl CodeExecutor for BuiltInCodeExecutor
impl CodeExecutor for BuiltInCodeExecutor
Source§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,
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.
Source§fn code_block_delimiters(&self) -> Vec<(String, String)>
fn code_block_delimiters(&self) -> Vec<(String, String)>
Delimiters for identifying code blocks in model output.
Source§fn execution_result_delimiters(&self) -> (String, String)
fn execution_result_delimiters(&self) -> (String, String)
Delimiters for wrapping execution results.
Source§fn error_retry_attempts(&self) -> u32
fn error_retry_attempts(&self) -> u32
Number of retry attempts on error.
Auto Trait Implementations§
impl Freeze for BuiltInCodeExecutor
impl RefUnwindSafe for BuiltInCodeExecutor
impl Send for BuiltInCodeExecutor
impl Sync for BuiltInCodeExecutor
impl Unpin for BuiltInCodeExecutor
impl UnsafeUnpin for BuiltInCodeExecutor
impl UnwindSafe for BuiltInCodeExecutor
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