pub fn get_function_chat_completion_args(
func: impl Fn() -> (Value, usize)
) -> Result<(Vec<FunctionObject>, usize), OpenAIError>Expand description
A function to get the chat completion arguments for a function.
§Arguments
func- A function that returns a JSON representation of a function and the count of tokens in the representation.
§Returns
- A
Resultwhich isOkif the function chat completion arguments were successfully obtained, andErrotherwise. TheOkvariant contains a tuple where the first element is aChatCompletionFunctionsrepresenting the chat completion arguments for the function, and the second element is ausizerepresenting the total count of tokens in the function’s JSON representation.