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
>
Defined in
packages/llamaindex/src/tools/functionTool.ts:8
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
>>
Implementation of
Defined in
packages/llamaindex/src/tools/functionTool.ts:24
Methods
call()
call(
input
):R
This could be undefined if the implementation is not provided, which might be the case when communicating with a llm.
Parameters
• input: T
Returns
R
The output of the tool.
Implementation of
Defined in
packages/llamaindex/src/tools/functionTool.ts:28
from()
static
from<T
>(fn
,schema
):FunctionTool
<T
,JSONValue
|Promise
<JSONValue
>>
Type Parameters
• T
Parameters
• fn
• schema: ToolMetadata
<JSONSchemaType
<T
>>
Returns
FunctionTool
<T
, JSONValue
| Promise
<JSONValue
>>