Options
All
  • Public
  • Public/Protected
  • All
Menu

When you implement function calling in a prompt, you create a tools object, which contains one or more function declarations.

var chart = new OrgChart('#tree', {
enableAI: true,
aiChatTools: [{
functionName: 'sendEmail',
functionDescription: 'Send an email to a given employee with a subject and message.',
functionParameters: {
type: "object",
properties: {
to: {
type: "string",
description: "The employee email address."
},
subject: {
type: "string",
description: "Email subject line."
},
body: {
type: "string",
description: "Body of the email message."
}
},
required: [
"to",
"subject",
"body"
},
additionalProperties: false
},
strict: true
}]
});

Go to AI doc page for more details

Hierarchy

  • aiChatTool

Index

Properties

functionDescription?: string

A comprehensive explanation of the function's purpose and capabilities.

functionName?: string

The unique identifier for the function within the API call.

functionParameters?: { properties?: {}; required?: string[]; type?: "object" }

Defines the input data required by the function.

Type declaration

  • Optional properties?: {}

    Lists individual parameters.

    • [key: string]: { description?: string; type?: string }
      • Optional description?: string

        A clear explanation of the parameter's purpose and expected format.

      • Optional type?: string

        The data type of the parameter, such as string, integer, boolean.

  • Optional required?: string[]

    An array of strings listing the parameter names that are mandatory for the function to operate.

  • Optional type?: "object"

    Specifies the overall data type, such as object.

Legend

  • Constructor
  • Property
  • Method
  • Static property
  • Static method
  • Property

Settings

Theme

Generated using TypeDoc