pub struct LocalBackend { /* private fields */ }Expand description
Local backend that executes tools in the current process
This backend uses the steer-tools implementations directly.
Implementations§
Source§impl LocalBackend
impl LocalBackend
Sourcepub fn from_tools(tools: Vec<Box<dyn ExecutableTool>>) -> Self
pub fn from_tools(tools: Vec<Box<dyn ExecutableTool>>) -> Self
Create a backend from a collection of tool instances
Sourcepub fn with_tools(
tool_names: Vec<String>,
llm_config_provider: Arc<LlmConfigProvider>,
workspace: Arc<dyn Workspace>,
) -> Self
pub fn with_tools( tool_names: Vec<String>, llm_config_provider: Arc<LlmConfigProvider>, workspace: Arc<dyn Workspace>, ) -> Self
Create a backend with only specific tools enabled by name
This method takes a list of tool names and creates a backend containing only those tools from the full set of available tools.
Sourcepub fn without_tools(
excluded_tools: Vec<String>,
llm_config_provider: Arc<LlmConfigProvider>,
workspace: Arc<dyn Workspace>,
) -> Self
pub fn without_tools( excluded_tools: Vec<String>, llm_config_provider: Arc<LlmConfigProvider>, workspace: Arc<dyn Workspace>, ) -> Self
Create a backend excluding specific tools by name
This method takes a list of tool names to exclude and creates a backend containing all other tools from the full set of available tools.
Sourcepub fn full(
llm_config_provider: Arc<LlmConfigProvider>,
workspace: Arc<dyn Workspace>,
) -> Self
pub fn full( llm_config_provider: Arc<LlmConfigProvider>, workspace: Arc<dyn Workspace>, ) -> Self
Create a new LocalBackend with all tools (workspace + server tools)
Sourcepub fn server_only(
llm_config_provider: Arc<LlmConfigProvider>,
workspace: Arc<dyn Workspace>,
) -> Self
pub fn server_only( llm_config_provider: Arc<LlmConfigProvider>, workspace: Arc<dyn Workspace>, ) -> Self
Create a LocalBackend with only server-side tools
Sourcepub fn read_only(llm_config_provider: Arc<LlmConfigProvider>) -> Self
pub fn read_only(llm_config_provider: Arc<LlmConfigProvider>) -> Self
Create a LocalBackend with read-only tools
This creates a backend with only read-only tools, useful for sandboxed or restricted execution environments.
Trait Implementations§
Source§impl Default for LocalBackend
impl Default for LocalBackend
Source§impl ToolBackend for LocalBackend
impl ToolBackend for LocalBackend
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool_call: &'life1 ToolCall,
context: &'life2 ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool_call: &'life1 ToolCall,
context: &'life2 ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn supported_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn supported_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_tool_schemas<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ToolSchema>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_tool_schemas<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ToolSchema>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn metadata(&self) -> BackendMetadata
fn metadata(&self) -> BackendMetadata
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn requires_approval<'life0, 'life1, 'async_trait>(
&'life0 self,
_tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn requires_approval<'life0, 'life1, 'async_trait>(
&'life0 self,
_tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for LocalBackend
impl !RefUnwindSafe for LocalBackend
impl Send for LocalBackend
impl Sync for LocalBackend
impl Unpin for LocalBackend
impl !UnwindSafe for LocalBackend
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request