Class: ObjectGeneratorTool<NAME, PROMPT, PARAMETERS, OBJECT>
A tool that generates an object. You can configure it with a model, an input, an output schema, and a prompt.
Type parameters
Name | Type |
---|---|
NAME | extends string |
PROMPT | PROMPT |
PARAMETERS | PARAMETERS |
OBJECT | OBJECT |
Hierarchy
-
Tool
<NAME
,PARAMETERS
,OBJECT
>↳
ObjectGeneratorTool
Constructors
constructor
• new ObjectGeneratorTool<NAME
, PROMPT
, PARAMETERS
, OBJECT
>(«destructured»
): ObjectGeneratorTool
<NAME
, PROMPT
, PARAMETERS
, OBJECT
>
Type parameters
Name | Type |
---|---|
NAME | extends string |
PROMPT | PROMPT |
PARAMETERS | PARAMETERS |
OBJECT | OBJECT |
Parameters
Name | Type |
---|---|
«destructured» | Object |
› description? | string |
› model | ObjectGenerationModel <PROMPT , ObjectGenerationModelSettings > |
› name? | NAME |
› objectSchema | Schema <OBJECT > & JsonSchemaProducer |
› parameters | Schema <PARAMETERS > & JsonSchemaProducer |
› prompt | (input : PARAMETERS ) => PromptFunction <PARAMETERS , PROMPT > |
Returns
ObjectGeneratorTool
<NAME
, PROMPT
, PARAMETERS
, OBJECT
>
Overrides
Defined in
packages/modelfusion/src/tool/ObjectGeneratorTool.ts:20
Properties
description
• Optional
Readonly
description: string
A optional description of what the tool does. Will be used by the language model to decide whether to use the tool.
Inherited from
Defined in
packages/modelfusion/src/tool/Tool.ts:22
execute
• Readonly
execute: (args
: PARAMETERS
, options
: FunctionCallOptions
) => PromiseLike
<OBJECT
>
The actual execution function of the tool.
Type declaration
▸ (args
, options
): PromiseLike
<OBJECT
>
The actual execution function of the tool.
Parameters
Name | Type |
---|---|
args | PARAMETERS |
options | FunctionCallOptions |
Returns
PromiseLike
<OBJECT
>
Inherited from
Defined in
packages/modelfusion/src/tool/Tool.ts:38
name
• Readonly
name: NAME
The name of the tool. Should be understandable for language models and unique among the tools that they know.
Inherited from
Defined in
packages/modelfusion/src/tool/Tool.ts:17
parameters
• Readonly
parameters: Schema
<PARAMETERS
> & JsonSchemaProducer
The schema of the input that the tool expects. The language model will use this to generate the input. Use descriptions to make the input understandable for the language model.
Inherited from
Defined in
packages/modelfusion/src/tool/Tool.ts:28
returnType
• Optional
Readonly
returnType: Schema
<OBJECT
>
An optional schema of the output that the tool produces. This will be used to validate the output.