FunctionTool interface

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

Extends

Properties

allowed_callers

The callers that may invoke this tool.

defer_loading

Whether this function is deferred and loaded via tool search.

description

A description of the function tool.

name

The name of the function to call.

output_schema

The schema for the function output.

parameters

The parameters schema for the function.

strict

Whether the function arguments must strictly match the parameters schema.

type

The type of the function tool. Always function.

Property Details

allowed_callers

The callers that may invoke this tool.

allowed_callers?: CallableToolAllowedCaller[]

Property Value

defer_loading

Whether this function is deferred and loaded via tool search.

defer_loading?: boolean

Property Value

boolean

description

A description of the function tool.

description?: string

Property Value

string

name

The name of the function to call.

name: string

Property Value

string

output_schema

The schema for the function output.

output_schema?: Record<string, unknown>

Property Value

Record<string, unknown>

parameters

The parameters schema for the function.

parameters?: Record<string, unknown>

Property Value

Record<string, unknown>

strict

Whether the function arguments must strictly match the parameters schema.

strict?: boolean

Property Value

boolean

type

The type of the function tool. Always function.

type: "function"

Property Value

"function"