Defines a function in your own code the model can choose to call. Learn more about function calling.

interface FunctionTool {
    description?: null | string;
    name: string;
    parameters: Record<string, unknown>;
    strict: boolean;
    type: "function";
}

Properties

description?: null | string

A description of the function. Used by the model to determine whether or not to call the function.

name: string

The name of the function to call.

parameters: Record<string, unknown>

A JSON schema object describing the parameters of the function.

strict: boolean

Whether to enforce strict parameter validation. Default true.

type: "function"

The type of the function tool. Always function.