AIHelper
Helper class for constructing AI tools
Functions
6
Functions
6Convenience function to easily create a specific add records tool for the agent.
| Parameter | Type | Description |
|---|---|---|
options | Object | |
options.modelName | String | The model name to create the tool for, as configured in models |
Convenience function to easier create tools without repeating redundant code blocks. Assumes that the
parameters are of type object.
| Parameter | Type | Description |
|---|---|---|
options | Object | |
options.description | String | A quite short description of the tool's purpose for the AI agent |
options.available | Boolean | function | Whether or not the tool is available at the time of the request. If a function is provided, it must return a Boolean. |
options.fn | function | The function to call when the tool is invoked |
options.fn.arguments | Object | |
options.fn.arguments.args | Object | The arguments provided to the tool invocation |
options.properties | Object<String, AIToolProperty> | The parameters schema of the tool. The keys are the parameter names and the values are objects describing that parameter |
options.required | String[] | |
statusDescription | String | A short text message to display in the ChatPanel when this tool is being used |
Convenience function to easier create tools with support for conditions which in short is a way for the agent
and the AI feature to communicate about datasets without actually reading the datasets. In essence, they are
filters which is used when reading or modifying data to target the correct records.
| Parameter | Type | Description |
|---|---|---|
options | Object | |
options.description | String | A quite short description of the tool's purpose for the AI agent |
options.available | Boolean | function | Whether or not the tool is available at the time of the request. If a function is provided, it must return a Boolean. |
options.fn | function | The function to call when the tool is invoked |
options.fn.arguments | Object | |
options.fn.arguments.args | Object | The arguments provided to the tool invocation |
options.fn.arguments.records | Object<String, Model[]> | Model[] | If a single condition
is configured, this will contain the records matching that condition. If multiple conditions are configured, this
will be an object with the condition |
options.properties | Object<String, AIToolProperty> | The parameters schema of the tool. The keys are the
parameter names and the values are objects describing that parameter. These will be merged with the |
options.required | String[] | |
statusDescription | String | A short text message to display in the ChatPanel when this tool is being used |
options.conditions | AIToolCondition[] | Array of conditions configuration objects |
Convenience function to easily create a specific delete records tool for the agent.
| Parameter | Type | Description |
|---|---|---|
options | Object | |
options.modelName | String | The model name to create the tool for, as configured in models |
Convenience function to easily create a specific read data tool for the agent.
| Parameter | Type | Description |
|---|---|---|
options | Object | |
options.modelName | String | The model name to create the tool for, as configured in models |
Convenience function to easily create a specific update data tool for the agent.
| Parameter | Type | Description |
|---|---|---|
options | Object | |
options.modelName | String | The model name to create the tool for, as configured in models |
Typedefs
1
Typedefs
1An AI tool condition object
| Parameter | Type | Description |
|---|---|---|
name | String | The property name of the condition used in the call to the tool |
modelName | String | The model name to use with conditions, as configured in models |
required | Boolean | If the agent must provide these conditions, set this to |