Types representing the OpenAI function definitions. While the OpenAI client library does have types for function definitions, the properties are just Record<string, unknown>, which isn't very useful for type checking this formatting code.

interface FunctionDef {
    description?: string;
    name: string;
    parameters: ObjectProp;
}

Hierarchy

  • Omit<OpenAIFunction, "parameters">
    • FunctionDef

Properties

description?: string

A description of what the function does, used by the model to choose when and how to call the function.

name: string

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.

parameters: ObjectProp