Crate openai_func_enums
source ·Macros§
- A procedural macro to generate JSON information about an enum, including its name, variant names, and descriptions, along with a total token count.
- A macro to parse a function call into a specified type. If the parsing fails, it prints an error message and returns
None
.
Structs§
- An archived
FuncEmbedding
- The resolver for an archived
FuncEmbedding
Enums§
Traits§
- A trait to provide a descriptor for an enumeration. This includes the name of the enum and the count of tokens in its name.
- A trait to provide descriptors for the variants of an enumeration. This includes the names of the variants and the count of tokens in their names.
Functions§
- A function to get the chat completion arguments for a function.
- Asynchronously retrieves and ranks function names based on their similarity to a given prompt embedding.
- A function to get the chat completion arguments for a tool.
- This function will get called if an “allowed_functions” argument is passed to the run function. If it is passed, then the presense or absence of the function_filtering feature flag will dictate what happens. If function_filtering is on, then the required functions (if some) will get included, then your ranked functions will get added until the token limit is reached. Without function_filtering feature enabled, all functions listed in allowed_func_names and required_func_names will get sent. Performs selective inclusion of tools based on the provided
allowed_func_names
and the state of thefunction_filtering
feature flag. Whenfunction_filtering
is enabled andrequired_func_names
is specified, required functions are prioritized, followed by ranked functions until a token limit is reached. Without thefunction_filtering
feature, all functions inallowed_func_names
andrequired_func_names
are included, irrespective of the token limit. - Asynchronously generates a single embedding vector for the given text using a specified model.
Attribute Macros§
- The
arg_description
attribute is a procedural macro used to provide additional description for an enum. - This procedural macro attribute is used to specify a description for an enum variant.
Derive Macros§
- A derive procedural macro for the
EnumDescriptor
trait. - The
ToolSet
procedural macro is used to derive a structure which encapsulates various chat completion commands. - A derive procedural macro for the
VariantDescriptors
trait.