pub struct SkillCallable { /* private fields */ }Expand description
Callable runtime object that invokes a single bound skill.
A SkillCallable pairs a SkillCard with the SkillTransport that
runs it. Calling it checks the requested capabilities, validates arguments
against the card’s input shape, dispatches through the transport (honoring
any cache/cassette policy when those features are enabled), and validates
the result against the output shape. It is registered as an ordinary
callable function value, so agents call a skill exactly like any other
function.
Implementations§
Source§impl SkillCallable
impl SkillCallable
Sourcepub fn new(card: SkillCard, transport: Arc<dyn SkillTransport>) -> Self
pub fn new(card: SkillCard, transport: Arc<dyn SkillTransport>) -> Self
Creates a callable for card that dispatches through transport.
Sourcepub fn call_values(
&self,
cx: &mut Cx,
args: Vec<Value>,
events: Option<&mut dyn SkillEventSink>,
) -> Result<Value>
pub fn call_values( &self, cx: &mut Cx, args: Vec<Value>, events: Option<&mut dyn SkillEventSink>, ) -> Result<Value>
Invokes the skill with already-evaluated args.
Requires the skill’s capabilities, checks the arguments against the
card’s input shape, dispatches through the transport (applying cache
and cassette policy when those features are enabled), and checks the
result against the output shape. The optional events sink receives
any streaming events the transport emits during the call.
Trait Implementations§
Source§impl Callable for SkillCallable
impl Callable for SkillCallable
Source§fn call(&self, cx: &mut Cx, args: Args) -> Result<Value>
fn call(&self, cx: &mut Cx, args: Args) -> Result<Value>
Args.Source§fn browse_args_shape(&self, _cx: &mut Cx) -> Result<Option<ShapeRef>>
fn browse_args_shape(&self, _cx: &mut Cx) -> Result<Option<ShapeRef>>
Source§impl Clone for SkillCallable
impl Clone for SkillCallable
Source§fn clone(&self) -> SkillCallable
fn clone(&self) -> SkillCallable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Object for SkillCallable
impl Object for SkillCallable
Source§fn display(&self, _cx: &mut Cx) -> Result<String>
fn display(&self, _cx: &mut Cx) -> Result<String>
Source§fn header(&self) -> &ObjectHeader
fn header(&self) -> &ObjectHeader
Source§fn op(&self, _key: &OpKey) -> Option<&dyn Op>
fn op(&self, _key: &OpKey) -> Option<&dyn Op>
key, if any.