pub struct FunctionTool {
pub name: String,
pub description: Option<String>,
pub parameters: Option<HashMap<String, Value>>,
pub strict: Option<bool>,
}
Expand description
Defines a function in your own code the model can choose to call. Learn more about function calling.
Fields§
§name: String
The name of the function to call.
description: Option<String>
A description of the function. Used by the model to determine whether or not to call the function.
parameters: Option<HashMap<String, Value>>
A JSON schema object describing the parameters of the function.
strict: Option<bool>
Whether to enforce strict parameter validation. Default true
.
Implementations§
Source§impl FunctionTool
impl FunctionTool
Sourcepub fn builder() -> FunctionToolBuilder<((), (), (), ())>
pub fn builder() -> FunctionToolBuilder<((), (), (), ())>
Create a builder for building FunctionTool
.
On the builder, call .name(...)
, .description(...)
(optional), .parameters(...)
(optional), .strict(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of FunctionTool
.
Trait Implementations§
Source§impl Clone for FunctionTool
impl Clone for FunctionTool
Source§fn clone(&self) -> FunctionTool
fn clone(&self) -> FunctionTool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FunctionTool
impl Debug for FunctionTool
Source§impl<'de> Deserialize<'de> for FunctionTool
impl<'de> Deserialize<'de> for FunctionTool
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
Source§impl PartialEq for FunctionTool
impl PartialEq for FunctionTool
Source§impl Serialize for FunctionTool
impl Serialize for FunctionTool
impl StructuralPartialEq for FunctionTool
Auto Trait Implementations§
impl Freeze for FunctionTool
impl RefUnwindSafe for FunctionTool
impl Send for FunctionTool
impl Sync for FunctionTool
impl Unpin for FunctionTool
impl UnwindSafe for FunctionTool
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