Class: FunctionTool<T, R>
Simple Tool interface. Likely to change.
Type parameters
Name | Type |
---|---|
T | T |
R | extends string | Promise <string > |
Implements
BaseTool
<T
>
Constructors
constructor
• new FunctionTool<T
, R
>(_fn
, _metadata
): FunctionTool
<T
, R
>
Type parameters
Name | Type |
---|---|
T | T |
R | extends string | Promise <string > |
Parameters
Name | Type |
---|---|
_fn | (input : T ) => R |
_metadata | ToolMetadata <JSONSchemaType <T >> |
Returns
FunctionTool
<T
, R
>
Defined in
packages/core/src/tools/functionTool.ts:7
Properties
_fn
• Private
Readonly
_fn: (input
: T
) => R
Type declaration
▸ (input
): R
Parameters
Name | Type |
---|---|
input | T |
Returns
R
Defined in
packages/core/src/tools/functionTool.ts:8
_metadata
• Private
Readonly
_metadata: ToolMetadata
<JSONSchemaType
<T
>>
Defined in
packages/core/src/tools/functionTool.ts:9
Accessors
metadata
• get
metadata(): T
extends Known
? ToolMetadata
<JSONSchemaType
<T
<T
>>> : ToolMetadata
<Record
<string
, unknown
>>
Returns
T
extends Known
? ToolMetadata
<JSONSchemaType
<T
<T
>>> : ToolMetadata
<Record
<string
, unknown
>>