pub struct LuaToolAdapter {
definition: ToolDefinition,
config: Arc<Config>,
}Expand description
Adapter that wraps a Lua ToolDefinition as a Tool trait object.
This allows Lua tools to participate in the unified tool dispatch alongside built-in and custom Rust tools.
Fields§
§definition: ToolDefinitionThe underlying Lua tool definition.
config: Arc<Config>Application config needed for the Lua context bridge.
Implementations§
Source§impl LuaToolAdapter
impl LuaToolAdapter
Sourcepub fn new(definition: ToolDefinition, config: Arc<Config>) -> Self
pub fn new(definition: ToolDefinition, config: Arc<Config>) -> Self
Create a new adapter wrapping a Lua tool definition.
Trait Implementations§
Source§impl Tool for LuaToolAdapter
impl Tool for LuaToolAdapter
Source§fn description(&self) -> &str
fn description(&self) -> &str
Returns a one-line description for agent discovery. Read more
Source§fn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
Returns the OpenAI function-calling JSON Schema for parameters. Read more
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Value,
_ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Value,
_ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool with validated parameters. Read more
Source§fn is_builtin(&self) -> bool
fn is_builtin(&self) -> bool
Whether this tool is a built-in (true for search/get/sources). Read more
Auto Trait Implementations§
impl Freeze for LuaToolAdapter
impl RefUnwindSafe for LuaToolAdapter
impl Send for LuaToolAdapter
impl Sync for LuaToolAdapter
impl Unpin for LuaToolAdapter
impl UnwindSafe for LuaToolAdapter
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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 more