pub struct OpenAiFunction {
pub strict: Option<bool>,
pub name: String,
pub description: Option<String>,
pub parameters: Option<OpenAiFunctionParameters>,
}Fields§
§strict: Option<bool>This is a boolean that controls whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the parameters field. Only a subset of JSON Schema is supported when strict is true. Learn more about Structured Outputs in the OpenAI guide. @default false
name: StringThis is the the name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
description: Option<String>This is the description of what the function does, used by the AI to choose when and how to call the function.
parameters: Option<OpenAiFunctionParameters>These are the parameters the functions accepts, described as a JSON Schema object. See the OpenAI guide for examples, and the JSON Schema reference for documentation about the format. Omitting parameters defines a function with an empty parameter list.
Implementations§
Source§impl OpenAiFunction
impl OpenAiFunction
pub fn new(name: String) -> OpenAiFunction
Trait Implementations§
Source§impl Clone for OpenAiFunction
impl Clone for OpenAiFunction
Source§fn clone(&self) -> OpenAiFunction
fn clone(&self) -> OpenAiFunction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OpenAiFunction
impl Debug for OpenAiFunction
Source§impl Default for OpenAiFunction
impl Default for OpenAiFunction
Source§fn default() -> OpenAiFunction
fn default() -> OpenAiFunction
Source§impl<'de> Deserialize<'de> for OpenAiFunction
impl<'de> Deserialize<'de> for OpenAiFunction
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>,
Source§impl OpenApi for OpenAiFunction
impl OpenApi for OpenAiFunction
Source§fn openapi() -> OpenApi
fn openapi() -> OpenApi
openapi::OpenApi instance which can be parsed with serde or served via
OpenAPI visualization tool such as Swagger UI.