Class: FunctionTool<T>
Type parameters
Name | Type |
---|---|
T | any |
Implements
BaseTool
Constructors
constructor
• new FunctionTool<T
>(fn
, metadata
): FunctionTool
<T
>
Type parameters
Name | Type |
---|---|
T | any |
Parameters
Name | Type |
---|---|
fn | (...args : any []) => any |
metadata | Metadata |
Returns
FunctionTool
<T
>
Defined in
packages/core/src/tools/functionTool.ts:13
Properties
_fn
• Private
_fn: (...args
: any
[]) => any
Type declaration
▸ (...args
): any
Parameters
Name | Type |
---|---|
...args | any [] |
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
Name | Type |
---|---|
...args | any [] |
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
Name | Type |
---|---|
T | any |
Parameters
Name | Type |
---|---|
fn | (...args : any []) => any |
metadata? | Metadata |