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 new() -> LocalBackend
pub fn new() -> LocalBackend
Create a new empty LocalBackend
Sourcepub fn from_tools(tools: Vec<Box<dyn ExecutableTool>>) -> LocalBackend
pub fn from_tools(tools: Vec<Box<dyn ExecutableTool>>) -> LocalBackend
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>,
) -> LocalBackend
pub fn with_tools( tool_names: Vec<String>, llm_config_provider: Arc<LlmConfigProvider>, workspace: Arc<dyn Workspace>, ) -> LocalBackend
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>,
) -> LocalBackend
pub fn without_tools( excluded_tools: Vec<String>, llm_config_provider: Arc<LlmConfigProvider>, workspace: Arc<dyn Workspace>, ) -> LocalBackend
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>,
) -> LocalBackend
pub fn full( llm_config_provider: Arc<LlmConfigProvider>, workspace: Arc<dyn Workspace>, ) -> LocalBackend
Create a new LocalBackend with all tools (workspace + server tools)
Sourcepub fn server_only(
llm_config_provider: Arc<LlmConfigProvider>,
workspace: Arc<dyn Workspace>,
) -> LocalBackend
pub fn server_only( llm_config_provider: Arc<LlmConfigProvider>, workspace: Arc<dyn Workspace>, ) -> LocalBackend
Create a LocalBackend with only server-side tools
Sourcepub fn read_only(llm_config_provider: Arc<LlmConfigProvider>) -> LocalBackend
pub fn read_only(llm_config_provider: Arc<LlmConfigProvider>) -> LocalBackend
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§fn default() -> LocalBackend
fn default() -> 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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
LocalBackend: '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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
LocalBackend: 'async_trait,
Source§fn supported_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
LocalBackend: 'async_trait,
fn supported_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
LocalBackend: 'async_trait,
Source§fn get_tool_schemas<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ToolSchema>> + Send + 'async_trait>>where
'life0: 'async_trait,
LocalBackend: 'async_trait,
fn get_tool_schemas<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ToolSchema>> + Send + 'async_trait>>where
'life0: 'async_trait,
LocalBackend: '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
'life0: 'async_trait,
Self: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for LocalBackend
impl !UnwindSafe for LocalBackend
impl Freeze for LocalBackend
impl Send for LocalBackend
impl Sync for LocalBackend
impl Unpin for LocalBackend
impl UnsafeUnpin 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
impl<T> ErasedDestructor for Twhere
T: 'static,
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