pub struct LuaAgentAdapter {
definition: AgentDefinition,
config: Arc<Config>,
}Expand description
Adapter that wraps a Lua AgentDefinition as an Agent trait object.
This allows Lua agents to participate in the unified agent dispatch alongside TOML and custom Rust agents.
Fields§
§definition: AgentDefinitionThe underlying Lua agent definition.
config: Arc<Config>Application config needed for the context bridge.
Implementations§
Source§impl LuaAgentAdapter
impl LuaAgentAdapter
Sourcepub fn new(definition: AgentDefinition, config: Arc<Config>) -> Self
pub fn new(definition: AgentDefinition, config: Arc<Config>) -> Self
Create a new adapter wrapping a Lua agent definition.
Trait Implementations§
Source§impl Agent for LuaAgentAdapter
impl Agent for LuaAgentAdapter
Source§fn description(&self) -> &str
fn description(&self) -> &str
Returns a one-line description for agent discovery.
Source§fn arguments(&self) -> Vec<AgentArgument>
fn arguments(&self) -> Vec<AgentArgument>
Returns the arguments this agent accepts (may be empty). Read more
Source§fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
_ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<AgentPrompt>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
_ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<AgentPrompt>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve the agent’s prompt, optionally using the
ToolContext
for dynamic context injection (e.g., pre-searching the KB). Read moreAuto Trait Implementations§
impl Freeze for LuaAgentAdapter
impl RefUnwindSafe for LuaAgentAdapter
impl Send for LuaAgentAdapter
impl Sync for LuaAgentAdapter
impl Unpin for LuaAgentAdapter
impl UnwindSafe for LuaAgentAdapter
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