Class: FunctionTool<T, R>
Simple Tool interface. Likely to change.
Type parameters
• T
• R extends JSONValue
| Promise
<JSONValue
>
Implements
BaseTool
<T
>
Constructors
new FunctionTool()
new FunctionTool<
T
,R
>(_fn
,_metadata
):FunctionTool
<T
,R
>
Parameters
• _fn
• _metadata: ToolMetadata
<JSONSchemaType
<T
>>
Returns
FunctionTool
<T
, R
>
Source
packages/core/src/tools/functionTool.ts:7
Properties
_fn()
private
readonly
_fn: (input
) =>R
Parameters
• input: T
Returns
R
Source
packages/core/src/tools/functionTool.ts:8
_metadata
private
readonly
_metadata:ToolMetadata
<JSONSchemaType
<T
>>
Source
packages/core/src/tools/functionTool.ts:9
Accessors
metadata
get
metadata():T
extendsKnown
?ToolMetadata
<JSONSchemaType
<T
<T
>>> :ToolMetadata
<Record
<string
,unknown
>>
Returns
T
extends Known
? ToolMetadata
<JSONSchemaType
<T
<T
>>> : ToolMetadata
<Record
<string
, unknown
>>