pub struct Toolkit {
pub tools: Vec<ToolDef>,
/* private fields */
}Expand description
A collection of tool definitions.
Fields§
§tools: Vec<ToolDef>Implementations§
Source§impl Toolkit
impl Toolkit
Sourcepub fn from_dir(dir: &Path) -> Result<Self, String>
pub fn from_dir(dir: &Path) -> Result<Self, String>
Load all .md files from a directory as tool definitions.
Sourcepub fn tool_names(&self) -> Vec<String>
pub fn tool_names(&self) -> Vec<String>
Get all tool names.
Sourcepub fn to_openai_json(&self) -> Vec<Value>
pub fn to_openai_json(&self) -> Vec<Value>
Convert all tools to OpenAI-compatible JSON array.
Sourcepub fn to_prompt_listing(&self) -> String
pub fn to_prompt_listing(&self) -> String
Generate a human-readable tool listing for embedding in prompts.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Toolkit
impl RefUnwindSafe for Toolkit
impl Send for Toolkit
impl Sync for Toolkit
impl Unpin for Toolkit
impl UnsafeUnpin for Toolkit
impl UnwindSafe for Toolkit
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