Crate openai_func_enums

Source

Macros§

generate_enum_info
A procedural macro to generate JSON information about an enum, including its name, variant names, and descriptions, along with a total token count.
generate_value_arg_info
parse_function_call
A macro to parse a function call into a specified type. If the parsing fails, it prints an error message and returns None.

Structs§

ArchivedFuncEmbedding
An archived FuncEmbedding
CommandError
FuncEmbedding
FuncEmbeddingResolver
The resolver for an archived FuncEmbedding
Logger

Enums§

FuncEnumsError
ToolCallExecutionStrategy

Traits§

EnumDescriptor
A trait to provide a descriptor for an enumeration. This includes the name of the enum and the count of tokens in its name.
RunCommand
ToolSet
VariantDescriptors
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§

cosine_similarity
get_function_chat_completion_args
A function to get the chat completion arguments for a function.
get_ranked_function_names
Asynchronously retrieves and ranks function names based on their similarity to a given prompt embedding.
get_tool_chat_completion_args
A function to get the chat completion arguments for a tool.
get_tools_limited
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 the function_filtering feature flag. When function_filtering is enabled and required_func_names is specified, required functions are prioritized, followed by ranked functions until a token limit is reached. Without the function_filtering feature, all functions in allowed_func_names and required_func_names are included, irrespective of the token limit.
logger_task
rank_functions
single_embedding
Asynchronously generates a single embedding vector for the given text using a specified model.

Attribute Macros§

arg_description
The arg_description attribute is a procedural macro used to provide additional description for an enum.
func_description
This procedural macro attribute is used to specify a description for an enum variant.

Derive Macros§

EnumDescriptor
A derive procedural macro for the EnumDescriptor trait.
ToolSet
The ToolSet procedural macro is used to derive a structure which encapsulates various chat completion commands.
VariantDescriptors
A derive procedural macro for the VariantDescriptors trait.