pub struct FunctionDeclaration {
pub name: String,
pub description: String,
pub behavior: Option<Behavior>,
/* private fields */
}
Expand description
Declaration of a function that can be called by the model
Fields§
§name: String
The name of the function
description: String
The description of the function
behavior: Option<Behavior>
Optional
Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.
Implementations§
Source§impl FunctionDeclaration
impl FunctionDeclaration
Sourcepub fn new(
name: impl Into<String>,
description: impl Into<String>,
behavior: Option<Behavior>,
) -> Self
pub fn new( name: impl Into<String>, description: impl Into<String>, behavior: Option<Behavior>, ) -> Self
Create a new function declaration
Sourcepub fn with_parameters<Parameters>(self) -> Selfwhere
Parameters: JsonSchema + Serialize,
pub fn with_parameters<Parameters>(self) -> Selfwhere
Parameters: JsonSchema + Serialize,
Set the parameters for the function using a struct that implements JsonSchema
Sourcepub fn with_response<Response>(self) -> Selfwhere
Response: JsonSchema + Serialize,
pub fn with_response<Response>(self) -> Selfwhere
Response: JsonSchema + Serialize,
Set the response schema for the function using a struct that implements JsonSchema
Trait Implementations§
Source§impl Clone for FunctionDeclaration
impl Clone for FunctionDeclaration
Source§fn clone(&self) -> FunctionDeclaration
fn clone(&self) -> FunctionDeclaration
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 FunctionDeclaration
impl Debug for FunctionDeclaration
Source§impl Default for FunctionDeclaration
impl Default for FunctionDeclaration
Source§fn default() -> FunctionDeclaration
fn default() -> FunctionDeclaration
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FunctionDeclaration
impl<'de> Deserialize<'de> for FunctionDeclaration
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 FunctionDeclaration
impl PartialEq for FunctionDeclaration
Source§impl Serialize for FunctionDeclaration
impl Serialize for FunctionDeclaration
impl StructuralPartialEq for FunctionDeclaration
Auto Trait Implementations§
impl Freeze for FunctionDeclaration
impl RefUnwindSafe for FunctionDeclaration
impl Send for FunctionDeclaration
impl Sync for FunctionDeclaration
impl Unpin for FunctionDeclaration
impl UnwindSafe for FunctionDeclaration
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