pub struct Skill {
pub name: String,
pub description: String,
pub inputs: Vec<String>,
pub steps: Vec<SkillStep>,
}Expand description
A skill definition - a sequence of tool calls
Fields§
§name: StringSkill name
description: StringDescription of what the skill does
inputs: Vec<String>Input parameters for the skill
steps: Vec<SkillStep>Steps to execute
Implementations§
Source§impl Skill
impl Skill
Sourcepub async fn execute<T: Transport>(
&self,
transport: &T,
input_args: &HashMap<String, Value>,
) -> Result<SkillResult>
pub async fn execute<T: Transport>( &self, transport: &T, input_args: &HashMap<String, Value>, ) -> Result<SkillResult>
Execute the skill with the given transport and input arguments
Sourcepub async fn execute_with_config<T: Transport>(
&self,
transport: &T,
input_args: &HashMap<String, Value>,
config: &ExecutionConfig,
) -> Result<SkillResult>
pub async fn execute_with_config<T: Transport>( &self, transport: &T, input_args: &HashMap<String, Value>, config: &ExecutionConfig, ) -> Result<SkillResult>
Execute the skill with custom timeout and retry configuration.
This method wraps each step execution with timeout and retry logic
based on the provided configuration. Per-step overrides in SkillStep
take precedence over the global configuration.
§Arguments
transport- The transport to use for tool callsinput_args- Input arguments for the skillconfig- Execution configuration for timeouts and retries
§Examples
ⓘ
use thulp_skills::{Skill, ExecutionConfig, TimeoutConfig, RetryConfig};
use std::time::Duration;
let config = ExecutionConfig::new()
.with_timeout(TimeoutConfig::new().with_step_timeout(Duration::from_secs(30)))
.with_retry(RetryConfig::new().with_max_retries(2));
let result = skill.execute_with_config(&transport, &args, &config).await?;Trait Implementations§
Source§impl<'de> Deserialize<'de> for Skill
impl<'de> Deserialize<'de> for Skill
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Skill
impl RefUnwindSafe for Skill
impl Send for Skill
impl Sync for Skill
impl Unpin for Skill
impl UnsafeUnpin for Skill
impl UnwindSafe for Skill
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