Configuring Actions
Learn how to define the specific tasks and functions your AI copilot can perform.
Actions are the "verbs" of your AI copilot. They represent the specific, executable tasks your AI can perform in response to a user's prompt. Defining clear and descriptive actions is the most crucial step in making your copilot powerful and reliable.
The AI model uses the name
and description
of your actions and their parameters to determine which function to call based on the user's natural language request.
Core Concepts
Action
An Action is a single function your copilot can execute.
- Name: A human-readable title for the action (e.g., "Create a New Task").
- Key: A machine-readable identifier used to map the action to your client-side code (e.g.,
createTask
). This should be incamelCase
and cannot be changed after creation. - Description: A detailed, natural language explanation of what the action does, what it's for, and when it should be used. This is the most important field for the AI. A good description is essential for the model to accurately trigger the action.
Parameter
A Parameter is an argument that an Action requires to run.
- Name: The machine-readable name of the argument (e.g.,
title
,dueDate
). - Type: The data type of the parameter (
String
,Number
, orDate
). - Description: A clear explanation of what this parameter represents (e.g., "The title of the task to be created.").
- Required: A toggle indicating whether this parameter is mandatory for the action to execute.
How to Create an Action
Navigate to the Actions Tab
From your application's dashboard, go to the Actions tab. Here you will see a list of all actions you've configured for the selected app.
Add a New Action
Click the "Add Action" button to open the creation dialog.
Define the Action
Fill in the primary details for your action. Let's use an example of creating a task in a project management app.
- Action Name:
Create a New Task
- Key:
createTask
- Description:
Creates a new task in the system. Use this when the user wants to add a to-do item or a task.
Add Parameters
Click the "Add Parameter" button for each piece of information your action needs.
For our createTask
example, we might need:
- Parameter 1:
- Name:
title
- Type:
String
- Description:
The title or name of the task to be created.
- Required:
true
- Name:
- Parameter 2:
- Name:
assigneeId
- Type:
String
- Description:
The unique ID of the user to whom this task should be assigned.
- Required:
false
- Name:
- Parameter 3:
- Name:
dueDate
- Type:
Date
- Description:
The date when the task is due, in ISO 8601 format (YYYY-MM-DD).
- Required:
false
- Name:
Save the Action
Once you've defined your action and its parameters, click "Create Action" or "Update Action". It is now available for the AI to use.
Write for the AI: Always write your descriptions as if you're instructing
an assistant. For example, instead of "Task title", a better description for
the title
parameter is "The title or name of the task being created."
The Action Key (createTask
in our example) is used to link to the
function in your application's code. It cannot be changed after the action is
created.
With your actions defined, the next step is to provide your copilot with the necessary "context" to find information like assigneeId
.