v7.3.0

AI
Feature
Experimental

This feature provides an AI agent for the Calendar. 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 Calendar 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 Calendar({
  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

Useful configs

Config Description
promptUrl URL endpoint for sending prompts to the LLM
apiPlugin Plugin matching the LLM API format
model Model identifier passed to the LLM API
tools Custom tools for the AI agent
defaultRange Date range scope for agent conditions
No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • defaultRange : 'timeline'/'all'timeline

    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 active date range
    • all - Use the entire date range of the dataset

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.
  • isAI : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of AI class, or subclass thereof.
id: ai

Source path

Calendar/feature/AI.js

Demo

examples/ai-pest-control

Contents