#[non_exhaustive]pub struct ToolDef {
pub name: String,
pub description: String,
pub json_schema: Value,
}Expand description
Tool catalogue entry shown to the LLM.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringTool name (must be unique within the catalogue).
description: StringHuman-readable description for the LLM.
json_schema: ValueJSON-schema for arguments.
Implementations§
Source§impl ToolDef
impl ToolDef
Sourcepub fn new(
name: impl Into<String>,
description: impl Into<String>,
json_schema: Value,
) -> Self
pub fn new( name: impl Into<String>, description: impl Into<String>, json_schema: Value, ) -> Self
One entry in the tool catalogue offered to the model.
Prefer this constructor over struct literals in code outside
klieo-core — #[non_exhaustive] forbids external struct-literal
construction so that future field additions remain additive.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolDef
impl<'de> Deserialize<'de> for ToolDef
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 ToolDef
impl RefUnwindSafe for ToolDef
impl Send for ToolDef
impl Sync for ToolDef
impl Unpin for ToolDef
impl UnsafeUnpin for ToolDef
impl UnwindSafe for ToolDef
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