v7.3.0
SupportExamplesFree Trial

AI
Feature
Experimental

This feature provides an AI agent for the Scheduler and SchedulerPro. It provides a chat panel that allows the user to send messages to the agent and see the responses. Which allows the user to use natural language to interact with the Scheduler in different ways. For example, the user can ask the agent to filter the data, sort it, or select specific records. The agent can also perform data manipulation operations such as adding, updating, deleting records.

To use this feature, you need to provide a promptUrl to which the agent will send the prompts. On the other end of this URL, there should be a service that adds credentials to the request and forwards the prompt to the LLM API of your choice.

You also need to configure a apiPlugin which ensures the prompt format matches the API you are using.

new Scheduler({
  features : {
     ai : {
        promptUrl : '/ai/prompt',
        apiPlugin : OpenAIPlugin,
     }
  }
})

This is the minimum configuration required to get started, but you may also want to configure the following:

  • model - Adds a model property to the prompt sent to the LLM API which is often required
  • chatButton - Change the appearance of the chat button and the chat panel
  • tools - Add custom tools to the agent's tool list, or remove existing unwanted tools
  • userSettings - Provide the current user's settings
  • userSettingsUpdate - To listen for changes to the user's settings and save them

And for voice input/output, check out:

But these are not all configurations available. Check out the demo linked in the right panel for a full configuration example. And make sure to read this documentation to learn more about all available configurations.

This feature is disabled by default.

See also

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • defaultRange : Stringtimeline

    The date range to use for agent "conditions", when the user doesn't specify a given date range in the prompt. Available options are:

    • timeline - Use the current timeline date range
    • in-view - Use the current visible date range (scrolled in view)
    • all - Use the entire date range of the Scheduler
  • 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.

  • 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)

  • Set to true to enable @ mention support in the chat input field. When enabled, typing @ followed by at least one character will search configured models and show a dropdown of matching records. Selecting a record inserts a mention tag that is sent as a structured token to the LLM.

  • Minimum time in milliseconds that each async status message must be displayed before the next one replaces it. This ensures each status is visible long enough for the user to read.

  • AI model name (if applicable)

  • Set to true to enable the AI's planning tools (createPlan / completePlanSteps). When enabled, the AI is encouraged to lay out a plan before executing multi-step requests, which improves accuracy with smaller / less capable models.

  • An array of previously submitted prompts, used for ArrowUp/ArrowDown history navigation in the chat panel. When the user sends a message, a promptHistoryUpdate event is fired so the application can persist the updated list (e.g. to localStorage). Set to true or an empty array ([]) to activate the history navigation

    Has a corresponding runtime promptHistory property.

  • The URL to send text prompts to

  • redo : Booleantrue
    AI

    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.

  • timeout : Number60000
    AI

    A number of milliseconds a prompt is allowed to take before being aborted. Defaults to 60000 (1 minute).

  • undo : Booleantrue
    AI

    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.

  • autoReadAloud : Boolean/'audio-input''audio-input'
    AI

    Set to true to always read aloud received messages. Set to false to not read aloud responses to recorded messages. Defaults to audio-input which reads received messages aloud if they are a response to a local audio message.

  • Set to true to automatically start recording again after a voice response finishes playing. Only applies when the previous message was sent via voice input.

  • Set to true to automatically stop any ongoing recording and audio playback when the chat panel is hidden.

  • The URL to send text for speech synthesizing

  • The URL to send audio for transcribing

  • Configuration settings for voice activation

    Properties

    • conversationTimeout : Number600000

      The time in milliseconds a voice conversation is allowed to be active. Defaults to 10 minutes.

    • replyOnActivation : Booleantrue

      Set to true to have the AI reply immediately when the phrase is recognized, without waiting for further user input.

    • language : String'en-US'

      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 : Booleanfalse

      Set to true to start voice activation on page load

    • useNativeSpeechRecognition : Booleantrue

      Set to true to use the browser's native speech recognition (if available). At this time, this is required to be set to true to get voice activation to work.

  • Forces voice only mode, which hides the chat panel and only shows a record chat button.

  • Internal listeners, that cannot be removed by the user.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isAI : Booleantrue
    READONLY
    static
    ADVANCED
    Identifies an object as an instance of AI class, or subclass thereof.
  • properties : Object
    internal
    static
    AI

    A class property getter for the default values of internal properties for this class.

  • An array of previously submitted prompts, used for ArrowUp/ArrowDown history navigation in the chat panel. When the user sends a message, a promptHistoryUpdate event is fired so the application can persist the updated list (e.g. to localStorage). Set to true or an empty array ([]) to activate the history navigation

    Has a corresponding promptHistory config.

  • emptyArray : Array
    internal
    READONLY
    AI

    An empty array that can be used as a default value.

  • emptyObject : Object
    internal
    READONLY
    AI

    An empty object that can be used as a default value.

  • isAI : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of AI class, or subclass thereof.
  • isAIBase : Booleantrue
    READONLY
    ADVANCED
    AI
    Identifies an object as an instance of AIBase class, or subclass thereof.
  • isInstancePlugin : Booleantrue
    READONLY
    ADVANCED
    AI
    Identifies an object as an instance of InstancePlugin class, or subclass thereof.
  • config : Object
    READONLY
    ADVANCED
    AI

    Returns a copy of the full configuration which was used to configure this object.

  • isConstructing : Boolean
    READONLY
    ADVANCED
    AI

    This property is set to true before the constructor returns.

  • isDestroying : Boolean
    READONLY
    ADVANCED
    AI

    This property is set to true on entry to the destroy method. It remains on the objects after returning from destroy(). If isDestroyed is true, this property will also be true, so there is no need to test for both (for example, comp.isDestroying || comp.isDestroyed).

  • client : Widget
    READONLY
    ADVANCED
    AI

    The Widget which was passed into the constructor, which is the Widget we are providing extra services for.

Functions

Functions are methods available for calling on the class
  • onClassMixedIn( )
    internal
    static
    AI

    This optional class method is called when a class is mixed in using the mixin() method.

  • Internal function used to hook destroy() calls when using thisObj

  • Internal function used restore hooked destroy() calls when using thisObj

  • once( )
    private
    Events

    Internal function used to run a callback function after an event is triggered

  • Removes all listeners registered to this object by the application.

  • updateKeyMap( )
    private
    AI

    This will merge a feature's (subclass of InstancePlugin) keyMap with it's client's keyMap.

Events

Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

Event handlers

Event handlers are callbacks called as a result of certain actions in this class
id: ai

Source path

Scheduler/feature/AI.js

Demo

examples/ai-skillmatching

Contents