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: String
This 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§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more