Passa al contenuto principale

Class: FunctionTool<T>

Simple Tool interface. Likely to change.

Type parameters

NameType
Tany

Implements

Constructors

constructor

new FunctionTool<T>(fn, metadata): FunctionTool<T>

Type parameters

NameType
Tany

Parameters

NameType
fn(...args: any[]) => any
metadataMetadata

Returns

FunctionTool<T>

Defined in

packages/core/src/tools/functionTool.ts:13

Properties

_fn

Private _fn: (...args: any[]) => any

Type declaration

▸ (...args): any

Parameters
NameType
...argsany[]
Returns

any

Defined in

packages/core/src/tools/functionTool.ts:10


_metadata

Private _metadata: ToolMetadata

Defined in

packages/core/src/tools/functionTool.ts:11

Accessors

metadata

get metadata(): ToolMetadata

Returns

ToolMetadata

Implementation of

BaseTool.metadata

Defined in

packages/core/src/tools/functionTool.ts:25

Methods

call

call(...args): Promise<any>

Parameters

NameType
...argsany[]

Returns

Promise<any>

Implementation of

BaseTool.call

Defined in

packages/core/src/tools/functionTool.ts:29


fromDefaults

fromDefaults<T>(fn, metadata?): FunctionTool<T>

Type parameters

NameType
Tany

Parameters

NameType
fn(...args: any[]) => any
metadata?Metadata

Returns

FunctionTool<T>

Defined in

packages/core/src/tools/functionTool.ts:18