Attribute Macro openai_func_enums::arg_description
source · #[arg_description]Expand description
The arg_description attribute is a procedural macro used to provide additional description for an enum.
This attribute does not modify the code it annotates but instead attaches metadata in the form of a description. This can be helpful for better code readability and understanding the purpose of different enums.
Usage
#[arg_description(description = "This is a sample enum.", tokens = 5)]
#[derive(EnumDescriptor)]
pub enum SampleEnum {
Variant1,
Variant2,
}Note: The actual usage of the description and tokens provided through this attribute happens
in the EnumDescriptor derive macro and is retrieved in the enum_descriptor_derive function.
The arg_description attribute takes one argument, description, which is a string literal.