Struct FunctionDeclaration
pub struct FunctionDeclaration {
pub name: String,
pub description: String,
pub parameters: Option<Value>,
pub behavior: Option<FunctionCallingBehavior>,
}Expand description
Schema for a single function that the model can call.
§Examples
use gemini_genai_rs::protocol::types::FunctionDeclaration;
use serde_json::json;
let decl = FunctionDeclaration {
name: "get_weather".to_string(),
description: "Get weather for a city".to_string(),
parameters: Some(json!({
"type": "object",
"properties": { "city": { "type": "string" } },
"required": ["city"]
})),
behavior: None,
};Fields§
§name: StringFunction name.
description: StringHuman-readable description for the model.
parameters: Option<Value>JSON Schema describing function parameters.
behavior: Option<FunctionCallingBehavior>Per-function calling behavior override.
When set to NonBlocking, the model continues generating while
this function executes asynchronously. The response can then include
a super::enums::FunctionResponseScheduling to control how results are delivered.
Trait Implementations§
§impl Clone for FunctionDeclaration
impl Clone for FunctionDeclaration
§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 more§impl Debug for FunctionDeclaration
impl Debug for FunctionDeclaration
§impl<'de> Deserialize<'de> for FunctionDeclaration
impl<'de> Deserialize<'de> for FunctionDeclaration
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FunctionDeclaration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FunctionDeclaration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl PartialEq for FunctionDeclaration
impl PartialEq for FunctionDeclaration
§impl Serialize for FunctionDeclaration
impl Serialize for FunctionDeclaration
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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