AIBase
Base class for AI chat feature. Not to be used directly.
Configs
38
Configs
38Other
AI plugin to use. Provide the class here. Available plugins are:
OpenAIPlugin- use OpenAI APIAnthropicPlugin- use Anthropic APIGooglePlugin- use Google API
You can also provide a custom plugin by extending the AbstractApiPlugin class.
Shows an AI model selector in the SettingsPanel where the user can select between the available API:s
Set this to true or a config object to add a ChatButton
Set to true to automatically console.log things that happen internally. AI responses and audio processing
for example.
An array of strings which will be circulated as waiting status texts when awaiting long AI responses
Defaults to ['Waiting', 'Waiting ...', 'Still waiting', 'Still waiting ...']
The URL to send feedback (thumbs up/thumbs down) to
Additional options to pass to fetch requests
By default, data item which are targeted in an AI action will be highlighted in the UI. Set this to false
to prevent this behavior.
Set to false to not manage chat history on the client
Max tokens setting (if applicable)
AI model name (if applicable)
Use this to provide more details of data models currently available for the AI agent to work with. Provide an object with model class names as keys and configuration objects as values.
A setup in a Bryntum Grid application which uses the class Project for its rows and also have a related class Member could look like this:
{
Member : { store : memberStore },
Project : {
relations : {
members : {
relatedModelName : 'Member'
},
owner : {
relatedModelName : 'Member'
}
}
}
}
The URL to send text prompts to
Enables support for redoing data modifying actions performed by the AI. Shows a redo icon under the last redoable message in the ChatPanel. Requires undo to be enabled.
Set to true to always prompt the user for confirmation before allowing the AI to add records
Set to true to always prompt the user for confirmation before allowing the AI to remove records
Set to true to always prompt the user for confirmation before allowing the AI to update records
Set to true to upon creation, send a test prompt to verify the connection to the AI backend. If the test
fails, a warning icon will be shown on the chat panel.
Temperature setting (if applicable). Overrides the default temperature set by the apiPlugin.
The URL to send text for speech synthesizing
A number of milliseconds a prompt is allowed to take before being aborted. Defaults to 60000 (1 minute).
Use this to add custom tools to the AI model's tool list or to remove existing tools. Provide an object with the tool names as keys and configuration objects as values. Please note that modifying existing tools is not supported, only removing them.
Available tools (for AIBase) are:
changeTheme- Switches between dark and light themesundo- Undoes the last action performed by the AIendVoiceConversation- Ends the current voice conversation
More tools are available for the specific product AI features
Use this to provide example prompt scenarios to "teach" the AI of more complex tasks. Must be configured as an array containing arrays which contains the AI messages for the complete conversation.
Please be advised that the content here will be provided in each request sent to the AI API and will therefore consume tokens and take up space in the context window.
Adding an example to the "training data" will often solve one particular case, but may "confuse" the AI in ways not expected.
The URL to send audio for transcribing
Enables support for undoing data modifying actions performed by the AI. Shows an undo icon under the last undoable message in the ChatPanel.
A configuration object containing the user's preferred AI feature settings. If there is a matching AI feature class config, the user setting will take precedence JSON.
Experimental configuration of the AI verbosity. Valid values are "1", "2" and "3", where "1" is
lowest.
Configuration settings for voice activation
Forces voice only mode, which hides the chat panel and only shows a record chat button.
Misc
Properties
15
Properties
15Common
Class hierarchy
Other
Functions
28
Functions
28Configuration
Events
Misc
Other
Events
6
Events
6Fired when the user changes it's settings via the settings panel
// Adding a listener using the "on" method
aIBase.on('userSettingsUpdate', ({ userSettings, changes }) => {
});| Parameter | Type | Description |
|---|---|---|
userSettings | AISettingsModel | The user settings record |
changes | Object | The changed properties and the new value |
Event handlers
6
Event handlers
6Called when the user changes it's settings via the settings panel
new AIBase({
onUserSettingsUpdate({ userSettings, changes }) {
}
});| Parameter | Type | Description |
|---|---|---|
userSettings | AISettingsModel | The user settings record |
changes | Object | The changed properties and the new value |
Typedefs
7
Typedefs
7Configuration object used in the AI feature models config
| Parameter | Type | Description |
|---|---|---|
store | Store | The store instance for this model |
relations | Object<String, AIRelatedModelConfiguration> | Relations configuration. Provide an object with the relation properties as keys and a configuration object as value |
Configuration object for the AI feature's availableApis config. All properties are required.
| Parameter | Type | Description |
|---|---|---|
id | String | The AI model code, will be sent to the |
name | String | The AI model display name, will be used in AI model selector |
apiPlugin | Class | The |
Configuration object used in the AIModelConfiguration
| Parameter | Type | Description |
|---|---|---|
relatedModelName | String | The related model class name |
description | String | A description which will be included in the model details provided to the AI agent |
Tool configuration object
| Parameter | Type | Description |
|---|---|---|
arguments | Object | |
arguments.args | Object | The arguments provided to the tool invocation |
| Parameter | Type | Description |
|---|---|---|
description | String | A quite short description of the tool's purpose for the AI agent |
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. |
fn | function | The function to call when the tool is invoked |
parameters | Object<string, AIToolProperty> | The parameters schema of the tool. The keys are the parameter names and the values are objects describing that parameter |
A tool parameters schema object
| Parameter | Type | Description |
|---|---|---|
type | String | The type of the property: |
description | String | A short description of the property's purpose for the AI agent |
properties | Object<String, AIToolProperty> | If the property is an object, this describes the properties of the object. |
required | String[] | If the property is an object, this describes the required properties of the object |
items | AIToolProperty | If the property is an array, this describes the items of the array |
Configuration object used in the AI feature's voiceActivation config
| Parameter | Type | Description |
|---|---|---|
conversationTimeout | Number | The time in milliseconds a voice conversation is allowed to be active. Defaults to 10 minutes. |
replyOnActivation | Boolean | Set to |
language | String | The language code for the native speech recognition |
autoStartDialogConfig | Object | Configuration object for the dialog asking the user to enable voice activation on page load |
phrase | String | The phrase to listen for to activate voice control |
autoStart | Boolean | Set to |
useNativeSpeechRecognition | Boolean | Set to |